From 6e3af45afe237790f1d7cd94ab2b22e1ca772157 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 21 Oct 1998 16:58:34 +0000 Subject: Fixed mainly signed/unsigned issues found by SGI cc in -fullwarn mode. smbd/chgpasswd.c: Fixed (my) stupid bug where I was returning stack based variables. Doh ! smbd/trans2.c: Allows SETFILEINFO as well as QFILEINFO on directory handles. Jeremy. (This used to be commit 0b44d27d0b5cc3948a6c2d78370ccddf1a84cd80) --- source3/smbd/chgpasswd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source3/smbd/chgpasswd.c') diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c index 91062268f9..59022c80a8 100644 --- a/source3/smbd/chgpasswd.c +++ b/source3/smbd/chgpasswd.c @@ -455,9 +455,9 @@ BOOL chgpasswd(char *name,char *oldpass,char *newpass, BOOL as_root) BOOL check_lanman_password(char *user, uchar *pass1, uchar *pass2, struct smb_passwd **psmbpw) { + static uchar null_pw[16]; uchar unenc_new_pw[16]; uchar unenc_old_pw[16]; - uchar null_pw[16]; struct smb_passwd *smbpw; *psmbpw = NULL; @@ -482,7 +482,7 @@ BOOL check_lanman_password(char *user, uchar *pass1, { uchar no_pw[14]; memset(no_pw, '\0', 14); - E_P16((uchar *)no_pw, (uchar *)null_pw); + E_P16(no_pw, null_pw); smbpw->smb_passwd = null_pw; } else if (smbpw->smb_passwd == NULL) { DEBUG(0,("check_lanman_password: no lanman password !\n")); @@ -514,8 +514,8 @@ BOOL check_lanman_password(char *user, uchar *pass1, BOOL change_lanman_password(struct smb_passwd *smbpw, uchar *pass1, uchar *pass2) { + static uchar null_pw[16]; uchar unenc_new_pw[16]; - uchar null_pw[16]; BOOL ret; if (smbpw == NULL) @@ -534,7 +534,7 @@ BOOL change_lanman_password(struct smb_passwd *smbpw, uchar *pass1, uchar *pass2 { uchar no_pw[14]; memset(no_pw, '\0', 14); - E_P16((uchar *)no_pw, (uchar *)null_pw); + E_P16(no_pw, null_pw); smbpw->smb_passwd = null_pw; } else if (smbpw->smb_passwd == NULL) { DEBUG(0,("change_lanman_password: no lanman password !\n")); @@ -605,15 +605,16 @@ BOOL check_oem_password(char *user, struct smb_passwd **psmbpw, char *new_passwd, int new_passwd_size) { + static uchar null_pw[16]; + static uchar null_ntpw[16]; struct smb_passwd *smbpw = NULL; int new_pw_len; uchar new_ntp16[16]; uchar unenc_old_ntpw[16]; uchar new_p16[16]; uchar unenc_old_pw[16]; - uchar null_pw[16]; - uchar null_ntpw[16]; char no_pw[2]; + BOOL nt_pass_set = (ntdata != NULL && nthash != NULL); become_root(False); -- cgit