svn commit: samba r9757 - in branches/SOC/SAMBA_3_0/source: include libmsrpc

skel at samba.org skel at samba.org
Mon Aug 29 20:51:22 GMT 2005


Author: skel
Date: 2005-08-29 20:51:21 +0000 (Mon, 29 Aug 2005)
New Revision: 9757

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

Log:
cac_SamEnableUser() and cac_SamDisableUser() now use cli_samr_set_userinfo2()


Modified:
   branches/SOC/SAMBA_3_0/source/include/libmsrpc.h
   branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c


Changeset:
Modified: branches/SOC/SAMBA_3_0/source/include/libmsrpc.h
===================================================================
--- branches/SOC/SAMBA_3_0/source/include/libmsrpc.h	2005-08-29 20:18:51 UTC (rev 9756)
+++ branches/SOC/SAMBA_3_0/source/include/libmsrpc.h	2005-08-29 20:51:21 UTC (rev 9757)
@@ -164,14 +164,17 @@
  * @defgroup sam_defs SAM Definitions
  * @{
  */
+
+#define CAC_USER_RID  0x1
+#define CAC_GROUP_RID 0x2
+
 typedef struct _CACLOOKUPRIDSRECORD {
    char *name;
    uint32 rid;
 
    /**If found, this will be one of:
-    * - USER_RID_TYPE
-    * - GROUP_RID_TYPE
-    * (found in include/rpc_misc.h)
+    * - CAC_USER_RID
+    * - CAC_GROUP_RID
     */
    uint32 type;
    
@@ -1668,7 +1671,7 @@
       char *name;
 
       /**See Allowable account control bits in include/smb.h*/
-      uint32 acb;
+      uint32 acb_mask;
    } in;
 
    struct {

Modified: branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c
===================================================================
--- branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c	2005-08-29 20:18:51 UTC (rev 9756)
+++ branches/SOC/SAMBA_3_0/source/libmsrpc/cac_samr.c	2005-08-29 20:51:21 UTC (rev 9757)
@@ -342,7 +342,7 @@
       return CAC_FAILURE;
    }
 
-   if(!op || !op->in.dom_hnd || !op->in.name || op->in.acb == 0 || !mem_ctx) {
+   if(!op || !op->in.dom_hnd || !op->in.name || op->in.acb_mask == 0 || !mem_ctx) {
       hnd->status = NT_STATUS_INVALID_PARAMETER;
       return CAC_FAILURE;
    }
@@ -361,7 +361,7 @@
       return CAC_FAILURE;
    }
 
-   hnd->status = cli_samr_create_dom_user( &(srv->cli), mem_ctx, op->in.dom_hnd, op->in.name, op->in.acb, unknown, user_out, &rid_out);
+   hnd->status = cli_samr_create_dom_user( &(srv->cli), mem_ctx, op->in.dom_hnd, op->in.name, op->in.acb_mask, unknown, user_out, &rid_out);
 
    if(!NT_STATUS_IS_OK(hnd->status))
       return CAC_FAILURE;
@@ -1582,15 +1582,15 @@
    srv->cli.pipe_idx = PI_SAMR;
 
    /*info_level = 21 is the only level that I have found to work reliably. It would be nice if user_level = 10 worked.*/
-   hnd->status = cli_samr_query_userinfo( &(srv->cli), mem_ctx, user_hnd, 21, &ctr);
+   hnd->status = cli_samr_query_userinfo( &(srv->cli), mem_ctx, user_hnd, 0x10, &ctr);
 
    if(!NT_STATUS_IS_OK(hnd->status))
       return CAC_FAILURE;
 
    /**check the ACB mask*/
-   if((ctr->info.id21->acb_info & ACB_DISABLED) == ACB_DISABLED) {
+   if((ctr->info.id10->acb_info & ACB_DISABLED) == ACB_DISABLED) {
       /*toggle the disabled bit*/
-      ctr->info.id21->acb_info ^= ACB_DISABLED;
+      ctr->info.id10->acb_info ^= ACB_DISABLED;
    }
    else {
       /*the user is already enabled so just return success*/
@@ -1598,8 +1598,9 @@
    }
 
    /*now set the userinfo*/
-   hnd->status = cli_samr_set_userinfo( &(srv->cli), mem_ctx, user_hnd, 0x10, &(srv->cli.user_session_key), ctr);
+   hnd->status = cli_samr_set_userinfo2( &(srv->cli), mem_ctx, user_hnd, 0x10, &(srv->cli.user_session_key), ctr);
 
+   /*this will only work properly if we use set_userinfo2 - fail if it is not supported*/
    if(!NT_STATUS_IS_OK(hnd->status))
       return CAC_FAILURE;
 
@@ -1645,8 +1646,10 @@
    /*toggle the disabled bit*/
    ctr->info.id10->acb_info ^= ACB_DISABLED;
 
-   hnd->status = cli_samr_set_userinfo( &(srv->cli), mem_ctx, user_hnd, 0x10, &(srv->cli.user_session_key), ctr);
+   /*this will only work properly if we use set_userinfo2*/
+   hnd->status = cli_samr_set_userinfo2( &(srv->cli), mem_ctx, user_hnd, 0x10, &(srv->cli.user_session_key), ctr);
 
+   /*this will only work properly if we use set_userinfo2 fail if it is not supported*/
    if(!NT_STATUS_IS_OK(hnd->status))
       return CAC_FAILURE;
 



More information about the samba-cvs mailing list