summaryrefslogtreecommitdiffstats
path: root/utils/nfsdcld
Commit message (Collapse)AuthorAgeFilesLines
* nfsdcld: Before clearing the capability bounding set, check if we have the capHarald Hoyer2012-06-191-2/+2
| | | | | | | | | | | | | | | | | From: Harald Hoyer <harald@redhat.com> PR_CAPBSET_DROP can return EINVAL, if an older kernel does support some capabilities, which are defined by CAP_LAST_CAP, which results in a failure of the service. For example kernel 3.4 errors on CAP_EPOLLWAKEUP, which was newly introduced in 3.5. So, for future capabilities, we clear until we get an EINVAL for PR_CAPBSET_READ. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add support for dropping capabilitiesJeff Layton2012-05-094-8/+89
| | | | | | | | | | | | | | | | | | 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>
* nfsdcld: demote pipe opening error to D_GENERALJeff Layton2012-05-091-1/+1
| | | | | | | | | | | It's actually expected that this will fail initially when we start the daemon. Until knfsd has been started, the pipe doesn't exist, and we generally want to start nfsdcld before starting knfsd. Avoid the scary error message by demoting this message to D_GENERAL. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: General clean up.Steve Dickson2012-04-261-0/+1
| | | | | | | - Added header clean up some warnings - Updated the .gitignore file. Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add a manpage for nfsdcldJeff Layton2012-04-262-2/+182
| | | | | Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: make it watch for inotify events in the containing directoryJeff Layton2012-04-261-4/+142
| | | | | | | | | | | Before opening the pipe, set an inotify watch on the containing dir and then try to open the pipe. If it succeeds, then set up pipe and inotify events and return success. If it fails with -ENOENT, then just set up the inotify event and return success. If it fails with any other error then return the error and the caller can then abort the program. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add function to remove unreclaimed client recordsJeff Layton2012-04-263-0/+63
| | | | | | | | | | | | This should remove any client record that has a timestamp prior to the given time. Eventually, this call will need to be made cluster aware when this is run in a clustered configuration. For now, this is only suitable for single-host configurations. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add check/update functionalityJeff Layton2012-04-263-0/+109
| | | | | | | | | Add functions to check whether a client is allowed to reclaim, and update its timestamp in the DB if so. If either the query or update fails, then the host is not allowed to reclaim state. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add remove functionalityJeff Layton2012-04-263-0/+71
| | | | | | | Allow the kernel to ask for removal of a client record. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add routines for a sqlite backend databaseJeff Layton2012-04-264-8/+298
| | | | | | | | | | | | | | | | | | | | Rather than roll our own "storage engine", use sqlite instead. It fits the bill nicely as it does: - durable on-disk storage - the ability to constrain record uniqueness - a facility for collating and searching the host records ...it does add a build dependency to nfs-utils, but almost all modern distros provide those packages. The current incarnation of this code dynamically links against a provided sqlite library, but we could also consider including their single-file "amalgamation" to reduce dependencies (though with all the caveats that that entails). Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>
* nfsdcld: add client tracking daemon stubJeff Layton2012-04-262-0/+288
This program opens and "listens" on the new nfsd/cld rpc_pipefs pipe. The code here doesn't actually do anything on stable storage yet. That will be added in a later patch. The patch also adds a autoconf enable switch for the new daemon that defaults to "no", and a test for the upcall description header file. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve Dickson <steved@redhat.com>