svn commit: samba r18392 - in
branches/SAMBA_4_0/source/torture/rpc: .
metze at samba.org
metze at samba.org
Mon Sep 11 16:54:54 GMT 2006
Author: metze
Date: 2006-09-11 16:54:54 +0000 (Mon, 11 Sep 2006)
New Revision: 18392
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18392
Log:
add sidtouid and sidtogid tests to RPC-UNIXINFO
metze
Modified:
branches/SAMBA_4_0/source/torture/rpc/unixinfo.c
Changeset:
Modified: branches/SAMBA_4_0/source/torture/rpc/unixinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/unixinfo.c 2006-09-11 16:45:34 UTC (rev 18391)
+++ branches/SAMBA_4_0/source/torture/rpc/unixinfo.c 2006-09-11 16:54:54 UTC (rev 18392)
@@ -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 @@
}
/*
+ 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)
More information about the samba-cvs
mailing list