[Charlotte.PM] Doing a chroot in Perl

William McKee william at knowmad.com
Mon Aug 28 13:19:23 PDT 2006


On Mon, Aug 28, 2006 at 03:39:47PM -0400, Christopher Fowler wrote:
> This is part of my script execution that I asked about a week or so ago.

I'm not sure I saw that hit the list. Are you sure you sent it?


> I am now going to extract the script from the database and place it in a
> chroot environment.  I will then execute it from there.  I'm using this
> test program before I integrate it into the main code.

I had to make a few tweaks to get that script to work (e.g., change
$root and the getpwnam argument). Even after doing so, I didn't have
much luck getting a chroot environment. The chroot function says that it
is restricted to the superuser which may be why I'm not seeing much
change as I'm running it under my login. If I use sudo to run it, the
script dies at line 28 (getpwnam).


> $ ps > /

What does that command do in Busybox? In bash, it generates an error
message.


> $ ls -l /out
> -rw-r--r--    1 500      500          6998 Aug 26 23:42 /out

Who is user 500? tomcat?


> As you can see /out is owned by tomcat.tomcat but why was he able to
> place anything in /out?  Probably something simple I'm not seeing or
> forgot to do.

I must not be following you where. You've created a chroot environment
that contains an /out directory owned by tomcat. This user has the
permissions to write to the /out directory. Are you asking why the user
was able to create the directory in the first place?


William

-- 
Knowmad Technologies
http://www.knowmad.com


More information about the charlotte mailing list