Subject: Re: [vserver] OCS and VServer
From: Corey Wright <undefined@pobox.com>
Date: Tue, 13 Jan 2009 23:26:04 -0600

On Tue, 13 Jan 2009 18:16:54 -0500
"John A. Sullivan III" <jsullivan@opensourcedevel.com> wrote:

> The problem is the inventory routine checks for read access to /dev/mem
> and, if it cannot read /dev/mem, it fails.  The final gist of the thread
> was the check is simply to ensure the user has root privileges and the
> solution was to comment out the check.  Perhaps I am ignorant but I
> think I would rather still check for proper privileges rather than have
> the routine inexplicably fail.
> 
> What I did instead was to edit ocsinventory-client.pl by changing
> unless(-r "/dev/mem"){
>        die localtime()." => You don't have enough rights to
> run this program\n";
> }
> to
> unless(-w "/root"){
>        die localtime()." => You don't have enough rights to
> run this program\n";
> }
> 
> I know very little about VServer, OCS, or perl but it works for me.  Any
> corrections are most welcomed.

not really a "correction", but a suggestion...

if you want to know what the effective user id is, then what's wrong with:
 - geteuid() (or whatever the perl wrapper function is called; in python
it's "os.geteuid()")?
 - "id -u"?

in either case the return/output value should be zero (0 & "0",
respectively) for root.

corey
-- 
undefined@pobox.com