summaryrefslogtreecommitdiff
path: root/source4/torture/winbind
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2010-01-13 16:46:17 +0100
committerKai Blin <kai@samba.org>2010-01-14 15:18:35 +0100
commit89e6eac290da6457b1d2259c32759d2b8a2b481b (patch)
tree4c3f8fccf22a65618368977e7375e6dadf19e303 /source4/torture/winbind
parente95c04f0f19a6e00251f9eceb94c519a0f91b308 (diff)
downloadsamba-89e6eac290da6457b1d2259c32759d2b8a2b481b.tar.gz
s3 selftest: Fix LOOKUP_SID test.
WINBINDD_LIST_USERS does not give a domain name if we're a DC and the user is from our domain.
Diffstat (limited to 'source4/torture/winbind')
-rw-r--r--source4/torture/winbind/struct_based.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c
index d15bd6b8070..2f824288395 100644
--- a/source4/torture/winbind/struct_based.c
+++ b/source4/torture/winbind/struct_based.c
@@ -914,6 +914,9 @@ static bool lookup_name_sid_list(struct torture_context *torture, char **list)
struct winbindd_response rep;
char *sid;
char *name;
+ const char *domain_name = torture_setting_string(torture,
+ "winbindd netbios domain",
+ lp_workgroup(torture->lp_ctx));
ZERO_STRUCT(req);
ZERO_STRUCT(rep);
@@ -932,10 +935,15 @@ static bool lookup_name_sid_list(struct torture_context *torture, char **list)
DO_STRUCT_REQ_REP(WINBINDD_LOOKUPSID, &req, &rep);
- name = talloc_asprintf(torture, "%s%c%s",
- rep.data.name.dom_name,
- winbind_separator(torture),
- rep.data.name.name);
+ if (strequal(rep.data.name.dom_name, domain_name)) {
+ name = talloc_asprintf(torture, "%s",
+ rep.data.name.name);
+ } else {
+ name = talloc_asprintf(torture, "%s%c%s",
+ rep.data.name.dom_name,
+ winbind_separator(torture),
+ rep.data.name.name);
+ }
torture_assert_casestr_equal(torture, list[count], name,
"LOOKUP_SID after LOOKUP_NAME != id");