summaryrefslogtreecommitdiff
path: root/source3/passdb/smbpass.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-03-09 01:21:57 +0000
committerLuke Leighton <lkcl@samba.org>1999-03-09 01:21:57 +0000
commita3c6e96a22bfaaa5a2993e85327555266476013d (patch)
treed18c6f1a16ab14ab17d1e4157198a941e667931b /source3/passdb/smbpass.c
parentaecbc5b5d37690f145c42ed834a58565c12db6d3 (diff)
downloadsamba-a3c6e96a22bfaaa5a2993e85327555266476013d.tar.gz
samba-a3c6e96a22bfaaa5a2993e85327555266476013d.tar.bz2
samba-a3c6e96a22bfaaa5a2993e85327555266476013d.zip
mods to allow inter-domain trust accounts to be added to SAM database
using smbpasswd command. (This used to be commit 62d499f83256c6e8b3308dc4bd8e9f5df873b14b)
Diffstat (limited to 'source3/passdb/smbpass.c')
-rw-r--r--source3/passdb/smbpass.c32
1 files changed, 20 insertions, 12 deletions
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"));