diff options
author | Harald Hoyer <harald@redhat.com> | 2012-06-19 10:53:29 -0400 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2012-06-19 10:53:29 -0400 |
commit | d18b89cd7352783580f3d3dde26f8617e36459b9 (patch) | |
tree | 91d6ba4b0d401cf12ed1ef56ad7b1a088f3346bc /support/nsm/file.c | |
parent | 55b1769e63cdffa07b597fa6132c9902cec25265 (diff) | |
download | nfs-utils-d18b89cd7352783580f3d3dde26f8617e36459b9.tar.gz nfs-utils-d18b89cd7352783580f3d3dde26f8617e36459b9.tar.xz nfs-utils-d18b89cd7352783580f3d3dde26f8617e36459b9.zip |
nfsdcld: Before clearing the capability bounding set, check if we have the cap
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>
Diffstat (limited to 'support/nsm/file.c')
-rw-r--r-- | support/nsm/file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/support/nsm/file.c b/support/nsm/file.c index 5476446..4711c2c 100644 --- a/support/nsm/file.c +++ b/support/nsm/file.c @@ -386,7 +386,7 @@ prune_bounding_set(void) } /* prune the bounding set to nothing */ - for (i = 0; i <= CAP_LAST_CAP; ++i) { + for (i = 0; prctl(PR_CAPBSET_READ, i, 0, 0, 0) >=0 ; ++i) { ret = prctl(PR_CAPBSET_DROP, i, 0, 0, 0); if (ret) { xlog(L_ERROR, "Unable to prune capability %lu from " |