1
0

added function name in log

This commit is contained in:
Daniel Tartavel 2020-06-08 16:45:24 +02:00
parent 94198e6a25
commit a4b85fa73c

8
main.c
View File

@ -219,6 +219,7 @@ int readconfig( struct config * cfg )
} }
if (cfg->commande[0] == 0) if (cfg->commande[0] == 0)
{ {
strcpy(cfg->commande,"no command found");
printf("command not found in config file: no command will be executed\n"); printf("command not found in config file: no command will be executed\n");
retval += 4; retval += 4;
} }
@ -558,14 +559,9 @@ int main()
sprintf( str, "%s \"%s - %s: Démarrage de sshdetect\"", cfg.commande, cfg.hostname, date ); sprintf( str, "%s \"%s - %s: Démarrage de sshdetect\"", cfg.commande, cfg.hostname, date );
id=fork(); id=fork();
if(id == 0) if(id == 0)
{
if (cfg.commande[0] != 0)
{ {
r = system( str ); r = system( str );
}else printlog("str", WARNING, 0);
{
printlog("no command defined: no command launched", WARNING, 0);
}
exit(r); exit(r);
}else if( id<0 ) }else if( id<0 )
{ {