> 
> I am having a problem using the RootDirectory chroot
> with mathopd.
> 
> When I try to run mathopd with this option set I get:
> mathopd: Invalid user name.
> 

It goes like this:
first mathopd chroot()s to a given RootDirectory,
(then binds to port 80, and so on -- but let's leave this part alone),
and then sheds root privileges.
As it happens inside chroot, there has to be some information about users.

You're writing about OpenBSD, so I assume that's the system you're
setting mathopd on:
inside RootDirectory you need ''etc'' subdirectory, with at least pwd.db
and group files. Simply copy your original /etc/master.passwd and /etc/group
there, and do:  (recalling from memory, so the following may be a bit wrong):
# pwd_mkdb -p -d RootDirectory/etc RootDirectory/etc/master.passwd

Actually, you need only user nobody (or whichever you're planning
mathopd to run as) inside chroot, so you may safely throw away all other
entries from that files.

Remember about RootDirectory/dev/null, RootDirectory/usr/lib/libc...,
RootDirectory/usr/libexec/ld.so and so on.

And since you're using chroot, all paths in your config file now point
to these inside RootDirectory. Please remember about this.

Good luck!

Janusz

Reply via email to