glibc/nss
Aurelien Jarno f278835f59 makedb: fix build with libselinux >= 3.1 (Bug 26233)
glibc doesn't build with libselinux 3.1 that has been released recently
due to new deprecations introduced in that version and the fact that
glibc is built with -Werror by default:

| makedb.c: In function ‘set_file_creation_context’:
| makedb.c:849:3: error: ‘security_context_t’ is deprecated [-Werror=deprecated-declarations]
|   849 |   security_context_t ctx;
|       |   ^~~~~~~~~~~~~~~~~~
| makedb.c:863:3: error: ‘matchpathcon’ is deprecated: Use selabel_lookup instead [-Werror=deprecated-declarations]
|   863 |   if (matchpathcon (outname, S_IFREG | mode, &ctx) == 0 && ctx != NULL)
|       |   ^~
| In file included from makedb.c:50:
| /usr/include/selinux/selinux.h:500:12: note: declared here
|   500 | extern int matchpathcon(const char *path,
|       |            ^~~~~~~~~~~~
| cc1: all warnings being treated as errors

This patch fixes the makedb half of bug 26233 by moving to the new
SELinux APIs and removes the existing compiler pragmas as no longer
required. Upstream API usage feedback gathered by Arjun is integrated
into this version of the fix.

The built makedb was tested and operates as expected on x86_64 with
SELinu in enforcing mode.

No regressions on x86_64 with libselinux 3.3.

Co-authored-by: Arjun Shankar <arjun@redhat.com>
Co-authored-by: Carlos O'Donell <carlos@redhat.com>
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-09-12 18:26:49 -04:00
..
nss_compat Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_db Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_files Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-compat1.root nss: fix nss_database_lookup2's alternate handling [BZ #27416] 2021-03-09 14:34:50 -05:00
tst-nss-db-endgrent.root/etc nss_db: fix endent wrt NULL mappings [BZ #24695] [BZ #24696] 2019-07-10 14:51:18 -04:00
tst-nss-db-endpwent.root nss_db: fix endent wrt NULL mappings [BZ #24695] [BZ #24696] 2019-07-10 14:51:18 -04:00
tst-nss-files-hosts-long.root/etc Fix failing nss/tst-nss-files-hosts-long with local resolver 2021-09-07 21:41:38 +02:00
tst-nss-gai-actions.root/etc Simplify allocations and fix merge and continue actions [BZ #28931] 2022-03-22 19:38:36 +05:30
tst-nss-test3.root Add test-in-container infrastructure. 2018-08-22 21:20:37 -04:00
tst-reload1.root Fix failing nss/tst-nss-files-hosts-long. 2021-07-12 11:59:04 +02:00
tst-reload2.root nss: Re-enable NSS module loading after chroot [BZ #27389] 2021-03-02 16:14:18 -05:00
alias-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
bug17079.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
bug-erange.c Update. 2002-09-29 18:25:48 +00:00
compat-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
databases.def Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
db-Makefile Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Depend Update. 2000-01-02 04:20:21 +00:00
digits_dots.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ethers-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
function.def Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getent.c Update copyright dates not handled by scripts/update-copyrights. 2022-01-01 11:42:26 -08:00
getnssent_r.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getnssent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getXXbyYY_r.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getXXbyYY.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getXXent_r.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getXXent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
grp-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hosts-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
key-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
makedb.c makedb: fix build with libselinux >= 3.1 (Bug 26233) 2022-09-12 18:26:49 -04:00
Makefile nss: Add tests for the nss_hash in nss_hash.h 2022-05-23 10:38:40 -05:00
netgrp-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
network-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_action_parse.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_action.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_action.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_database.c nss: handle stat failure in check_reload_and_get (BZ #28752) 2022-06-08 21:29:39 -04:00
nss_database.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_fgetent_r.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_files_data.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_files_fopen.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_files_functions.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_hash.c nss: Optimize nss_hash in nss_hash.c 2022-05-23 10:38:40 -05:00
nss_module.c nss: Protect against errno changes in function lookup (bug 28953) 2022-03-11 08:24:19 +01:00
nss_module.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_parse_line_result.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_readline.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_test1.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_test2.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_test_errno.c hurd: Fix arbitrary error code 2022-04-12 22:15:48 +02:00
nss_test.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nss_test.ver Extend NSS test suite 2017-07-17 15:52:44 -04:00
nss.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nsswitch.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
nsswitch.conf Remove --enable-obsolete-nsl configure flag 2020-07-08 17:25:57 +02:00
nsswitch.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
proto-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
pwd-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
rewrite_field.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
rpc-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
service-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sgrp-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
simple-nss-hash.h nss: Add tests for the nss_hash in nss_hash.h 2022-05-23 10:38:40 -05:00
spwd-lookup.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
test-digits-dots.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
test-netdb.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-cancel-getpwuid_r.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-field.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-compat1.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-db-endgrent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-db-endpwent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-alias-leak.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-alias-truncated.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-hosts-erange.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-hosts-getent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-hosts-long.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-files-hosts-multi.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-gai-actions.c Simplify allocations and fix merge and continue actions [BZ #28931] 2022-03-22 19:38:36 +05:30
tst-nss-getpwent.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-hash.c nss: Add tests for the nss_hash in nss_hash.h 2022-05-23 10:38:40 -05:00
tst-nss-static.c Update nss tests to new skeleton 2017-08-17 18:00:51 -04:00
tst-nss-test1.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-test2.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-test3.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-test4.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-test5.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-nss-test_errno.c nss: Protect against errno changes in function lookup (bug 28953) 2022-03-11 08:24:19 +01:00
tst-reload1.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
tst-reload2.c Allow for unpriviledged nested containers 2022-04-04 14:17:08 -04:00
valid_field.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
valid_list_field.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Versions nss_files: Move into libc 2021-07-07 18:33:52 +02:00
XXX-lookup.c nss: add assert to DB_LOOKUP_FCT (BZ #28752) 2022-06-08 21:29:39 -04:00