From e7da05b7605b4bf09a641095d1be23001f83a487 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 19 Dec 2001 08:40:50 +0000 Subject: better nsstest error checking (This used to be commit 7348a969bc994e6ef267449aadfdf6321c27baa6) --- source3/torture/nsstest.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source3/torture') diff --git a/source3/torture/nsstest.c b/source3/torture/nsstest.c index a8cdae5e25..f4becf2baf 100644 --- a/source3/torture/nsstest.c +++ b/source3/torture/nsstest.c @@ -319,8 +319,18 @@ static void nss_test_users(void) printf("Testing user %s\n", pwd->pw_name); printf("getpwent: "); print_passwd(pwd); pwd = nss_getpwuid(pwd->pw_uid); + if (!pwd) { + total_errors++; + printf("ERROR: can't getpwuid\n"); + continue; + } printf("getpwuid: "); print_passwd(pwd); pwd = nss_getpwnam(pwd->pw_name); + if (!pwd) { + total_errors++; + printf("ERROR: can't getpwnam\n"); + continue; + } printf("getpwnam: "); print_passwd(pwd); printf("initgroups: "); nss_test_initgroups(pwd->pw_name, pwd->pw_gid); printf("\n"); @@ -338,8 +348,18 @@ static void nss_test_groups(void) printf("Testing group %s\n", grp->gr_name); printf("getgrent: "); print_group(grp); grp = nss_getgrnam(grp->gr_name); + if (!grp) { + total_errors++; + printf("ERROR: can't getgrnam\n"); + continue; + } printf("getgrnam: "); print_group(grp); grp = nss_getgrgid(grp->gr_gid); + if (!grp) { + total_errors++; + printf("ERROR: can't getgrgid\n"); + continue; + } printf("getgrgid: "); print_group(grp); printf("\n"); } -- cgit