[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chroot and FHS



On Sat, Jan 27, 2001 at 08:38:46PM +0100, Christian Hammers wrote:

> Well here lies the problem. MySQL has a --chroot=DIR option but if started
> this way it still uses the databases in /var/lib/mysql but writes the logfile
> and OUTFILE data to the chroot. It also does not require any additional
> libraries as it seems to be able to continue using the existant file
> descriptiors.
> 
> Would anybody say that in this case I should not rely on mysql´s --chroot but
> instead chroot it myself?
> 
> This would involve more work and as mysql runs under a seperate UID it should
> not be able to harm the system libraries it is linked to.  It would on the
> other hand be a good jail for poeple trying to get information by
> INFILE/OUTFILE tricks and in most cases buffer overflow rootshells (as there
> would be no shells).

Even if it were running as root, I believe shared libraries are typically
loaded as a read-only mmap, so they couldn't be changed anyway.

Perhaps mysql should be modified to use databases in the chroot jail?  Having a
daemon chroot itself after loading is usually much cleaner, as you don't have
to worry about libraries and such.  Also, the config files will often be read
before chroot, so they can continue to live in /etc where they belong.

-- 
 - mdz



Reply to: