diff options
author | Jeff Layton <jlayton@samba.org> | 2010-04-03 07:12:06 -0400 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2010-04-03 07:12:06 -0400 |
commit | 16c29a1920e48e7480595edd0ae96094d6e220c8 (patch) | |
tree | 218b1d596f92fd0839689a37d38bbdae4cad91d7 | |
parent | 55c00c67ced28102209e640fd50bcab9d0332a7f (diff) | |
download | cifs-utils-16c29a1920e48e7480595edd0ae96094d6e220c8.tar.gz cifs-utils-16c29a1920e48e7480595edd0ae96094d6e220c8.tar.bz2 cifs-utils-16c29a1920e48e7480595edd0ae96094d6e220c8.zip |
mount.cifs: fix toggle_cap_dac_override
...it clears the capability set completely, which it shouldn't do. It
also doesn't call cap_set_proc to make the new capability set active.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
-rw-r--r-- | mount.cifs.c | 13 |
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; |