Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#101524 - 26/06/2002 15:09 Hijack chroot for http?
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
Just cursious, is there a chroot option for the webserver in Hijack?
I serached the boards and the faq, didn't see anything. Personally, having all the image and file directories in root are messy (I'm a clean kinda guy), and would like to put them in, say, /usr/html or something..
I COULD: 1. Live with it. 2. Change all the links in that cool-arse XML package, 3. Edit the kernel and check/make it for myself. However, 1: I will live with it, if there's no chroot option, 2. Too much trouble, too many links. 3. Wouldn't touch it. I know basic C, and would probalby be just lucky to make it work, but then blow up something. Literally.

Thanks!
Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#101525 - 26/06/2002 17:22 Re: Hijack chroot for http? [Re: foxtrot_xray]
pgrzelak
carpal tunnel

Registered: 15/08/2000
Posts: 4859
Loc: New Jersey, USA
Greetings!

You could symlink an index.html to your chroot directory, and turn off the ability to go up the directory structure (I think that is a hijack option).
_________________________
Paul Grzelak
200GB with 48MB RAM, Illuminated Buttons and Digital Outputs

Top
#101526 - 27/06/2002 15:38 Re: Hijack chroot for http? [Re: pgrzelak]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
Tried - (well, with the symlink..) Since all the links in the HTML/XML are relative, it still lookf for the images in /image, etc..
Unless, of course, I'm getting my link types confused..

Me.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#101527 - 28/06/2002 06:22 Re: Hijack chroot for http? [Re: foxtrot_xray]
Aragon
member

Registered: 17/05/2002
Posts: 148
Loc: Cape Town, South Africa
Hi,

I made some changes to CharcoalGray99 a while ago. Please see this thread for more info.


Regards,
Aragon

Top
#101528 - 28/06/2002 10:26 Re: Hijack chroot for http? [Re: foxtrot_xray]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
There is ONE reason why Hijack httpd does NOT do a chroot: It would lose access to half of the music directories on a two-drive empeg.

Solve that, and I'll give you your chroot.

Cheers

Top
#101529 - 30/06/2002 03:40 Re: Hijack chroot for http? [Re: mlord]
jane
enthusiast

Registered: 10/10/2000
Posts: 350
Loc: Copenhagen SW, Denmark
Since the music partitions are mounted read-only, is there any particular reason why they can't be mounted twice in two different locations?
For instance create a /httpd/ and then mount drive0 and drive1 under that dir and chroot to it?

What happens if these /httpd/driveX in stead of being mounts of the drive partitions are hard-links to the directiories where the drives are originally mounted?

Marius (Escort Cab + Mark II)

Top
#101530 - 01/07/2002 00:35 Re: Hijack chroot for http? [Re: jane]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
You can't hard link directories and a symlink won't work.

The only way I know to make it work is to open the files and directories you'd need before the chroot(). It might be enough to just have the directory open, as dirent structs actually contain inode information, which ought to be directly accessible somehow. I just don't know how.

Of course, that assumes that readdir() works in more-or-less the same way in kernelspace.
_________________________
Bitt Faulk

Top
#101531 - 01/07/2002 02:03 Re: Hijack chroot for http? [Re: jane]
anti
member

Registered: 10/07/2000
Posts: 117
Loc: BaWue, Germany, Europe
A hardlink won't work,

but a mount --bind /drive0 /httpd/drive0 could do the trick.

(Sorry, no empeg at hand to test it.)
_________________________
-------------------- MKII 08000073 40GB BLUE

Top
#101532 - 01/07/2002 07:03 Re: Hijack chroot for http? [Re: jane]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14496
Loc: Canada
Linux does not permit multiple links ("hard links") to directories, so that idea just plain won't work.

Multiple mount points could work, but it would likely lead to all kinds of confusion when uploading new files/music, since each mount would be maintaining its own individual in-memory directory tree information.. And all of this would consume more memory, leaving less for the player software.

Cheers

Top
#101533 - 01/07/2002 07:17 Re: Hijack chroot for http? [Re: mlord]
jane
enthusiast

Registered: 10/10/2000
Posts: 350
Loc: Copenhagen SW, Denmark
Well, *surely*, the problem with several different memory copies of the directories can be solved by "somebody" ;-)

Marius (Escort Cab + Mark II)

Top