Author: metze
Date: 2006-09-11 16:45:34 +0000 (Mon, 11 Sep 2006)
New Revision: 18391

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18391

Log:
- match the samba3 protocol for UNIXINFO
- add a test for GidToSid

metze
Modified:
   branches/SAMBA_4_0/source/librpc/idl/unixinfo.idl
   branches/SAMBA_4_0/source/torture/rpc/unixinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/librpc/idl/unixinfo.idl
===================================================================
--- branches/SAMBA_4_0/source/librpc/idl/unixinfo.idl   2006-09-11 16:40:18 UTC 
(rev 18390)
+++ branches/SAMBA_4_0/source/librpc/idl/unixinfo.idl   2006-09-11 16:45:34 UTC 
(rev 18391)
@@ -1,3 +1,4 @@
+#include "idl_types.h"
 /*
   Unixinfo interface definition
 */
@@ -22,7 +23,7 @@
        /* Function: 0x01 */
        NTSTATUS unixinfo_UidToSid (
            [in]        hyper uid,
-           [out,ref]   dom_sid *sid
+           [out,unique]        dom_sid *sid
            );
 
        /******************/
@@ -36,13 +37,13 @@
        /* Function: 0x03 */
        NTSTATUS unixinfo_GidToSid (
            [in]        hyper gid,
-           [out,ref]   dom_sid *sid
+           [out,unique]        dom_sid *sid
            );
 
-    typedef struct {
-       NTSTATUS status;
-        [string,charset(UTF8)] uint8 *homedir;
-               [string,charset(UTF8)] uint8 *shell;
+       typedef struct {
+               NTSTATUS status;
+               utf8string homedir;
+               utf8string shell;
        } unixinfo_GetPWUidInfo;
 
        /******************/

Modified: branches/SAMBA_4_0/source/torture/rpc/unixinfo.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/unixinfo.c    2006-09-11 16:40:18 UTC 
(rev 18390)
+++ branches/SAMBA_4_0/source/torture/rpc/unixinfo.c    2006-09-11 16:45:34 UTC 
(rev 18391)
@@ -32,13 +32,12 @@
 {
        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 @@
        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 @@
 
        ret &= test_uidtosid(p, mem_ctx);
        ret &= test_getpwuid(p, mem_ctx);
+       ret &= test_gidtosid(p, mem_ctx);
 
        printf("\n");
        

Reply via email to