From f36dafd852b1ed608e0c988c3c5f8823e909a4d6 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 2 Mar 2010 18:35:01 +0100 Subject: s4-smbtorture: fix WINBIND-STRUCT assumptions about getpwent() for s3. In samba3 it is not an error when no users are returned in getpwent() calls (e.g. on a DC w/o interdomain trusts). Kai, please check. Guenther --- source4/torture/winbind/struct_based.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'source4/torture/winbind/struct_based.c') diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c index 872e17bb0d..5a621bc772 100644 --- a/source4/torture/winbind/struct_based.c +++ b/source4/torture/winbind/struct_based.c @@ -849,12 +849,23 @@ static bool torture_winbind_struct_getpwent(struct torture_context *torture) ZERO_STRUCT(req); ZERO_STRUCT(rep); req.data.num_entries = 1; - DO_STRUCT_REQ_REP(WINBINDD_GETPWENT, &req, &rep); + if (torture_setting_bool(torture, "samba3", false)) { + bool __noop = false; + DO_STRUCT_REQ_REP_EXT(WINBINDD_GETPWENT, &req, &rep, + NSS_STATUS_SUCCESS, false, __noop=true, + NULL); + } else { + DO_STRUCT_REQ_REP(WINBINDD_GETPWENT, &req, &rep); + } pwent = (struct winbindd_pw *)rep.extra_data.data; - torture_assert(torture, (pwent != NULL), "NULL pwent"); - torture_comment(torture, "name: %s, uid: %d, gid: %d, shell: %s\n", - pwent->pw_name, pwent->pw_uid, pwent->pw_gid, - pwent->pw_shell); + if (!torture_setting_bool(torture, "samba3", false)) { + torture_assert(torture, (pwent != NULL), "NULL pwent"); + } + if (pwent) { + torture_comment(torture, "name: %s, uid: %d, gid: %d, shell: %s\n", + pwent->pw_name, pwent->pw_uid, pwent->pw_gid, + pwent->pw_shell); + } return true; } -- cgit