a few cleanups while mergeing the passdb code into 2.2
authorGerald Carter <jerry@samba.org>
Thu, 9 Aug 2001 15:53:49 +0000 (15:53 +0000)
committerGerald Carter <jerry@samba.org>
Thu, 9 Aug 2001 15:53:49 +0000 (15:53 +0000)
(This used to be commit ef01739708479c43f529c646dd136ee5670b08f9)

source3/auth/auth.c
source3/passdb/pdb_smbpasswd.c
source3/rpc_server/srv_pipe.c
source3/rpc_server/srv_samr_nt.c
source3/smbd/auth.c

index b679312cc4dd2ec60153809b246ae142cf098376..94008e4d00a5ed2731e18c6a72c1015f3f2e74ed 100644 (file)
@@ -45,7 +45,7 @@ static BOOL update_smbpassword_file(char *user, char *password)
        unbecome_root();
 
        if(ret == False) {
-               DEBUG(0,("pdb_getsampwnam returned NULL\n"));
+               DEBUG(0,("update_smbpassword_file: pdb_getsampwnam failed to locate %s\n", user));
                pdb_free_sam(sampass);
                return False;
        }
index dbb0d050c9de36201d3bcb73de18a93897cc6211..942c232ae81747cdf72ce39bf53ecf5cb34f9557 100644 (file)
@@ -1339,9 +1339,6 @@ BOOL pdb_getsampwnam(SAM_ACCOUNT *sam_acct, char *username)
 
        DEBUG(10, ("pdb_getsampwnam: search by name: %s\n", username));
 
-#if 0  /* JERRY - DEBUG */
-       sleep (90000);
-#endif
        
        /* break the username from the domain if we have 
           been given a string in the form 'DOMAIN\user' */
index 277cd13522c15f1ee7b0f998bea3806d61ebfa32..4d4d058fba5712a76cdde770ec89a968dc76035b 100644 (file)
@@ -455,7 +455,7 @@ failed authentication on named pipe %s.\n", domain, pipe_user_name, wks, p->name
         */
 
        p->pipe_user.uid = pdb_get_uid(sampass);
-       p->pipe_user.gid = pdb_get_uid(sampass);
+       p->pipe_user.gid = pdb_get_gid(sampass);
 
        /* Set up pipe user group membership. */
        initialise_groups(pipe_user_name, p->pipe_user.uid, p->pipe_user.gid);
index a4754beb520b855ed21c6c52b6b04b666289efe7..d617dd9809730dc15fd5ca5539b05f7b80502929 100644 (file)
@@ -109,26 +109,27 @@ static uint32 get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx,
                return NT_STATUS_ACCESS_DENIED;
        }
 
-    while (((not_finished = pdb_getsampwent(pwd)) != False) && (*num_entries) < max_num_entries) {
-        int user_name_len;
-
-        if (start_idx > 0) {
-            /* skip the requested number of entries.
-               not very efficient, but hey...
-             */
-            start_idx--;
-            continue;
+       while (((not_finished = pdb_getsampwent(pwd)) != False) 
+               && (*num_entries) < max_num_entries) 
+       {
+               int user_name_len;
+
+               if (start_idx > 0) {
+                   /* skip the requested number of entries.
+                      not very efficient, but hey...  */
+               start_idx--;
+               continue;
         }
 
-        user_name_len = strlen(pdb_get_username(pwd))+1;
-        init_unistr2(&pw_buf[(*num_entries)].uni_user_name, pdb_get_username(pwd), user_name_len);
-        init_uni_hdr(&pw_buf[(*num_entries)].hdr_user_name, user_name_len);
-        pw_buf[(*num_entries)].user_rid = pwd->user_rid;
-        memset((char *)pw_buf[(*num_entries)].nt_pwd, '\0', 16);
+       user_name_len = strlen(pdb_get_username(pwd))+1;
+       init_unistr2(&pw_buf[(*num_entries)].uni_user_name, pdb_get_username(pwd), user_name_len);
+       init_uni_hdr(&pw_buf[(*num_entries)].hdr_user_name, user_name_len);
+       pw_buf[(*num_entries)].user_rid = pwd->user_rid;
+       memset((char *)pw_buf[(*num_entries)].nt_pwd, '\0', 16);
 
         /* Now check if the NT compatible password is available. */
         if (pdb_get_nt_passwd(pwd))
-            memcpy( pw_buf[(*num_entries)].nt_pwd , pdb_get_nt_passwd(pwd), 16);
+               memcpy( pw_buf[(*num_entries)].nt_pwd , pdb_get_nt_passwd(pwd), 16);
 
         pw_buf[(*num_entries)].acb_info = pdb_get_acct_ctrl(pwd);
 
@@ -136,14 +137,14 @@ static uint32 get_sampwd_entries(SAM_USER_INFO_21 *pw_buf, int start_idx,
                   (*num_entries), pdb_get_username(pwd), pdb_get_user_rid(pwd), pdb_get_acct_ctrl(pwd) ));
 
         if (acb_mask == 0 || (pwd->acct_ctrl & acb_mask)) {
-            DEBUG(5,(" acb_mask %x accepts\n", acb_mask));
-            (*num_entries)++;
+               DEBUG(5,(" acb_mask %x accepts\n", acb_mask));
+               (*num_entries)++;
         }
         else
-            DEBUG(5,(" acb_mask %x rejects\n", acb_mask));
+               DEBUG(5,(" acb_mask %x rejects\n", acb_mask));
 
-        (*total_entries)++;
-    }
+               (*total_entries)++;
+       }
 
        pdb_endsampwent();
        pdb_free_sam(pwd);
@@ -1794,7 +1795,7 @@ uint32 _samr_query_userinfo(pipes_struct *p, SAMR_Q_QUERY_USERINFO *q_u, SAMR_R_
 
 uint32 _samr_query_usergroups(pipes_struct *p, SAMR_Q_QUERY_USERGROUPS *q_u, SAMR_R_QUERY_USERGROUPS *r_u)
 {
-       struct sam_passwd *sam_pass=NULL;
+       SAM_ACCOUNT *sam_pass=NULL;
        DOM_GID *gids = NULL;
        int num_groups = 0;
        pstring groups;
index b679312cc4dd2ec60153809b246ae142cf098376..94008e4d00a5ed2731e18c6a72c1015f3f2e74ed 100644 (file)
@@ -45,7 +45,7 @@ static BOOL update_smbpassword_file(char *user, char *password)
        unbecome_root();
 
        if(ret == False) {
-               DEBUG(0,("pdb_getsampwnam returned NULL\n"));
+               DEBUG(0,("update_smbpassword_file: pdb_getsampwnam failed to locate %s\n", user));
                pdb_free_sam(sampass);
                return False;
        }