summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-12-19 08:40:50 +0000
committerAndrew Tridgell <tridge@samba.org>2001-12-19 08:40:50 +0000
commit7348a969bc994e6ef267449aadfdf6321c27baa6 (patch)
tree58f9cda2bbd0d923cafa474a66f5738e2d89f018
parentc11c27b2812ceb06a52afbb7662f82a8676b1707 (diff)
downloadsamba-7348a969bc994e6ef267449aadfdf6321c27baa6.tar.gz
better nsstest error checking
-rw-r--r--source/torture/nsstest.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/torture/nsstest.c b/source/torture/nsstest.c
index a8cdae5e252..f4becf2baf4 100644
--- a/source/torture/nsstest.c
+++ b/source/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");
}