Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduced build warnings [-Wmissing-declarations] #1876

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/acl/external/AD_group/ext_ad_group_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ char *WIN32_ErrorMessage = nullptr;
wchar_t **User_Groups;
int User_Groups_Count = 0;

wchar_t *My_NameTranslate(wchar_t *, int, int);
char *Get_WIN32_ErrorMessage(HRESULT);
static wchar_t *My_NameTranslate(wchar_t *, int, int);
static char *Get_WIN32_ErrorMessage(HRESULT);

void
static void
CloseCOM(void)
{
if (WIN32_COM_initialized == 1)
CoUninitialize();
}

HRESULT
static HRESULT
GetLPBYTEtoOctetString(VARIANT * pVar, LPBYTE * ppByte)
{
HRESULT hr = E_FAIL;
Expand Down Expand Up @@ -150,7 +150,7 @@ GetLPBYTEtoOctetString(VARIANT * pVar, LPBYTE * ppByte)
return hr;
}

wchar_t *
static wchar_t *
Get_primaryGroup(IADs * pUser)
{
HRESULT hr;
Expand Down Expand Up @@ -208,7 +208,7 @@ Get_primaryGroup(IADs * pUser)
return result;
}

char *
static char *
Get_WIN32_ErrorMessage(HRESULT hr)
{
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |
Expand All @@ -222,7 +222,7 @@ Get_WIN32_ErrorMessage(HRESULT hr)
return WIN32_ErrorMessage;
}

wchar_t *
static wchar_t *
My_NameTranslate(wchar_t * name, int in_format, int out_format)
{
IADsNameTranslate *pNto;
Expand Down Expand Up @@ -277,7 +277,7 @@ My_NameTranslate(wchar_t * name, int in_format, int out_format)
return wc;
}

wchar_t *
static wchar_t *
GetLDAPPath(wchar_t * Base_DN, int query_mode)
{
wchar_t *wc;
Expand All @@ -293,7 +293,7 @@ GetLDAPPath(wchar_t * Base_DN, int query_mode)
return wc;
}

char *
static char *
GetDomainName(void)
{
static char *DomainName = nullptr;
Expand Down Expand Up @@ -343,7 +343,7 @@ GetDomainName(void)
return DomainName;
}

int
static int
add_User_Group(wchar_t * Group)
{
wchar_t **array;
Expand Down Expand Up @@ -398,7 +398,7 @@ wcstrcmparray(const wchar_t * str, const char **array)
return -1;
}

HRESULT
static HRESULT
Recursive_Memberof(IADs * pObj)
{
VARIANT var;
Expand Down Expand Up @@ -520,7 +520,7 @@ build_groups_DN_array(const char **array, char *userdomain)
}

/* returns 1 on success, 0 on failure */
int
static int
Valid_Local_Groups(char *UserName, const char **Groups)
{
int result = 0;
Expand Down Expand Up @@ -598,7 +598,7 @@ Valid_Local_Groups(char *UserName, const char **Groups)
}

/* returns 1 on success, 0 on failure */
int
static int
Valid_Global_Groups(char *UserName, const char **Groups)
{
int result = 0;
Expand Down Expand Up @@ -730,7 +730,7 @@ usage(const char *program)
program);
}

void
static void
process_options(int argc, char *argv[])
{
int opt;
Expand Down
10 changes: 5 additions & 5 deletions src/acl/external/LM_group/ext_lm_group_acl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ int use_case_insensitive_compare = 0;
char *DefaultDomain = nullptr;
const char NTV_VALID_DOMAIN_SEPARATOR[] = "\\/";

char *
static char *
AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr)
{
size_t len;
Expand All @@ -127,7 +127,7 @@ AllocStrFromLSAStr(LSA_UNICODE_STRING LsaStr)
return target;
}

char *
static char *
GetDomainName(void)
{
LSA_HANDLE PolicyHandle;
Expand Down Expand Up @@ -233,7 +233,7 @@ wcstrcmparray(const wchar_t * str, const char **array)
}

/* returns 1 on success, 0 on failure */
int
static int
Valid_Local_Groups(char *UserName, const char **Groups)
{
int result = 0;
Expand Down Expand Up @@ -308,7 +308,7 @@ Valid_Local_Groups(char *UserName, const char **Groups)
}

/* returns 1 on success, 0 on failure */
int
static int
Valid_Global_Groups(char *UserName, const char **Groups)
{
int result = 0;
Expand Down Expand Up @@ -466,7 +466,7 @@ usage(const char *program)
program);
}

void
static void
process_options(int argc, char *argv[])
{
int opt;
Expand Down
8 changes: 3 additions & 5 deletions src/auth/negotiate/SSPI/negotiate_sspi_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ static int have_serverblob;
#define SEND3(X,Y,Z) debug("sending '" X "' to squid\n",Y,Z); printf(X "\n",Y,Z);
#endif

char *negotiate_check_auth(SSP_blobP auth, int auth_length);

/*
* options:
* -d enable debugging.
* -v enable verbose Negotiate packet debugging.
*/
char *my_program_name = nullptr;

void
static void
usage()
{
fprintf(stderr,
Expand All @@ -90,7 +88,7 @@ usage()
my_program_name);
}

void
static void
process_options(int argc, char *argv[])
{
int opt, had_error = 0;
Expand Down Expand Up @@ -135,7 +133,7 @@ token_decode(size_t *decodedLen, uint8_t decoded[], const char *buf)
return true;
}

int
static int
manage_request()
{
char buf[HELPER_INPUT_BUFFER];
Expand Down
48 changes: 14 additions & 34 deletions src/auth/ntlm/SMB_LM/ntlm_smb_lm_auth.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,6 @@
#define SEND3 printf
#endif

const char *make_challenge(char *domain, char *controller);
char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length);
void dc_disconnect(void);
int connectedp(void);
int is_dc_ok(char *domain, char *domain_controller);

typedef struct _dc dc;
struct _dc {
char *domain;
Expand All @@ -79,10 +73,13 @@ struct _dc {
};

/* local functions */
void usage(void);
void process_options(int argc, char *argv[]);
const char * obtain_challenge(void);
void manage_request(void);
static void usage(void);
static void process_options(int argc, char *argv[]);
static const char * obtain_challenge(void);
static void manage_request(void);
static const char *make_challenge(char *domain, char *controller);
static char *ntlm_check_auth(ntlm_authenticate * auth, int auth_length);
static void dc_disconnect(void);

#define ENCODED_PASS_LEN 24
#define MAX_USERNAME_LEN 255
Expand All @@ -108,31 +105,14 @@ char smb_error_buffer[1000];

/* Disconnects from the DC. A reconnection will be done upon the next request
*/
void
static void
dc_disconnect()
{
if (handle != NULL)
SMB_Discon(handle, 0);
handle = nullptr;
}

int
connectedp()
{
return (handle != NULL);
}

/* Tries to connect to a DC. Returns 0 on failure, 1 on OK */
int
is_dc_ok(char *domain, char *domain_controller)
{
SMB_Handle_Type h = SMB_Connect_Server(nullptr, domain_controller, domain);
if (h == NULL)
return 0;
SMB_Discon(h, 0);
return 1;
}

/* returns 0 on success, > 0 on failure */
static int
init_challenge(char *domain, char *domain_controller)
Expand Down Expand Up @@ -169,7 +149,7 @@ init_challenge(char *domain, char *domain_controller)
return 0;
}

const char *
static const char *
make_challenge(char *domain, char *domain_controller)
{
/* trying to circumvent some strange problem with pointers in SMBLib */
Expand Down Expand Up @@ -215,7 +195,7 @@ make_challenge(char *domain, char *domain_controller)
* In case of problem sets as side-effect ntlm_errno to one of the
* codes defined in ntlm.h
*/
char *
static char *
ntlm_check_auth(ntlm_authenticate * auth, int auth_length)
{
char pass[MAX_PASSWD_LEN+1];
Expand Down Expand Up @@ -383,7 +363,7 @@ timeout_during_auth(int)
*/
char *my_program_name = nullptr;

void
static void
usage()
{
fprintf(stderr,
Expand All @@ -399,7 +379,7 @@ usage()

/* int debug_enabled=0; defined in libcompat */

void
static void
process_options(int argc, char *argv[])
{
int opt, j, had_error = 0;
Expand Down Expand Up @@ -479,7 +459,7 @@ process_options(int argc, char *argv[])
* tries connecting to the domain controllers in the "controllers" ring,
* with failover if the adequate option is specified.
*/
const char *
static const char *
obtain_challenge()
{
int j = 0;
Expand Down Expand Up @@ -516,7 +496,7 @@ obtain_challenge()
return nullptr;
}

void
static void
manage_request()
{
ntlmhdr *fast_header;
Expand Down