# SUIDDIR Required by the Kernel



## dkovacevic (Feb 22, 2013)

According to http://forums.freebsd.org/showthread.php?t=18312, in order to set a directory so that sub directories / files inherit permissions from the parent directory, the SUID bit must be set.

I followed the examples in the above thread, but I do not get the behavior I expect. Upon further digging, I came across


```
4000    (the setuid bit).  Executable files with this bit set will
                   run with effective uid set to the uid of the file owner.
                   Directories with this bit set will force all files and sub-
                   directories created in them to be owned by the directory
                   owner and not by the uid of the creating process, if the
                   underlying file system supports this feature: see chmod(2)
                   and the suiddir option to mount(8).
```

in chmod(1). I have two questions:

1. Do I need to add option "suiddir" to /etc/fstab in order to get the functionality I want?
2. Is this option a part of the GENERIC kernel? Or do I need to build a custom kernel?

```
# uname -a
FreeBSD gw_files2 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC 2012     [email]root@farrell.cse.buffalo.edu[/email]:/usr/obj/usr/src/sys/GENERIC  amd64
```


----------

