aboutsummaryrefslogtreecommitdiff
path: root/nscd/selinux.c
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 /nscd/selinux.c
parentba0ec34c62a3a108f2db5575a92ace9bd3ac8a8f (diff)
downloadglibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.tar
glibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.tar.gz
glibc-04726be814c6fd6d9cf974e15d684dd3ac1a180e.tar.bz2
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 'nscd/selinux.c')
-rw-r--r--nscd/selinux.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/nscd/selinux.c b/nscd/selinux.c
index a4ea8008e2..1ebf924826 100644
--- a/nscd/selinux.c
+++ b/nscd/selinux.c
@@ -33,6 +33,7 @@
#ifdef HAVE_LIBAUDIT
# include <libaudit.h>
#endif
+#include <libc-diag.h>
#include "dbg_log.h"
#include "selinux.h"
@@ -320,6 +321,12 @@ avc_free_lock (void *lock)
}
+/* avc_init (along with several other symbols) was marked as deprecated by the
+ SELinux API starting from version 3.1. We use it here, but should
+ eventually switch to the newer API. */
+DIAG_PUSH_NEEDS_COMMENT
+DIAG_IGNORE_NEEDS_COMMENT (10, "-Wdeprecated-declarations");
+
/* Initialize the user space access vector cache (AVC) for NSCD along with
log/thread/lock callbacks. */
void
@@ -335,7 +342,14 @@ nscd_avc_init (void)
audit_init ();
#endif
}
+DIAG_POP_NEEDS_COMMENT
+
+/* security_context_t and sidput (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");
/* Check the permission from the caller (via getpeercon) to nscd.
Returns 0 if access is allowed, 1 if denied, and -1 on error.
@@ -422,6 +436,7 @@ out:
return rc;
}
+DIAG_POP_NEEDS_COMMENT
/* Wrapper to get AVC statistics. */