Date: Thu, 4 Jun 2009 16:44:54 +0200 From: Jonathan McKeown <j.mckeown@ru.ac.za> To: freebsd-questions@freebsd.org Subject: Re: SetUID/SetGID Kernel Option Message-ID: <200906041644.54583.j.mckeown@ru.ac.za> In-Reply-To: <200906041423.n54ENTTp019247@dc.cis.okstate.edu> References: <200906041423.n54ENTTp019247@dc.cis.okstate.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Martin On Thursday 04 June 2009 16:23:29 Martin McCormick wrote: > I have been asked to enable the following kernel option: > > SetUID/SetGID - Allow directories to inherit their owner from the > parent directory. > > The generic kernel under FreeBSD6.3 is what we presently use on > the system in question and I see no commented-out option for > compilation. You need to add option SUIDDIR To the kernel config. You can find a sample line in /sys/conf/NOTES > We see in the fstab the following: > > # Device Mountpoint FStype Options Dump Pass# > #Default is for no SUIDDIR. > #/dev/mfid0s1a / ufs rw 1 1 > #Living a bit more dangerously, we turned it back on. > /dev/mfid0s1a / ufs rw,SUIDDIR 1 1 > > This looks like it may address the issue, but a test shows that > it does not appear to happen. Once you've recompiled the kernel you also need to use suiddir in the mount options for any filesystem where you want file ownership to be inherited from the directory. It's described in the kernel notes and in the mount manpage as a dangerous option which opens security holes. I notice that you mention setGID as well, which under sysV-derived systems allows file to inherit group ownership from the directory. If that's what's wanted, you don't need to do anything, as the behaviour that's optional on sysV systems like Linux is the default behaviour on FreeBSD. Jonathan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906041644.54583.j.mckeown>