about summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorArjun Shankar <arjun@redhat.com>2020-07-23 12:20:38 +0200
committerArjun Shankar <arjun@redhat.com>2020-07-23 12:20:38 +0200
commit04726be814c6fd6d9cf974e15d684dd3ac1a180e (patch)
tree6694b8a2f69f5afbe76f15302f3bc984120de281 /nss
parentba0ec34c62a3a108f2db5575a92ace9bd3ac8a8f (diff)
downloadglibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.tar.gz
glibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.tar.xz
glibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.zip
Disable warnings due to deprecated libselinux symbols used by nss and nscd
The SELinux API deprecated several symbols in its 3.1 release, including
security_context_t, matchpathcon, avc_init, and sidput, which are used in
makedb and nscd.  While the usage of these should eventually be replaced by
newer interfaces, this commit disables GCC warnings due to the use of the
above symbols.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'nss')
-rw-r--r--nss/makedb.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/nss/makedb.c b/nss/makedb.c
index 8e389a1683..8e1e8ec9ad 100644
--- a/nss/makedb.c
+++ b/nss/makedb.c
@@ -38,6 +38,7 @@
 #include <sys/stat.h>
 #include <sys/uio.h>
 #include "nss_db/nss_db.h"
+#include <libc-diag.h>
 
 /* Get libc version number.  */
 #include "../version.h"
@@ -841,6 +842,13 @@ print_database (int fd)
 
 
 #ifdef HAVE_SELINUX
+
+/* security_context_t and matchpathcon (along with several other symbols) were
+   marked as deprecated by the SELinux API starting from version 3.1.  We use
+   them here, but should eventually switch to the newer API.  */
+DIAG_PUSH_NEEDS_COMMENT
+DIAG_IGNORE_NEEDS_COMMENT (10, "-Wdeprecated-declarations");
+
 static void
 set_file_creation_context (const char *outname, mode_t mode)
 {
@@ -870,6 +878,7 @@ set_file_creation_context (const char *outname, mode_t mode)
       freecon (ctx);
     }
 }
+DIAG_POP_NEEDS_COMMENT
 
 static void
 reset_file_creation_context (void)