From a3c6e96a22bfaaa5a2993e85327555266476013d Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 9 Mar 1999 01:21:57 +0000 Subject: mods to allow inter-domain trust accounts to be added to SAM database using smbpasswd command. (This used to be commit 62d499f83256c6e8b3308dc4bd8e9f5df873b14b) --- source3/passdb/smbpass.c | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) (limited to 'source3/passdb/smbpass.c') diff --git a/source3/passdb/smbpass.c b/source3/passdb/smbpass.c index 2686f1d68f..2985af1ff8 100644 --- a/source3/passdb/smbpass.c +++ b/source3/passdb/smbpass.c @@ -139,16 +139,6 @@ struct smb_passwd *getsmbfilepwent(void *vp) /* Skip the ':' */ p++; - if (*p == '*' || *p == 'X') - { - /* Password deliberately invalid - end here. */ - DEBUG(10, ("getsmbfilepwent: entry invalidated for unix user %s\n", unix_name)); - pw_buf.smb_nt_passwd = NULL; - pw_buf.smb_passwd = NULL; - pw_buf.acct_ctrl |= ACB_DISABLED; - return &pw_buf; - } - if (linebuf_len < (PTR_DIFF(p, linebuf) + 33)) { DEBUG(0, ("getsmbfilepwent: malformed password entry (passwd too short)\n")); @@ -240,6 +230,18 @@ struct smb_passwd *getsmbfilepwent(void *vp) } } + if (*p == '*' || *p == 'X') + { + /* Password deliberately invalid - end here. */ + DEBUG(10, ("getsmbfilepwent: entry invalidated for unix user %s\n", unix_name)); + pw_buf.smb_nt_passwd = NULL; + pw_buf.smb_passwd = NULL; + pw_buf.acct_ctrl |= ACB_DISABLED; + } + + DEBUG(6,("unixuser:%s uid:%d acb:%x\n", + pw_buf.unix_name, pw_buf.unix_uid, pw_buf.acct_ctrl)); + return &pw_buf; } @@ -410,8 +412,14 @@ static BOOL mod_smbfilepwd_entry(struct smb_passwd* pwd, BOOL override) #ifdef DEBUG_PASSWORD DEBUG(100,("mod_smbfilepwd_entry: password entries\n")); - dump_data(100, pwd->smb_passwd, 16); - dump_data(100, pwd->smb_nt_passwd, 16); + if (pwd->smb_passwd != NULL) + { + dump_data(100, pwd->smb_passwd, 16); + } + if (pwd->smb_nt_passwd != NULL) + { + dump_data(100, pwd->smb_nt_passwd, 16); + } #endif if (!*pfile) { DEBUG(0, ("No SMB password file set\n")); -- cgit