summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-07-05 20:33:17 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:56:51 -0500
commit0fa0eaa3837551bb04fd850d78633cc08a3dbdcc (patch)
tree7baa0a4aa66a567dd5a3e97472969e2229232178 /source4
parent458cadff4f3b8885858bd03dbc9af4dae449f407 (diff)
downloadsamba-0fa0eaa3837551bb04fd850d78633cc08a3dbdcc.tar.gz
samba-0fa0eaa3837551bb04fd850d78633cc08a3dbdcc.tar.bz2
samba-0fa0eaa3837551bb04fd850d78633cc08a3dbdcc.zip
r1342: When fixing _lsa_lookupsids in samba3 I wanted to find out the number of SIDs
w2k3 can handle in a single request. With the samba3 client rpc libs I can do about 21000 SIDs in a single request. test_many_LookupSIDs with 10000 SIDs fails on the subsequent request with a NET_WRITE_FAULT. Maybe the Samba4 DCE people want to take a look at this -- I don't see the problem. Bug fix: SID components should be treated as unsigned when parsing Volker (This used to be commit 8c997a2ad2e89a640f854b556ef76a3d52c15963)
Diffstat (limited to 'source4')
-rw-r--r--source4/libcli/util/dom_sid.c2
-rw-r--r--source4/torture/rpc/lsa.c54
2 files changed, 55 insertions, 1 deletions
diff --git a/source4/libcli/util/dom_sid.c b/source4/libcli/util/dom_sid.c
index 9b8b45e302..0ca4cd731f 100644
--- a/source4/libcli/util/dom_sid.c
+++ b/source4/libcli/util/dom_sid.c
@@ -79,7 +79,7 @@ struct dom_sid *dom_sid_parse_talloc(TALLOC_CTX *mem_ctx, const char *sidstr)
return NULL;
}
sidstr++;
- ret->sub_auths[i] = strtol(sidstr, &p, 10);
+ ret->sub_auths[i] = strtoul(sidstr, &p, 10);
if (p == sidstr) {
return NULL;
}
diff --git a/source4/torture/rpc/lsa.c b/source4/torture/rpc/lsa.c
index e3c603da17..44e1564992 100644
--- a/source4/torture/rpc/lsa.c
+++ b/source4/torture/rpc/lsa.c
@@ -181,6 +181,56 @@ static BOOL test_LookupSids(struct dcerpc_pipe *p,
return True;
}
+static BOOL test_many_LookupSids(struct dcerpc_pipe *p,
+ TALLOC_CTX *mem_ctx,
+ struct policy_handle *handle)
+{
+ struct lsa_LookupSids r;
+ struct lsa_TransNameArray names;
+ uint32_t count;
+ NTSTATUS status;
+ struct lsa_SidArray sids;
+ int i;
+
+ printf("\nTesting LookupSids with lots of SIDs\n");
+
+ names.count = 0;
+ names.names = NULL;
+
+ sids.num_sids = 10000;
+
+ sids.sids = talloc_array_p(mem_ctx, struct lsa_SidPtr, sids.num_sids);
+
+ for (i=0; i<sids.num_sids; i++) {
+ const char *sidstr = "S-1-5-32-545";
+ sids.sids[i].sid = dom_sid_parse_talloc(mem_ctx, sidstr);
+ }
+
+ count = sids.num_sids;
+
+ r.in.handle = handle;
+ r.in.sids = &sids;
+ r.in.names = &names;
+ r.in.level = 1;
+ r.in.count = &names.count;
+ r.out.count = &count;
+ r.out.names = &names;
+
+ status = dcerpc_lsa_LookupSids(p, mem_ctx, &r);
+ if (!NT_STATUS_IS_OK(status) && !NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED)) {
+ printf("LookupSids failed - %s\n", nt_errstr(status));
+ return False;
+ }
+
+ printf("\n");
+
+ if (!test_LookupNames(p, mem_ctx, handle, &names)) {
+ return False;
+ }
+
+ return True;
+}
+
static BOOL test_LookupPrivName(struct dcerpc_pipe *p,
TALLOC_CTX *mem_ctx,
struct policy_handle *handle,
@@ -766,6 +816,10 @@ BOOL torture_rpc_lsa(int dummy)
ret = False;
}
+ if (!test_many_LookupSids(p, mem_ctx, &handle)) {
+ ret = False;
+ }
+
if (!test_CreateAccount(p, mem_ctx, &handle)) {
ret = False;
}