From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hall.aurel32.net (hall.aurel32.net [IPv6:2001:bc8:30d7:100::1]) by sourceware.org (Postfix) with ESMTPS id C78553860C38 for ; Wed, 29 Jul 2020 18:35:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C78553860C38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=aurel32.net Authentication-Results: sourceware.org; spf=none smtp.mailfrom=aurelien@aurel32.net DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date: Subject:Cc:To:From:Content-Type:From:Reply-To:Subject:Content-ID: Content-Description:In-Reply-To:References:X-Debbugs-Cc; bh=95pgnZHeMA7Strbbq7SQ+hCNOWHhM5w0PDb7iWCdVgk=; b=ChgV8G1nqLyFqt+l8kulZfToDS Ggr7BbZ8uKlaYB6Mfj5oa2UwlQJqAbiC/+5QmLQn0/RSXTz4Qxg/sR1YItTowM2vW0dUCgoGa2zyN H897YIythRknzgd/TDpzY/vvBEnPf+6yilbNug3BnLzd5R/qvPOSkVfb0WSK6fGo9nVR6wr+DOjEe 89a6txi4C9zmiKEwQ5MIgrriup/YnAJdxO6aemHlIIFeFi9JllxVWaskew9aSNMOMVZfSBG8W9io9 26oFeFAjpryI+dLqBCFPbud7x+XYYAwQ/SVR2r1AxSQnoVD3tS/fkPlLsBmMTHtGqKScPhzNsCZW+ WOougdyQ==; Received: from ohm.aurel32.net ([2001:bc8:30d7:111::1000]) by hall.aurel32.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k0qvU-0001OR-BT; Wed, 29 Jul 2020 20:35:40 +0200 Received: from aurel32 by ohm.aurel32.net with local (Exim 4.94) (envelope-from ) id 1k0qvI-0002ti-1m; Wed, 29 Jul 2020 20:35:28 +0200 From: Aurelien Jarno To: libc-stable@sourceware.org Cc: Arjun Shankar , Carlos O'Donell Subject: [2.31 COMMITTED] Disable warnings due to deprecated libselinux symbols used by nss and nscd Date: Wed, 29 Jul 2020 20:34:42 +0200 Message-Id: <20200729183442.11045-1-aurelien@aurel32.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_PASS, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-stable@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-stable mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Jul 2020 18:35:43 -0000 From: Arjun Shankar 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 Tested-by: Carlos O'Donell (cherry picked from commit 04726be814c6fd6d9cf974e15d684dd3ac1a180e) --- nscd/selinux.c | 15 +++++++++++++++ nss/makedb.c | 9 +++++++++ 2 files changed, 24 insertions(+) diff --git a/nscd/selinux.c b/nscd/selinux.c index a4ea8008e20..1ebf924826c 100644 --- a/nscd/selinux.c +++ b/nscd/selinux.c @@ -33,6 +33,7 @@ #ifdef HAVE_LIBAUDIT # include #endif +#include #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. */ diff --git a/nss/makedb.c b/nss/makedb.c index 8e389a16837..8e1e8ec9adc 100644 --- a/nss/makedb.c +++ b/nss/makedb.c @@ -38,6 +38,7 @@ #include #include #include "nss_db/nss_db.h" +#include /* 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) -- 2.27.0