aboutsummaryrefslogtreecommitdiff
path: root/nscd/selinux.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-03-26 20:41:09 +0000
committerUlrich Drepper <drepper@redhat.com>2007-03-26 20:41:09 +0000
commite1f0c5bc78cf7d893682edf27215ecc0030fcaed (patch)
tree51936e65f6863bb865ce4bc7303da36d7d8b6b76 /nscd/selinux.c
parent4e87573fe224a5d187f463a6e051f5781e38fd97 (diff)
downloadglibc-e1f0c5bc78cf7d893682edf27215ecc0030fcaed.zip
glibc-e1f0c5bc78cf7d893682edf27215ecc0030fcaed.tar.gz
glibc-e1f0c5bc78cf7d893682edf27215ecc0030fcaed.tar.bz2
* scripts/check-local-headers.sh: Filter out sys/capability.h.cvs/fedora-glibc-20070331T1609
2007-03-22 Jakub Jelinek <jakub@redhat.com> * config.h.in (HAVE_LIBCAP): Add. * nscd/selinux.h: Include sys/capability.h rather than non-existent sys/capabilities.h. * nscd/selinux.c (preserve_capabilities): Use cap_free instead of free_caps. Cast away const from 4th cap_set_flag argument.
Diffstat (limited to 'nscd/selinux.c')
-rw-r--r--nscd/selinux.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/nscd/selinux.c b/nscd/selinux.c
index 4a46222..f2dbcee 100644
--- a/nscd/selinux.c
+++ b/nscd/selinux.c
@@ -187,18 +187,22 @@ preserve_capabilities (void)
if (tmp_caps == NULL || new_caps == NULL)
{
if (tmp_caps != NULL)
- free_caps (tmp_caps);
+ cap_free (tmp_caps);
dbg_log (_("Failed to initialize drop of capabilities"));
error (EXIT_FAILURE, 0, _("cap_init failed"));
}
/* There is no reason why these should not work. */
- cap_set_flag (new_caps, CAP_PERMITTED, nnew_cap_list, new_cap_list, CAP_SET);
- cap_set_flag (new_caps, CAP_EFFECTIVE, nnew_cap_list, new_cap_list, CAP_SET);
-
- cap_set_flag (tmp_caps, CAP_PERMITTED, ntmp_cap_list, tmp_cap_list, CAP_SET);
- cap_set_flag (tmp_caps, CAP_EFFECTIVE, ntmp_cap_list, tmp_cap_list, CAP_SET);
+ cap_set_flag (new_caps, CAP_PERMITTED, nnew_cap_list,
+ (cap_value_t *) new_cap_list, CAP_SET);
+ cap_set_flag (new_caps, CAP_EFFECTIVE, nnew_cap_list,
+ (cap_value_t *) new_cap_list, CAP_SET);
+
+ cap_set_flag (tmp_caps, CAP_PERMITTED, ntmp_cap_list,
+ (cap_value_t *) tmp_cap_list, CAP_SET);
+ cap_set_flag (tmp_caps, CAP_EFFECTIVE, ntmp_cap_list,
+ (cap_value_t *) tmp_cap_list, CAP_SET);
int res = cap_set_proc (tmp_caps);