summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-03-15 06:45:19 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-03-15 06:45:19 +0000
commit16ec110b0f1fe45b598a04e171397d97c3cb5aef (patch)
treeb51f127f15986be5f87a3e98cbc0f2e4d2677848
parent6fe590983b5d4dca8cea82eaa8dfb7b3a13bc3d1 (diff)
downloadsamba-16ec110b0f1fe45b598a04e171397d97c3cb5aef.tar.gz
samba-16ec110b0f1fe45b598a04e171397d97c3cb5aef.tar.bz2
samba-16ec110b0f1fe45b598a04e171397d97c3cb5aef.zip
client-side smbpasswd fixes - use pstrcpy_base to avoid clobber_region bugs
Andrew Bartlett (This used to be commit 7ab6559369b4e6ee3c5269d8cff04e5a39f6b493)
-rw-r--r--source3/libsmb/clirap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index b38e7d5c23..224c37046c 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -281,7 +281,7 @@ 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)];
+ pstring param;
char data[532];
char *p = param;
unsigned char old_pw_hash[16];
@@ -300,11 +300,11 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
SSVAL(p,0,214); /* SamOEMChangePassword command. */
p += 2;
- pstrcpy(p, "zsT");
+ pstrcpy_base(p, "zsT", param);
p = skip_string(p,1);
- pstrcpy(p, "B516B16");
+ pstrcpy_base(p, "B516B16", param);
p = skip_string(p,1);
- pstrcpy(p,user);
+ pstrcpy_base(p,user, param);
p = skip_string(p,1);
SSVAL(p,0,532);
p += 2;
@@ -317,7 +317,7 @@ BOOL cli_oem_change_password(struct cli_state *cli, const char *user, const char
*/
E_deshash(old_password, old_pw_hash);
- clistr_push(cli, dos_new_password, new_password, -1, STR_TERMINATE|STR_ASCII);
+ clistr_push(cli, dos_new_password, new_password, sizeof(dos_new_password), STR_TERMINATE|STR_ASCII);
if (!make_oem_passwd_hash( data, dos_new_password, old_pw_hash, False))
return False;
@@ -685,7 +685,7 @@ NTSTATUS cli_qpathinfo_alt_name(struct cli_state *cli, const char *fname, fstrin
int count=8;
char *p;
BOOL ret;
- int len;
+ unsigned int len;
p = param;
memset(p, 0, 6);