summaryrefslogtreecommitdiff
path: root/source3/smbd/chgpasswd.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-10-21 16:58:34 +0000
committerJeremy Allison <jra@samba.org>1998-10-21 16:58:34 +0000
commit6e3af45afe237790f1d7cd94ab2b22e1ca772157 (patch)
treec0870e0739564cff7c19e2a900d3c701e1ebb33a /source3/smbd/chgpasswd.c
parentac9be4ddca99c5efae518a985b97fb1fb6374289 (diff)
downloadsamba-6e3af45afe237790f1d7cd94ab2b22e1ca772157.tar.gz
samba-6e3af45afe237790f1d7cd94ab2b22e1ca772157.tar.bz2
samba-6e3af45afe237790f1d7cd94ab2b22e1ca772157.zip
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)
Diffstat (limited to 'source3/smbd/chgpasswd.c')
-rw-r--r--source3/smbd/chgpasswd.c13
1 files changed, 7 insertions, 6 deletions
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);