Message ID | 20200721202118.300350-1-aurelien@aurel32.net |
---|---|
State | New |
Headers | show |
Series | Workaround deprecation warnings introduced in libselinux >= 3.1 | expand |
On Tue, 21 Jul 2020, Aurelien Jarno wrote: > /* Initialize the user space access vector cache (AVC) for NSCD along with > log/thread/lock callbacks. */ > +#pragma GCC diagnostic push > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" Rather than using the pragmas directly, we use the DIAG_*_NEEDS_COMMENT macros from libc-diag.h - with a comment explaining exactly why the disgnostics are being ignored.
On Tue, Jul 21, 2020 at 08:27:19PM +0000, Joseph Myers wrote: > On Tue, 21 Jul 2020, Aurelien Jarno wrote: > > > /* Initialize the user space access vector cache (AVC) for NSCD along with > > log/thread/lock callbacks. */ > > +#pragma GCC diagnostic push > > +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" > > Rather than using the pragmas directly, we use the DIAG_*_NEEDS_COMMENT > macros from libc-diag.h - with a comment explaining exactly why the > disgnostics are being ignored. Florian wrote a patch using those that we applied to Fedora rawhide last night. It was at the file level, though. I'll post something in a bit.
diff --git a/nscd/selinux.c b/nscd/selinux.c index a4ea8008e20..0411e0f7fdf 100644 --- a/nscd/selinux.c +++ b/nscd/selinux.c @@ -322,6 +322,8 @@ avc_free_lock (void *lock) /* Initialize the user space access vector cache (AVC) for NSCD along with log/thread/lock callbacks. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" void nscd_avc_init (void) { @@ -335,6 +337,7 @@ nscd_avc_init (void) audit_init (); #endif } +#pragma GCC diagnostic pop /* Check the permission from the caller (via getpeercon) to nscd. @@ -348,6 +351,8 @@ nscd_avc_init (void) use security_deny_unknown to determine what to do if selinux-policy* doesn't have a definition for the the permission or object class we are looking up. */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" int nscd_request_avc_has_perm (int fd, request_type req) { @@ -422,6 +427,7 @@ out: return rc; } +#pragma GCC diagnostic pop /* Wrapper to get AVC statistics. */ diff --git a/nss/makedb.c b/nss/makedb.c index 8e389a16837..7a365894cec 100644 --- a/nss/makedb.c +++ b/nss/makedb.c @@ -841,6 +841,8 @@ print_database (int fd) #ifdef HAVE_SELINUX +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" static void set_file_creation_context (const char *outname, mode_t mode) { @@ -870,6 +872,7 @@ set_file_creation_context (const char *outname, mode_t mode) freecon (ctx); } } +#pragma GCC diagnostic pop static void reset_file_creation_context (void)