From f8d3cac8af0185eca2995e524c62f064ab9b4017 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Thu, 9 Aug 2001 15:53:49 +0000 Subject: a few cleanups while mergeing the passdb code into 2.2 (This used to be commit ef01739708479c43f529c646dd136ee5670b08f9) --- source3/auth/auth.c | 2 +- source3/passdb/pdb_smbpasswd.c | 3 --- source3/rpc_server/srv_pipe.c | 2 +- source3/rpc_server/srv_samr_nt.c | 43 ++++++++++++++++++++-------------------- source3/smbd/auth.c | 2 +- 5 files changed, 25 insertions(+), 27 deletions(-) (limited to 'source3') diff --git a/source3/auth/auth.c b/source3/auth/auth.c index b679312cc4..94008e4d00 100644 --- a/source3/auth/auth.c +++ b/source3/auth/auth.c @@ -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; } diff --git a/source3/passdb/pdb_smbpasswd.c b/source3/passdb/pdb_smbpasswd.c index dbb0d050c9..942c232ae8 100644 --- a/source3/passdb/pdb_smbpasswd.c +++ b/source3/passdb/pdb_smbpasswd.c @@ -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' */ diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c index 277cd13522..4d4d058fba 100644 --- a/source3/rpc_server/srv_pipe.c +++ b/source3/rpc_server/srv_pipe.c @@ -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); diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index a4754beb52..d617dd9809 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -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; diff --git a/source3/smbd/auth.c b/source3/smbd/auth.c index b679312cc4..94008e4d00 100644 --- a/source3/smbd/auth.c +++ b/source3/smbd/auth.c @@ -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; } -- cgit