From: Khem Raj Date: Thu, 23 Jul 2020 05:42:09 +0000 (-0700) Subject: nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h X-Git-Tag: samba-4.12.10~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5933bfdee2365c6b5745a3aca42a6d7a48eaf96;p=thirdparty%2Fsamba.git nsswitch/nsstest.c: Avoid nss function conflicts with glibc nss.h glibc 2.32 will define these varibles [1] which results in conflicts with these static function names, therefore prefix these function names with samba_ to avoid it [1] https://sourceware.org/git/?p=glibc.git;a=commit;h=499a92df8b9fc64a054cf3b7f728f8967fc1da7d Signed-off-by: Khem Raj Reviewed-by: Volker Lendecke Reviewed-by: Noel Power Autobuild-User(master): Noel Power Autobuild-Date(master): Tue Jul 28 10:52:00 UTC 2020 on sn-devel-184 (cherry picked from commit 6e496aa3635557b59792e469f7c7f8eccd822322) --- diff --git a/nsswitch/nsstest.c b/nsswitch/nsstest.c index e8c4306441d..e2ee9fbf3af 100644 --- a/nsswitch/nsstest.c +++ b/nsswitch/nsstest.c @@ -137,7 +137,7 @@ static struct passwd *nss_getpwuid(uid_t uid) return &pwd; } -static void nss_setpwent(void) +static void samba_nss_setpwent(void) { NSS_STATUS (*_nss_setpwent)(void) = (NSS_STATUS(*)(void))find_fn("setpwent"); @@ -152,7 +152,7 @@ static void nss_setpwent(void) } } -static void nss_endpwent(void) +static void samba_nss_endpwent(void) { NSS_STATUS (*_nss_endpwent)(void) = (NSS_STATUS (*)(void))find_fn("endpwent"); @@ -290,7 +290,7 @@ again: return &grp; } -static void nss_setgrent(void) +static void samba_nss_setgrent(void) { NSS_STATUS (*_nss_setgrent)(void) = (NSS_STATUS (*)(void))find_fn("setgrent"); @@ -305,7 +305,7 @@ static void nss_setgrent(void) } } -static void nss_endgrent(void) +static void samba_nss_endgrent(void) { NSS_STATUS (*_nss_endgrent)(void) = (NSS_STATUS (*)(void))find_fn("endgrent"); @@ -402,7 +402,7 @@ static void nss_test_users(void) { struct passwd *pwd; - nss_setpwent(); + samba_nss_setpwent(); /* loop over all users */ while ((pwd = nss_getpwent())) { printf("Testing user %s\n", pwd->pw_name); @@ -424,14 +424,14 @@ static void nss_test_users(void) printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid); printf("\n"); } - nss_endpwent(); + samba_nss_endpwent(); } static void nss_test_groups(void) { struct group *grp; - nss_setgrent(); + samba_nss_setgrent(); /* loop over all groups */ while ((grp = nss_getgrent())) { printf("Testing group %s\n", grp->gr_name); @@ -452,7 +452,7 @@ static void nss_test_groups(void) printf("getgrgid: "); print_group(grp); printf("\n"); } - nss_endgrent(); + samba_nss_endgrent(); } static void nss_test_errors(void)