Skip to content
Merged
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
4 changes: 4 additions & 0 deletions src/addagent/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
/* Prototypes */
static void helpmsg(void) __attribute__((noreturn));
static void print_banner(void);
#ifndef WIN32
static void manage_shutdown(int sig) __attribute__((noreturn));
#endif


#if defined(__MINGW32__)
Expand Down Expand Up @@ -66,6 +68,7 @@ static void print_banner()
return;
}

#ifndef WIN32
/* Clean shutdown on kill */
static void manage_shutdown(__attribute__((unused)) int sig)
{
Expand All @@ -79,6 +82,7 @@ static void manage_shutdown(__attribute__((unused)) int sig)

exit(0);
}
#endif

int main(int argc, char **argv)
{
Expand Down
2 changes: 2 additions & 0 deletions src/rootcheck/rootcheck-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ short eval_bool2(char *str, short default_val)
int Read_Rootcheck_Config(const char *cfgfile)
{
OS_XML xml;
#ifdef OSSECHIDS
char *str = NULL;
#endif

/* XML Definitions */
const char *(xml_base_dir[]) = {xml_rootcheck, "base_directory", NULL};
Expand Down
1 change: 1 addition & 0 deletions src/syscheckd/run_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <sched.h>
#endif
#ifdef WIN32
#include <winsock2.h>
#include <aclapi.h>
#include <sddl.h>
#endif
Expand Down
4 changes: 3 additions & 1 deletion src/syscheckd/syscheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

/* Prototypes */
static void read_internal(int debug_level);
#ifndef WIN32
static void help_syscheckd(void) __attribute__((noreturn));
#endif

syscheck_config syscheck;

Expand Down Expand Up @@ -163,6 +165,7 @@ int Start_win32_Syscheck()
}
#endif /* WIN32 */

#ifndef WIN32
/* Print help statement */
static void help_syscheckd()
{
Expand All @@ -180,7 +183,6 @@ static void help_syscheckd()
exit(1);
}

#ifndef WIN32
/* Syscheck unix main */
int main(int argc, char **argv)
{
Expand Down
15 changes: 9 additions & 6 deletions src/win32/agent_auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void SendSecurityToken(const int socket, SecBuffer *OutBuffers)
}
}

void CreateSecureConnection(char *manager, int port, int *socket, CtxtHandle *context, CredHandle *cred)
void CreateSecureConnection(char *manager, char *port, int *socket, CtxtHandle *context, CredHandle *cred)
{
SECURITY_STATUS status;
SCHANNEL_CRED auth_cred;
Expand All @@ -73,7 +73,7 @@ void CreateSecureConnection(char *manager, int port, int *socket, CtxtHandle *co
*socket = OS_ConnectTCP(port, manager);

if (socket == 0)
ErrorExit("%s: Unable to connect to %s:%d", ARGV0, manager, port);
ErrorExit("%s: Unable to connect to %s:%s", ARGV0, manager, port);



Expand Down Expand Up @@ -148,7 +148,7 @@ void CreateSecureConnection(char *manager, int port, int *socket, CtxtHandle *co
// Send remaining tokens if any
SendSecurityToken(*socket, OutBuffers);

printf("INFO: Connected to %s:%d\n", manager, port);
printf("INFO: Connected to %s:%s\n", manager, port);
LocalFree(buffer);
}

Expand Down Expand Up @@ -391,15 +391,18 @@ int main(int argc, char **argv)
ErrorExit("%s: -%c needs an argument",ARGV0, c);
agentname = optarg;
break;
case 'p':
case 'p': {
if(!optarg)
ErrorExit("%s: -%c needs an argument",ARGV0, c);
port = atoi(optarg);
if(port <= 0 || port >= 65536)
int tmp_port;
tmp_port = atoi(optarg);
if(tmp_port <= 0 || tmp_port >= 65536)
{
ErrorExit("%s: Invalid port: %s", ARGV0, optarg);
}
port = optarg;
break;
}
case 'P':
if (!optarg)
ErrorExit("%s: -%c needs an argument", ARGV0, c);
Expand Down