On Sun, 29 Nov 2009 11:50:30 +0700
"~Lst" <slack...@gmail.com> wrote:

> On Sun, Nov 29, 2009 at 6:57 AM, Robert <rob...@openbsd.pap.st> wrote:
> >
> > *chuckle*
> >
> > If you were running bgplgsh in a chroot from the cmdline you would
> > have to execute it by invoking /bin/bgplgsh because of the changed
> > root. ;)
> >
> > # man chroot
> > # sudo chroot -u www -g www /var/www /bin/bgplgsh
> >
> > Lots of patience to spare around here, if everyone chims in from
> > time to time.
> >
> 
> o0o...sorry...
> -bash-4.0$ sudo chroot -u www -g www /var/www /usr/bin/bgplgsh
> chroot: /usr/bin/bgplgsh: No such file or directory
> 
> -bash-4.0$ ls -l /usr/bin/bgplgsh
> -r-xr-xr-x  1 root  bin  28052 Jul 10 10:06 /usr/bin/bgplgsh
> 
> Rgds
> --
> ~Lst

Let me requote from your mail i replied to, the part you removed in
your reply:

On Sun, 29 Nov 2009 04:42:34 +0700
"~Lst" <slack...@gmail.com> wrote:

> >> >> Could you tell me how is running bgplgsh under chroot ?    
> >> >    
> 
> I tried running bgplgsh under chroot, still works if its via CLI but
> not via web.
> 
> -bash-4.0# ps -aux | grep chroot
> www       4592  0.0  0.3  1356  2120 ??  Ss    10:36AM    0:01.07
> httpd: parent [chroot /var/www] (httpd)
> 
> -bash-4.0# ls -l /var/www/bin/bgplgsh
> -r-xr-xr-x  1 root  daemon  28052 Nov 29 10:09 /var/www/bin/bgplgsh
> 
> -bash-4.0# /var/www/bin/bgplgsh

You decided to put pgplgsh into /var/www/bin/.
Why do you now try to execute a binary that is somewhere else, where
you didn't copy it?
I wrote the command based on the info you mailed to the list, not on
the basis that bgplgsh in base is under /usr/bin/.

You can only access stuff inside your chroot directory after you have
chroot'ed. That's why ppl asked you to test that to see if you copied
everything that is needed into your chroot-dir.

I guess this is just some missunderstanding about the whole chroot
stuff. Try to have a look again at the manpage for chroot.
You could also search the httpd manpage for chroot and read up on how
that works with the default apache configuration.

- Robert

Reply via email to