Subject: OCS and VServer
From: "John A. Sullivan III" <jsullivan@opensourcedevel.com>
Date: Tue, 13 Jan 2009 18:16:54 -0500

I was reading an old post
(http://www.mail-archive.com/vserver@list.linux-vserver.org/msg10430.html) on using
OCS inventory on a VServer guest and I was somewhat suspicious of the advice.  Perhaps
there is a better way and so I've posted for archival purposes.

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.

By the way, we want to run OCS on a guest rather than simply the host
because we are using it as part of OSSIM and would like the software
inventory to correlate against vulnerability and attacks to properly
assess risk level.  We realize we are recording the same hardware
several times.  Thanks - John
-- 
John A. Sullivan III
Open Source Development Corporation
+1 207-985-7880
jsullivan@opensourcedevel.com

http://www.spiritualoutreach.com
Making Christianity intelligible to secular society