]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
2007-03-23 Jakub Jelinek <jakub@redhat.com>
authorJakub Jelinek <jakub@redhat.com>
Thu, 12 Jul 2007 15:07:13 +0000 (15:07 +0000)
committerJakub Jelinek <jakub@redhat.com>
Thu, 12 Jul 2007 15:07:13 +0000 (15:07 +0000)
* scripts/check-local-headers.sh: Filter out sys/capability.h.

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.

ChangeLog
config.h.in
nscd/selinux.c
nscd/selinux.h
scripts/check-local-headers.sh

index 76dfe796678871f67f0887f87ed19cc30249aa1b..226e03b0486f54d39511fefd57a06837ec9a22dc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2007-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       * scripts/check-local-headers.sh: Filter out sys/capability.h.
+
+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.
+
 2007-03-16  Jakub Jelinek  <jakub@redhat.com>
 
        * elf/dl-open.c (dl_open_worker): Declare l in 2 different
index da973f6a5d897fd7ee4814cee0493e8a213979ae..ba4dec8affc104097a29436a36aac0bc10b63a10 100644 (file)
@@ -19,6 +19,9 @@
 /* Defined if building with SELinux support & audit libs are detected. */
 #undef HAVE_LIBAUDIT
 
+/* Defined if building with SELinux support & libcap libs are detected.  */
+#undef  HAVE_LIBCAP
+
 /* Define if using XCOFF. Set by --with-xcoff.  */
 #undef HAVE_XCOFF
 
index f123d68b933b9c8e65aefd37b73775f2ba0a76f5..483c8e29b6d5bb725240683dd298e9fa4f027a73 100644 (file)
@@ -182,18 +182,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);
 
index 9ce0628486d269c88dd12beb31c72711241dd2e3..1d940c35bc81680fdfed2d9497ee1b3c7fbf0a3d 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "nscd.h"
 #ifdef HAVE_LIBCAP
-# include <sys/capabilities.h>
+# include <sys/capability.h>
 #endif
 
 #ifdef HAVE_SELINUX
index 88c85f7106993b973aa9b86ee7c15578c870a5f4..bf04febaf2a1ca903c469a916a7af47c5a624c3d 100755 (executable)
@@ -30,6 +30,7 @@ if fgrep "$includedir" */*.d |
 fgrep -v "$includedir/asm" |
 fgrep -v "$includedir/linux" |
 fgrep -v "$includedir/selinux" |
+fgrep -v "$includedir/sys/capability.h" |
 fgrep -v "$includedir/gd"; then
   # If we found a match something is wrong.
   exit 1