fix to 4.2.0 uid and gid checking

Bill Baker bill.baker at mfms.com
Thu Sep 25 19:12:17 CEST 2008


I attempted to use FILE uid and gid checking in hobbit-clients.cfg.  I
ran into the same problem listed below on an e-mail dating back to 2007.
There was not a thread that showed a correction to the problem so I
search your source code for the problem.  I found it in the module
client_config.c.  In your original 4.2.0 code, the +8 below were +6.
From what I can gleam from module client_config.c, the you had planned
to use "owner" and "group" until you realized that group was reserved,
so you switched to "ownerid" and "groupid".  The only problem was that
you did not change the parsing position for the input data.  


Bill

 

 

                                               uid = strtol(tok+8,
&eptr, 10);

                                                if (*eptr == '\0') {

                                                        /* All numeric
*/

                                                        currule->flags
|= FCHK_OWNERID;

 
currule->rule.fcheck.ownerid = uid;

                                                }

                                                else {

                                                        currule->flags
|= FCHK_OWNERSTR;

 
currule->rule.fcheck.ownerstr = strdup(tok+8);

                                                }

                                        }

                                        else if (strncasecmp(tok,
"groupid=", 8) == 0) {

                                                /* Cannot use "group"
because that is reserved */

                                                char *eptr;

                                                int uid;

 

                                                uid = strtol(tok+8,
&eptr, 10);

                                                if (*eptr == '\0') {

                                                        /* All numeric
*/

                                                        currule->flags
|= FCHK_GROUPID;

 
currule->rule.fcheck.groupid = uid;

                                                }

                                                else {

                                                        currule->flags
|= FCHK_GROUPSTR;

 
currule->rule.fcheck.groupstr = strdup(tok+8);

                                                }


 


 


 


##########


problem checking directory oid / gid

________________________________


*	To: hobbit (at) hswn.dk 
*	Subject: problem checking directory oid / gid 
*	From: Joost van den Broek <joost (at) seat-ibiza.nl> 
*	Date: Sun, 18 Feb 2007 21:16:22 +0100 
*	User-agent: Thunderbird 2.0b2 (X11/20070209) 

________________________________

size=2 width="100%" align=center> 
Hi,

 

I get the following status message:

 

/tmp
File is owned by user root  - should be d=root
File is owned by group root  - should be d=root

 

The config files contain:

 

hobbit-clients.cfg
FILE /tmp yellow type=dir ownerid=root groupid=root mode=1777

 

client-local.cfg
file:/tmp


Removing ownerid and groupid will give back a green status - what is
going wrong?

Thanks,


Joost

 

 



Confidentiality Notice: 
This is a transmission from a Winter Haven Hospital facility. This message and any attached documents may be confidential and contain information protected by state and federal medical privacy statutes. They are intended only for the use of the addressee. If you are not the intended recipient, any disclosure, copying, or distribution of this information is strictly prohibited. If you received this transmission in error, please accept our apologies and notify the sender.

This Outbound Message has been scanned for Viruses and objectionable content by McAfee Secure Internet Gateway.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20080925/7b77295b/attachment.html>


More information about the Xymon mailing list