]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nsm/file.c
nfsdcld: Before clearing the capability bounding set, check if we have the cap
[nfs-utils.git] / support / nsm / file.c
index 5476446966028528f4d5a0e1a4cf6e1161c335a1..4711c2cd79134f7f1c036c5cda8298aeb53af9a6 100644 (file)
@@ -386,7 +386,7 @@ prune_bounding_set(void)
        }
 
        /* prune the bounding set to nothing */
        }
 
        /* 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 "
                ret = prctl(PR_CAPBSET_DROP, i, 0, 0, 0);
                if (ret) {
                        xlog(L_ERROR, "Unable to prune capability %lu from "