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

fix debug message before parsing agent.conf to give the right filename #663

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doke2
Copy link
Contributor

@doke2 doke2 commented Sep 11, 2015

No description provided.

@ddpbsd
Copy link
Member

ddpbsd commented Sep 29, 2015

What file is listed if there is no agent.conf on that agent?

@doke2
Copy link
Contributor Author

doke2 commented Sep 29, 2015

All this does is correct one minor debug message.  Without this patch,

it will list the normal config file (twice). With this patch, it will list
the AGENTCONFIG file, as defined in headers/defs.h. Either way, agents
will always try to read the AGENTCONFIG file. If there is no agent.conf,
the read will warn but not fail, and the program will continue. Here's the
defs.h line, and a diff with expanded context.

#define AGENTCONFIG     DEFAULTDIR "/etc/shared/agent.conf"


diff --git a/src/syscheckd/config.c b/src/syscheckd/config.c
index 6e9092a..1d1a6f7 100644
--- a/src/syscheckd/config.c
+++ b/src/syscheckd/config.c
@@ -41,21 +41,21 @@ int Read_Syscheck_Config(const char *cfgfile)
 syscheck.prefilter_cmd  = NULL;

 debug2("%s: Reading Configuration [%s]", "syscheckd", cfgfile);

 /* Read config */
 if (ReadConfig(modules, cfgfile, &syscheck, NULL) < 0) {
     return (OS_INVALID);
 }

 #ifdef CLIENT
-    debug2("%s: Reading Client Configuration [%s]", "syscheckd", cfgfile);
+    debug2("%s: Reading Client Configuration [%s]", "syscheckd", AGENTCONFIG);

 /* Read shared config */
 modules |= CAGENT_CONFIG;
 ReadConfig(modules, AGENTCONFIG, &syscheck, NULL);
 #endif

 #ifndef WIN32
 /* We must have at least one directory to check */
 if (!syscheck.dir || syscheck.dir[0] == NULL) {
     return (1);

Dan Parriott notifications@github.com said:

What file is listed if there is no agent.conf on that agent?

                                           Cheers,
                                           Doke

@ddpbsd
Copy link
Member

ddpbsd commented Sep 29, 2015

Cool, as long as it doesn't mention the agent.conf when it reads the ossec.conf I'm ok with the change.

@reyjrar reyjrar added the bug label Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants