Xymon Mailing List Archive search

Problem with file owner/group check

list Ian Marsh
Fri, 14 Jan 2011 15:49:28 -0000
Message-Id: <user-4fb908335788@xymon.invalid>

  Thanks for that, it all works now. :) 

Thank you,
Ian Marsh
 IT Service Operations - Network Services


-----Original Message-----
From: Henrik "Størner [mailto:user-ce4a2c883f75@xymon.invalid] Sent: 14 January 2011 15:42
To: xymon at xymon.com
Subject: Re: [xymon] Problem with file owner/group check

In <user-59f8ce4949f4@xymon.invalid> "Marsh, Ian" <user-ba159ca7ed42@xymon.invalid> writes:
   Thanks for such a quick response! I can confirm that the patch = works, but only if you test against the numeric uid's and gid's. If you = try to test against the names then you get the same result I was seeing = before; the MAN page for hobbit-clients.cfg says you can use either but = that doesn't appear to be the case.... I'd prefer to use the user and = group names if possible, just so that it makes more sense to the less = experienced members of the support team!
I should have looked at little further down in the code... if you search the hobbitd/client_config.c file for "ownerid=" you'll see that is where the patch went in. And just a few lines further down is a line with

   currule->flags |= FCHK_OWNERSTR;
   currule->rule.fcheck.ownerstr = strdup(tok+6);

Change that line to "p+1" instead of "tok+6":

   currule->rule.fcheck.ownerstr = strdup(p+1);

and usernames should work. An identical fix some 15 lines or so further down fixes it for the groupnames.


Regards,
Henrik