]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3-samr-server: unify callback convention: _samr_UserSetInfo.
authorGünther Deschner <gd@samba.org>
Thu, 23 Oct 2008 01:31:32 +0000 (03:31 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 23 Oct 2008 11:06:38 +0000 (13:06 +0200)
Guenther
(cherry picked from commit aa301e82d0c44c6a733e8be2546d661ea56512ef)

source/rpc_server/srv_samr_nt.c

index 88e1bdc9dd648af8b71af7b4af3239997387e20a..a24fb324b05b4ecc5dd855cd5f5d3026280ea369 100644 (file)
@@ -4141,20 +4141,18 @@ static NTSTATUS set_user_info_25(TALLOC_CTX *mem_ctx,
 }
 
 /*******************************************************************
- samr_SetUserInfo_internal
+ samr_SetUserInfo
  ********************************************************************/
 
-static NTSTATUS samr_SetUserInfo_internal(const char *fn_name,
-                                         pipes_struct *p,
-                                         struct policy_handle *user_handle,
-                                         uint16_t level,
-                                         union samr_UserInfo *info)
+NTSTATUS _samr_SetUserInfo(pipes_struct *p,
+                          struct samr_SetUserInfo *r)
 {
        NTSTATUS status;
        struct samu *pwd = NULL;
        DOM_SID sid;
-       POLICY_HND *pol = user_handle;
-       uint16_t switch_value = level;
+       POLICY_HND *pol = r->in.user_handle;
+       union samr_UserInfo *info = r->in.info;
+       uint16_t switch_value = r->in.level;
        uint32_t acc_granted;
        uint32_t acc_required;
        bool ret;
@@ -4162,7 +4160,7 @@ static NTSTATUS samr_SetUserInfo_internal(const char *fn_name,
        uint32_t acb_info;
        DISP_INFO *disp_info = NULL;
 
-       DEBUG(5,("%s: %d\n", fn_name, __LINE__));
+       DEBUG(5,("_samr_SetUserInfo: %d\n", __LINE__));
 
        /* find the policy handle.  open a policy on it. */
        if (!get_lsa_policy_samr_sid(p, pol, &sid, &acc_granted, &disp_info)) {
@@ -4192,16 +4190,16 @@ static NTSTATUS samr_SetUserInfo_internal(const char *fn_name,
 
        status = access_check_samr_function(acc_granted,
                                            acc_required,
-                                           fn_name);
+                                           "_samr_SetUserInfo");
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
 
-       DEBUG(5, ("%s: sid:%s, level:%d\n",
-                 fn_name, sid_string_dbg(&sid), switch_value));
+       DEBUG(5, ("_samr_SetUserInfo: sid:%s, level:%d\n",
+                 sid_string_dbg(&sid), switch_value));
 
        if (info == NULL) {
-               DEBUG(5, ("%s: NULL info level\n", fn_name));
+               DEBUG(5, ("_samr_SetUserInfo: NULL info level\n"));
                return NT_STATUS_INVALID_INFO_CLASS;
        }
 
@@ -4235,8 +4233,7 @@ static NTSTATUS samr_SetUserInfo_internal(const char *fn_name,
                }
        }
 
-       DEBUG(5, ("%s: %s does%s possess sufficient rights\n",
-                 fn_name,
+       DEBUG(5, ("_samr_SetUserInfo: %s does%s possess sufficient rights\n",
                  uidtoname(p->pipe_user.ut.uid),
                  has_enough_rights ? "" : " not"));
 
@@ -4362,20 +4359,6 @@ static NTSTATUS samr_SetUserInfo_internal(const char *fn_name,
        return status;
 }
 
-/*******************************************************************
- _samr_SetUserInfo
- ********************************************************************/
-
-NTSTATUS _samr_SetUserInfo(pipes_struct *p,
-                          struct samr_SetUserInfo *r)
-{
-       return samr_SetUserInfo_internal("_samr_SetUserInfo",
-                                        p,
-                                        r->in.user_handle,
-                                        r->in.level,
-                                        r->in.info);
-}
-
 /*******************************************************************
  _samr_SetUserInfo2
  ********************************************************************/
@@ -4383,11 +4366,13 @@ NTSTATUS _samr_SetUserInfo(pipes_struct *p,
 NTSTATUS _samr_SetUserInfo2(pipes_struct *p,
                            struct samr_SetUserInfo2 *r)
 {
-       return samr_SetUserInfo_internal("_samr_SetUserInfo2",
-                                        p,
-                                        r->in.user_handle,
-                                        r->in.level,
-                                        r->in.info);
+       struct samr_SetUserInfo q;
+
+       q.in.user_handle        = r->in.user_handle;
+       q.in.level              = r->in.level;
+       q.in.info               = r->in.info;
+
+       return _samr_SetUserInfo(p, &q);
 }
 
 /*********************************************************************