summaryrefslogtreecommitdiff
path: root/mount.cifs.c
diff options
context:
space:
mode:
Diffstat (limited to 'mount.cifs.c')
-rw-r--r--mount.cifs.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mount.cifs.c b/mount.cifs.c
index 1f08230..eb72c46 100644
--- a/mount.cifs.c
+++ b/mount.cifs.c
@@ -395,13 +395,6 @@ toggle_cap_dac_override(int enable)
return EX_SYSERR;
}
- if (cap_clear(caps) == -1) {
- fprintf(stderr, "Unable to clear capability set: %s\n",
- strerror(errno));
- rc = EX_SYSERR;
- goto free_caps;
- }
-
cap_list = CAP_DAC_OVERRIDE;
if (cap_set_flag(caps, CAP_EFFECTIVE, 1, &cap_list,
enable ? CAP_SET : CAP_CLEAR) == -1) {
@@ -410,6 +403,12 @@ toggle_cap_dac_override(int enable)
rc = EX_SYSERR;
goto free_caps;
}
+
+ if (cap_set_proc(caps) != 0) {
+ fprintf(stderr, "Unable to set current process capabilities: %s\n",
+ strerror(errno));
+ rc = EX_SYSERR;
+ }
free_caps:
cap_free(caps);
return 0;