diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-09-11 16:54:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:23 -0500 |
commit | fcc7bdf874b82d20d81aa00ede870f53c7910b18 (patch) | |
tree | e264fe75ff2334112fe03db87375153b48cf1bb2 /source4/torture | |
parent | fc84f0d3ca1eadd6300bbab9405ca644167a4e03 (diff) | |
download | samba-fcc7bdf874b82d20d81aa00ede870f53c7910b18.tar.gz samba-fcc7bdf874b82d20d81aa00ede870f53c7910b18.tar.bz2 samba-fcc7bdf874b82d20d81aa00ede870f53c7910b18.zip |
r18392: add sidtouid and sidtogid tests to RPC-UNIXINFO
metze
(This used to be commit f1708fd9434ee2a9ae25e9d912f0c350d8e1a256)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/rpc/unixinfo.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/source4/torture/rpc/unixinfo.c b/source4/torture/rpc/unixinfo.c index ea34c55ada..4bf27b916b 100644 --- a/source4/torture/rpc/unixinfo.c +++ b/source4/torture/rpc/unixinfo.c @@ -23,9 +23,32 @@ #include "torture/torture.h" #include "torture/rpc/rpc.h" #include "librpc/gen_ndr/ndr_unixinfo_c.h" +#include "libcli/security/security.h" /* + test the SidToUid interface +*/ +static BOOL test_sidtouid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct unixinfo_SidToUid r; + struct dom_sid *sid; + + sid = dom_sid_parse_talloc(mem_ctx, "S-1-5-32-1234-5432"); + r.in.sid = *sid; + + status = dcerpc_unixinfo_SidToUid(p, mem_ctx, &r); + if (NT_STATUS_EQUAL(NT_STATUS_NONE_MAPPED, status)) { + } else if (!NT_STATUS_IS_OK(status)) { + printf("UidToSid failed == %s\n", nt_errstr(status)); + return False; + } + + return True; +} + +/* test the UidToSid interface */ static BOOL test_uidtosid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) @@ -68,6 +91,28 @@ static BOOL test_getpwuid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) } /* + test the SidToGid interface +*/ +static BOOL test_sidtogid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) +{ + NTSTATUS status; + struct unixinfo_SidToGid r; + struct dom_sid *sid; + + sid = dom_sid_parse_talloc(mem_ctx, "S-1-5-32-1234-5432"); + r.in.sid = *sid; + + status = dcerpc_unixinfo_SidToGid(p, mem_ctx, &r); + if (NT_STATUS_EQUAL(NT_STATUS_NONE_MAPPED, status)) { + } else if (!NT_STATUS_IS_OK(status)) { + printf("SidToGid failed == %s\n", nt_errstr(status)); + return False; + } + + return True; +} + +/* test the GidToSid interface */ static BOOL test_gidtosid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx) |