The user space tools are not POSIX compatible. This implementation adds filesystem capabilities to the Linux kernel. It doesn't change how capabilities were used and interpreted in the kernel proper.

With this patch, you will be able to grant selective privileges to executables on a needed basis. This means for some executables, there is no need anymore to run as root or as a suid root binary.

For example, you may drop the SUID bit from ping and grant the CAP_NET_RAW capability:

chmod u-s /bin/ping
chcap cap_net_raw=ep /bin/ping

Another use would be to run system daemons with their own uid:

chcap cap_net_bind_service=ei /usr/sbin/named

This sets the effective and inheritable capabilities of named.

In your startup script:

inhcaps cap_net_bind_service=i bind:bind /usr/sbin/named

This sets the inheritable set to CAP_NET_BIND_SERVICE, which is needed in order to bind to port 53, and runs named as user bind with group bind.

This allows running named with needed restricted privileges, if the parent process (root) owns them already. When started by regular users, named runs without any privileges.

Warning

resize2fs(8) might relocate inodes and thus break fs capabilities. For this to work you must dump the capability db before you resize and restore the db afterwards.

Download

Here are the kernel patches:

NameLast modifiedSizeDescription
[DIR]Parent Directory07-Nov-2002 15:15-
[ ]fscaps-2.6.26-0.19.patch.gz10-Aug-2008 16:095k
[ ]fscaps-2.6.26-0.18.patch.gz08-Aug-2008 22:135k
[ ]fscaps-2.6.25-0.18.patch.gz12-May-2008 22:515k
[ ]fscaps-2.6.23-0.17.patch.gz26-Oct-2007 18:015k
[ ]fscaps-2.6.19-0.16.patch.gz03-Dec-2006 15:555k
[ ]fscaps-2.6.18-0.16.patch.gz22-Sep-2006 14:525k
[ ]fscaps-2.6.15-0.16.patch.gz14-Jan-2006 22:185k
[ ]fscaps-2.6.13-0.16.patch.gz01-Sep-2005 20:415k
[ ]fscaps-2.6.12-0.16.patch.gz01-Sep-2005 20:415k
[ ]fscaps-2.6.9-0.16.patch.gz24-Oct-2004 01:035k
[ ]fscaps-2.6.7-0.16.patch.gz22-Jul-2004 14:495k
[ ]fscaps-2.6.2-0.15.patch.gz07-Feb-2004 19:565k
[ ]fscaps-2.6.0-test6-0.15.patch.gz04-Oct-2003 01:445k
[ ]fscaps-2.6.0-test2-0.15.patch.gz28-Jul-2003 11:535k
[ ]fscaps-2.5.72-0.14.patch.gz25-Jun-2003 01:255k
[ ]fscaps-2.5.60-0.14.patch.gz11-Feb-2003 02:205k
[ ]fscaps-2.5.54-0.14.patch.gz02-Jan-2003 16:435k
[ ]fscaps-2.5.52-0.13.patch.gz16-Dec-2002 17:465k
[ ]fscaps-2.5.51-0.12.patch.gz11-Dec-2002 17:155k
[ ]fscaps-2.5.46-0.12.patch.gz11-Dec-2002 17:465k
[ ]fscaps-2.5.46-0.11.patch.gz07-Nov-2002 14:315k
[ ]fscaps-2.5.46-0.10.patch.gz05-Nov-2002 16:495k
[ ]fscaps-2.5.45-0.9.patch.gz01-Nov-2002 18:585k
[ ]fscaps-2.5.45-0.8.patch.gz31-Oct-2002 14:405k
[ ]fscaps-2.5.45-0.7.patch.gz31-Oct-2002 14:405k
[ ]fscaps-2.5.44-0.7.patch.gz31-Oct-2002 02:185k
[ ]fscaps-2.5.44-0.6.patch.gz30-Oct-2002 16:003k
and the user space tools:
[ ]chcap-0.2.c31-Oct-2002 14:362k
[ ]inhcaps.c30-Oct-2002 14:572k
[ ]lscap.c04-Oct-2003 01:443k
[ ]dumpcaps-pl.txt02-Nov-2002 19:102k

Links and other capability implementations


Olaf Dietsche: webmaster@olafdietsche.de
Last modified: 2011-03-28 16:53:46 CEST