svn commit: samba r23365 - in branches/SAMBA_4_0/source:
rpc_server/samr torture/rpc
abartlet at samba.org
abartlet at samba.org
Wed Jun 6 12:51:46 GMT 2007
Author: abartlet
Date: 2007-06-06 12:51:45 +0000 (Wed, 06 Jun 2007)
New Revision: 23365
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23365
Log:
Try to make Windows Vista join again. On my new test environment, it
wants to check for an existing domain join account, and fails. This
test shows that we need to return NT_STATUS_NONE_MAPPED when nothing
matches. (not yet tested if this helps vista).
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
branches/SAMBA_4_0/source/torture/rpc/samr.c
Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c 2007-06-06 12:44:04 UTC (rev 23364)
+++ branches/SAMBA_4_0/source/rpc_server/samr/dcesrv_samr.c 2007-06-06 12:51:45 UTC (rev 23365)
@@ -1783,7 +1783,7 @@
{
struct dcesrv_handle *h;
struct samr_domain_state *d_state;
- int i;
+ int i, num_mapped;
NTSTATUS status = NT_STATUS_OK;
const char * const attrs[] = { "sAMAccountType", "objectSid", NULL };
int count;
@@ -1807,6 +1807,8 @@
r->out.rids.count = r->in.num_names;
r->out.types.count = r->in.num_names;
+ num_mapped = 0;
+
for (i=0;i<r->in.num_names;i++) {
struct ldb_message **res;
struct dom_sid *sid;
@@ -1844,9 +1846,12 @@
r->out.rids.ids[i] = sid->sub_auths[sid->num_auths-1];
r->out.types.ids[i] = rtype;
+ num_mapped++;
}
-
+ if (num_mapped == 0) {
+ return NT_STATUS_NONE_MAPPED;
+ }
return status;
}
Modified: branches/SAMBA_4_0/source/torture/rpc/samr.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samr.c 2007-06-06 12:44:04 UTC (rev 23364)
+++ branches/SAMBA_4_0/source/torture/rpc/samr.c 2007-06-06 12:51:45 UTC (rev 23365)
@@ -922,17 +922,43 @@
status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
if (!NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) {
printf("LookupNames[2] failed - %s\n", nt_errstr(status));
+ if (NT_STATUS_IS_OK(status)) {
+ return NT_STATUS_UNSUCCESSFUL;
+ }
return status;
}
- init_lsa_String(&sname[1], "xxNONAMExx");
n.in.num_names = 0;
status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
if (!NT_STATUS_IS_OK(status)) {
printf("LookupNames[0] failed - %s\n", nt_errstr(status));
+ return status;
}
- return status;
+ init_lsa_String(&sname[0], "xxNONAMExx");
+ n.in.num_names = 1;
+ status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+ printf("LookupNames[1 bad name] failed - %s\n", nt_errstr(status));
+ if (NT_STATUS_IS_OK(status)) {
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ return status;
+ }
+
+ init_lsa_String(&sname[0], "xxNONAMExx");
+ init_lsa_String(&sname[1], "xxNONAME2xx");
+ n.in.num_names = 2;
+ status = dcerpc_samr_LookupNames(p, mem_ctx, &n);
+ if (!NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+ printf("LookupNames[2 bad names] failed - %s\n", nt_errstr(status));
+ if (NT_STATUS_IS_OK(status)) {
+ return NT_STATUS_UNSUCCESSFUL;
+ }
+ return status;
+ }
+
+ return NT_STATUS_OK;
}
static NTSTATUS test_OpenUser_byname(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx,
More information about the samba-cvs
mailing list