1 /* Test error checking for group entries.
2 Copyright (C) 2021-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
26 #include <support/support.h>
27 #include <support/check.h>
31 static struct passwd pwd_table
[] = {
37 static struct spwd spwd_table
[] = {
44 _nss_test1_init_hook(test_tables
*t
)
46 t
->pwd_table
= pwd_table
;
47 t
->spwd_table
= spwd_table
;
53 struct passwd
*p
= NULL
;
54 struct spwd
*s
= NULL
;
55 struct group
*g
= NULL
;
57 /* Test that compat-to-test works. */
60 FAIL_EXIT1("getpwuid-compat-test1 p");
61 else if (strcmp (p
->pw_name
, "name100") != 0)
62 FAIL_EXIT1("getpwuid-compat-test1 name100");
64 /* Shadow compat should use passwd via the alternate name. */
65 s
= getspnam ("name30");
67 FAIL_EXIT1("getspnam-compat-test1 s");
68 else if (strcmp (s
->sp_namp
, "name30") != 0)
69 FAIL_EXIT1("getpwuid-compat-test1 name30");
71 /* Test that internal defconfig works. */
74 FAIL_EXIT1("getgrgid-compat-null");
75 if (strcmp (g
->gr_name
, "wilma") != 0)
76 FAIL_EXIT1("getgrgid-compat-name");
81 #include <support/test-driver.c>