]> git.decadent.org.uk Git - nfs-utils.git/commit
nfsdcld: add support for dropping capabilities
authorJeff Layton <jlayton@redhat.com>
Wed, 9 May 2012 17:25:34 +0000 (13:25 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 9 May 2012 17:25:34 +0000 (13:25 -0400)
commit623a550b16835685ddca3736a9a00218bd582a2f
tree0ec5faf304e3f4d55f8ad05794fbd615062380d3
parentb6a0ab1dfe85b84ab30a1b656a6bc88b9e025434
nfsdcld: add support for dropping capabilities

As a long running daemon, we need to be security-conscious with nfsdcld,
so let's prune what it can do down to nearly nothing.

We want the daemon to run as root so that it has access to open and
reopen the rpc_pipefs pipe, but we don't actually need any of the
superuser caps that come with it. Have it drop all capabilities early
on. We don't need any of them as long as the fsuid continues to be 0.

Once we do that though, check to ensure that the db dir is actually
usable by root w/o CAP_DAC_OVERRIDE. Do an access() check on it and
throw a warning if it's not. Hopefully that will assist users in
debugging if they get the ownership of the DB dir wrong.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/nfsdcld/Makefile.am
utils/nfsdcld/nfsdcld.c
utils/nfsdcld/nfsdcld.man
utils/nfsdcld/sqlite.c