mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
cleanups to make thinsg compile cleanly
(This used to be commit 39fbeb04ae
)
This commit is contained in:
parent
0cb74d3bb8
commit
1956d13494
@ -166,7 +166,7 @@ void E_md4hash(uchar *passwd, uchar *p16)
|
||||
MDstruct MD;
|
||||
|
||||
/* Password cannot be longer than 128 characters */
|
||||
len = strlen(passwd);
|
||||
len = strlen((char *)passwd);
|
||||
if(len > 128)
|
||||
len = 128;
|
||||
/* Password must be converted to NT unicode */
|
||||
|
@ -262,7 +262,7 @@ get_smbpwnam(char *name)
|
||||
if (!strncasecmp((char *) p, "NO PASSWORD", 11)) {
|
||||
pw_buf.smb_passwd = NULL;
|
||||
} else {
|
||||
if(!gethexpwd(p,smbpwd)) {
|
||||
if(!gethexpwd((char *)p,(char *)smbpwd)) {
|
||||
DEBUG(0, ("Malformed Lanman password entry (non hex chars)\n"));
|
||||
fclose(fp);
|
||||
pw_file_unlock(lockfd);
|
||||
@ -280,7 +280,7 @@ get_smbpwnam(char *name)
|
||||
the lanman password. */
|
||||
if ((linebuf_len >= (PTR_DIFF(p, linebuf) + 33)) && (p[32] == ':')) {
|
||||
if (*p != '*' && *p != 'X') {
|
||||
if(gethexpwd(p,smbntpwd))
|
||||
if(gethexpwd((char *)p,(char *)smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ void generate_next_challenge(char *challenge)
|
||||
v2 = (counter++) * getpid() + tval.tv_usec;
|
||||
SIVAL(challenge,0,v1);
|
||||
SIVAL(challenge,4,v2);
|
||||
E1(challenge,"SAMBA",saved_challenge);
|
||||
E1(challenge,"SAMBA",(char *)saved_challenge);
|
||||
memcpy(challenge,saved_challenge,8);
|
||||
challenge_sent = True;
|
||||
}
|
||||
@ -684,7 +684,9 @@ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL
|
||||
if(smb_pass->smb_nt_passwd != NULL)
|
||||
{
|
||||
DEBUG(4,("Checking NT MD4 password\n"));
|
||||
if(smb_password_check(password, smb_pass->smb_nt_passwd, challenge))
|
||||
if(smb_password_check(password,
|
||||
smb_pass->smb_nt_passwd,
|
||||
(char *)challenge))
|
||||
{
|
||||
update_protected_database(user,True);
|
||||
return(True);
|
||||
@ -696,11 +698,12 @@ BOOL password_ok(char *user,char *password, int pwlen, struct passwd *pwd, BOOL
|
||||
|
||||
/* Try against the lanman password */
|
||||
|
||||
if(smb_password_check(password, smb_pass->smb_passwd, challenge))
|
||||
{
|
||||
update_protected_database(user,True);
|
||||
return(True);
|
||||
}
|
||||
if (smb_password_check(password,
|
||||
smb_pass->smb_passwd,
|
||||
(char *)challenge)) {
|
||||
update_protected_database(user,True);
|
||||
return(True);
|
||||
}
|
||||
|
||||
DEBUG(3,("Error smb_password_check failed\n"));
|
||||
}
|
||||
|
@ -152,8 +152,8 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
|
||||
/* NT Entry was valid - even if 'X' or '*', can be overwritten */
|
||||
*got_valid_nt_entry = True;
|
||||
if (*p != '*' && *p != 'X') {
|
||||
if(gethexpwd(p,smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
if (gethexpwd((char *)p,(char *)smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
}
|
||||
}
|
||||
pw_buf.smb_name = user_name;
|
||||
@ -167,12 +167,12 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
|
||||
if (p[32] != ':')
|
||||
return (False);
|
||||
|
||||
if (!strncasecmp(p, "NO PASSWORD", 11)) {
|
||||
pw_buf.smb_passwd = NULL; /* No password */
|
||||
if (!strncasecmp((char *)p, "NO PASSWORD", 11)) {
|
||||
pw_buf.smb_passwd = NULL; /* No password */
|
||||
} else {
|
||||
if(!gethexpwd(p,smbpwd))
|
||||
return False;
|
||||
pw_buf.smb_passwd = smbpwd;
|
||||
if(!gethexpwd((char *)p,(char *)smbpwd))
|
||||
return False;
|
||||
pw_buf.smb_passwd = smbpwd;
|
||||
}
|
||||
|
||||
pw_buf.smb_name = user_name;
|
||||
@ -189,8 +189,8 @@ _my_get_smbpwnam(FILE * fp, char *name, BOOL * valid_old_pwd,
|
||||
/* NT Entry was valid - even if 'X' or '*', can be overwritten */
|
||||
*got_valid_nt_entry = True;
|
||||
if (*p != '*' && *p != 'X') {
|
||||
if(gethexpwd(p,smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
if (gethexpwd((char *)p,(char *)smbntpwd))
|
||||
pw_buf.smb_nt_passwd = smbntpwd;
|
||||
}
|
||||
}
|
||||
return &pw_buf;
|
||||
|
Loading…
Reference in New Issue
Block a user