* samba/libsmb/clientgen.c (cli_oem_change_password): Removed.
* samba/libsmb/smbencrypt.c (make_oem_passwd_hash): Removed. * samba/lib/util_sock.c (reset_globals_after_fork): Removed.
Этот коммит содержится в:
родитель
d83d988c73
Коммит
1ed4f8c110
@ -1,5 +1,9 @@
|
||||
2005-01-20 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* samba/libsmb/clientgen.c (cli_oem_change_password): Removed.
|
||||
* samba/libsmb/smbencrypt.c (make_oem_passwd_hash): Removed.
|
||||
* samba/lib/util_sock.c (reset_globals_after_fork): Removed.
|
||||
|
||||
* samba/lib/util_file.c: Comment out all but fgets_slash().
|
||||
|
||||
* samba/lib/util.c: Comment out some more unused functions.
|
||||
@ -8,7 +12,7 @@
|
||||
(remote_proto, remote_arch): Make static const char * instead of
|
||||
fstring.
|
||||
(local_machine, remote_machine): Ditto.
|
||||
* samba/libsmb/clientgen.c (interpret_long_filename): Fix
|
||||
(interpret_long_filename): Fix
|
||||
def_finfo declaration.
|
||||
|
||||
2005-01-19 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
@ -800,22 +800,6 @@ connect_again:
|
||||
static BOOL global_client_name_done = False;
|
||||
static BOOL global_client_addr_done = False;
|
||||
|
||||
void reset_globals_after_fork(void)
|
||||
{
|
||||
global_client_name_done = False;
|
||||
global_client_addr_done = False;
|
||||
|
||||
/*
|
||||
* Re-seed the random crypto generator, so all smbd's
|
||||
* started from the same parent won't generate the same
|
||||
* sequence.
|
||||
*/
|
||||
{
|
||||
unsigned char dummy;
|
||||
generate_random_buffer( &dummy, 1, True);
|
||||
}
|
||||
}
|
||||
|
||||
/*******************************************************************
|
||||
return the DNS name of the client
|
||||
******************************************************************/
|
||||
|
@ -2156,98 +2156,6 @@ int cli_list(struct cli_state *cli,const char *Mask,uint16 attribute,
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
Send a SamOEMChangePassword command
|
||||
****************************************************************************/
|
||||
|
||||
BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char *new_password,
|
||||
const char *old_password)
|
||||
{
|
||||
char param[16+sizeof(fstring)];
|
||||
char data[532];
|
||||
char *p = param;
|
||||
fstring upper_case_old_pw;
|
||||
fstring upper_case_new_pw;
|
||||
unsigned char old_pw_hash[16];
|
||||
unsigned char new_pw_hash[16];
|
||||
int data_len;
|
||||
int param_len = 0;
|
||||
char *rparam = NULL;
|
||||
char *rdata = NULL;
|
||||
int rprcnt, rdrcnt;
|
||||
|
||||
if (strlen(user) >= sizeof(fstring)-1) {
|
||||
DEBUG(0,("cli_oem_change_password: user name %s is too long.\n", user));
|
||||
return False;
|
||||
}
|
||||
|
||||
SSVAL(p,0,214); /* SamOEMChangePassword command. */
|
||||
p += 2;
|
||||
pstrcpy(p, "zsT");
|
||||
p = skip_string(p,1);
|
||||
pstrcpy(p, "B516B16");
|
||||
p = skip_string(p,1);
|
||||
pstrcpy(p,user);
|
||||
p = skip_string(p,1);
|
||||
SSVAL(p,0,532);
|
||||
p += 2;
|
||||
|
||||
param_len = PTR_DIFF(p,param);
|
||||
|
||||
/*
|
||||
* Get the Lanman hash of the old password, we
|
||||
* use this as the key to make_oem_passwd_hash().
|
||||
*/
|
||||
memset(upper_case_old_pw, '\0', sizeof(upper_case_old_pw));
|
||||
fstrcpy(upper_case_old_pw, old_password);
|
||||
strupper(upper_case_old_pw);
|
||||
E_P16((uchar *)upper_case_old_pw, old_pw_hash);
|
||||
|
||||
if (!make_oem_passwd_hash( data, new_password, old_pw_hash, False))
|
||||
{
|
||||
return False;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now place the old password hash in the data.
|
||||
*/
|
||||
memset(upper_case_new_pw, '\0', sizeof(upper_case_new_pw));
|
||||
fstrcpy(upper_case_new_pw, new_password);
|
||||
strupper(upper_case_new_pw);
|
||||
|
||||
E_P16((uchar *)upper_case_new_pw, new_pw_hash);
|
||||
|
||||
E_old_pw_hash( new_pw_hash, old_pw_hash, (uchar *)&data[516]);
|
||||
|
||||
data_len = 532;
|
||||
|
||||
if (cli_send_trans(cli,SMBtrans,
|
||||
PIPE_LANMAN,strlen(PIPE_LANMAN), /* name, length */
|
||||
0,0, /* fid, flags */
|
||||
NULL,0,0, /* setup, length, max */
|
||||
param,param_len,2, /* param, length, max */
|
||||
data,data_len,0 /* data, length, max */
|
||||
) == False) {
|
||||
DEBUG(0,("cli_oem_change_password: Failed to send password change for user %s\n",
|
||||
user ));
|
||||
return False;
|
||||
}
|
||||
|
||||
if (cli_receive_trans(cli,SMBtrans,
|
||||
&rparam, &rprcnt,
|
||||
&rdata, &rdrcnt)) {
|
||||
if (rparam)
|
||||
cli->rap_error = SVAL(rparam,0);
|
||||
}
|
||||
|
||||
if (rparam)
|
||||
free(rparam);
|
||||
if (rdata)
|
||||
free(rdata);
|
||||
|
||||
return (cli->rap_error == 0);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
send a negprot command
|
||||
****************************************************************************/
|
||||
|
@ -189,40 +189,3 @@ void SMBNTencrypt(uchar *passwd, uchar *c8, uchar *p24)
|
||||
dump_data(100, (char *)p24, 24);
|
||||
#endif
|
||||
}
|
||||
|
||||
BOOL make_oem_passwd_hash(char data[516], const char *passwd, uchar old_pw_hash[16], BOOL unicode)
|
||||
{
|
||||
int new_pw_len = strlen(passwd) * (unicode ? 2 : 1);
|
||||
|
||||
if (new_pw_len > 512)
|
||||
{
|
||||
DEBUG(0,("make_oem_passwd_hash: new password is too long.\n"));
|
||||
return False;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now setup the data area.
|
||||
* We need to generate a random fill
|
||||
* for this area to make it harder to
|
||||
* decrypt. JRA.
|
||||
*/
|
||||
generate_random_buffer((unsigned char *)data, 516, False);
|
||||
if (unicode)
|
||||
{
|
||||
struni2( &data[512 - new_pw_len], passwd);
|
||||
}
|
||||
else
|
||||
{
|
||||
fstrcpy( &data[512 - new_pw_len], passwd);
|
||||
}
|
||||
SIVAL(data, 512, new_pw_len);
|
||||
|
||||
#ifdef DEBUG_PASSWORD
|
||||
DEBUG(100,("make_oem_passwd_hash\n"));
|
||||
dump_data(100, data, 516);
|
||||
#endif
|
||||
SamOEMhash( (unsigned char *)data, (unsigned char *)old_pw_hash, True);
|
||||
|
||||
return True;
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user