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
commite7da05b7605b4bf09a641095d1be23001f83a487 (patch)
tree347d8515837606fbafd530c51e2f6cce9b84938f
parent279276c9ca0106e4191e170a442b871543c034ac (diff)
downloadsamba-e7da05b7605b4bf09a641095d1be23001f83a487.tar.gz
samba-e7da05b7605b4bf09a641095d1be23001f83a487.tar.bz2
samba-e7da05b7605b4bf09a641095d1be23001f83a487.zip
better nsstest error checking
(This used to be commit 7348a969bc994e6ef267449aadfdf6321c27baa6)
-rw-r--r--source3/torture/nsstest.c20
1 files changed, 20 insertions, 0 deletions
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");
}