if (pw_buf == NULL) return False;
- vp = startsampwent(False);
+ vp = startsmbpwent(False);
if (!vp)
{
- DEBUG(0, ("get_sampwd_entries: Unable to open SMB password file.\n"));
+ DEBUG(0, ("get_sampwd_entries: Unable to open SMB password database.\n"));
return False;
}
- while (((pwd = getsampwent(vp)) != NULL) && (*num_entries) < max_num_entries)
+ while (((pwd = getsmbpwent(vp)) != NULL) && (*num_entries) < max_num_entries)
{
int user_name_len = strlen(pwd->smb_name);
make_unistr2(&(pw_buf[(*num_entries)].uni_user_name), pwd->smb_name, user_name_len-1);
pw_buf[(*num_entries)].acb_info = (uint16)pwd->acct_ctrl;
- DEBUG(5, ("get_sampwd_entries: idx: %d user %s, uid %d, acb %x",
+ DEBUG(5, ("get_smbpwd_entries: idx: %d user %s, uid %d, acb %x",
(*num_entries), pwd->smb_name, pwd->smb_userid, pwd->acct_ctrl));
if (acb_mask == 0 || IS_BITS_SET_SOME(pwd->acct_ctrl, acb_mask))
(*total_entries)++;
}
- endsampwent(vp);
+ endsmbpwent(vp);
return (*num_entries) > 0;
}
SAMR_R_CLOSE_HND r_u;
/* set up the SAMR unknown_1 response */
- bzero(&(r_u.pol.data), POL_HND_SIZE);
+ bzero(r_u.pol.data, POL_HND_SIZE);
/* close the policy handle */
if (close_lsa_policy_hnd(&(q_u->pol)))
BOOL pol_open = False;
/* set up the SAMR open_user response */
- bzero(&(r_u.user_pol.data), POL_HND_SIZE);
+ bzero(r_u.user_pol.data, POL_HND_SIZE);
r_u.status = 0x0;
}
become_root(True);
- smb_pass = getsampwuid(q_u->user_rid);
+ smb_pass = getsmbpwuid(q_u->user_rid);
unbecome_root(True);
/* check that the RID exists in our domain. */
/*************************************************************************
get_user_info_21
*************************************************************************/
-static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 rid)
+static BOOL get_user_info_21(SAM_USER_INFO_21 *id21, uint32 user_rid)
{
NTTIME dummy_time;
struct sam_passwd *sam_pass;
-
LOGON_HRS hrs;
int i;
+ if (!pdb_rid_is_user(user_rid))
+ {
+ return False;
+ }
+
become_root(True);
- sam_pass = getsam21pwrid(rid);
+ sam_pass = getsam21pwrid(user_rid);
unbecome_root(True);
if (sam_pass == NULL)
if (status == 0x0)
{
become_root(True);
- smb_pass = getsampwuid(rid);
+ smb_pass = getsmbpwuid(rid);
unbecome_root(True);
if (smb_pass == NULL)
SAMR_R_UNKNOWN_32 r_u;
/* set up the SAMR unknown_32 response */
- bzero(&(r_u.pol.data), POL_HND_SIZE);
+ bzero(r_u.pol.data, POL_HND_SIZE);
if (status == 0)
{
for (i = 4; i < POL_HND_SIZE; i++)
q_u.uni_mach_acct.uni_str_len));
become_root(True);
- smb_pass = getsampwnam(mach_acct);
+ smb_pass = getsmbpwnam(mach_acct);
unbecome_root(True);
if (smb_pass != NULL)