summaryrefslogtreecommitdiff
path: root/source4/torture/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-09-11 16:45:34 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:18:23 -0500
commitfc84f0d3ca1eadd6300bbab9405ca644167a4e03 (patch)
tree8fefc3c29a07e126009181c14ed0bbcbaf32c5a7 /source4/torture/rpc
parente6e21ed3ad96735a221b453ab3031548cd793e18 (diff)
downloadsamba-fc84f0d3ca1eadd6300bbab9405ca644167a4e03.tar.gz
samba-fc84f0d3ca1eadd6300bbab9405ca644167a4e03.tar.bz2
samba-fc84f0d3ca1eadd6300bbab9405ca644167a4e03.zip
r18391: - match the samba3 protocol for UNIXINFO
- add a test for GidToSid metze (This used to be commit fb92643a8b64428e8259bc21fe04f876b24bfd84)
Diffstat (limited to 'source4/torture/rpc')
-rw-r--r--source4/torture/rpc/unixinfo.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/source4/torture/rpc/unixinfo.c b/source4/torture/rpc/unixinfo.c
index 070a7952f6..ea34c55ada 100644
--- a/source4/torture/rpc/unixinfo.c
+++ b/source4/torture/rpc/unixinfo.c
@@ -32,13 +32,12 @@ static BOOL test_uidtosid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
{
NTSTATUS status;
struct unixinfo_UidToSid r;
- struct dom_sid sid;
r.in.uid = 1000;
- r.out.sid = &sid;
status = dcerpc_unixinfo_UidToSid(p, mem_ctx, &r);
- if (!NT_STATUS_IS_OK(status)) {
+ if (NT_STATUS_EQUAL(NT_STATUS_NO_SUCH_USER, status)) {
+ } else if (!NT_STATUS_IS_OK(status)) {
printf("UidToSid failed == %s\n", nt_errstr(status));
return False;
}
@@ -68,6 +67,26 @@ static BOOL test_getpwuid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
return NT_STATUS_IS_OK(result);
}
+/*
+ test the GidToSid interface
+*/
+static BOOL test_gidtosid(struct dcerpc_pipe *p, TALLOC_CTX *mem_ctx)
+{
+ NTSTATUS status;
+ struct unixinfo_GidToSid r;
+
+ r.in.gid = 1000;
+
+ status = dcerpc_unixinfo_GidToSid(p, mem_ctx, &r);
+ if (NT_STATUS_EQUAL(NT_STATUS_NO_SUCH_GROUP, status)) {
+ } else if (!NT_STATUS_IS_OK(status)) {
+ printf("GidToSid failed == %s\n", nt_errstr(status));
+ return False;
+ }
+
+ return True;
+}
+
BOOL torture_rpc_unixinfo(struct torture_context *torture)
{
NTSTATUS status;
@@ -84,6 +103,7 @@ BOOL torture_rpc_unixinfo(struct torture_context *torture)
ret &= test_uidtosid(p, mem_ctx);
ret &= test_getpwuid(p, mem_ctx);
+ ret &= test_gidtosid(p, mem_ctx);
printf("\n");