summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-07-08 18:44:50 +0000
committerLuke Leighton <lkcl@samba.org>1999-07-08 18:44:50 +0000
commit019d80f59797257aee0b979925a243da177c8dcb (patch)
tree9e34635840f4d8853d4df055bdb8959f781479c7
parent15291cb74fd129fafe908e0e57c8ba578621585b (diff)
downloadsamba-019d80f59797257aee0b979925a243da177c8dcb.tar.gz
samba-019d80f59797257aee0b979925a243da177c8dcb.tar.xz
samba-019d80f59797257aee0b979925a243da177c8dcb.zip
issues with pwdb_sam_map_names() and pwdb_smb_map_names() returning NULL.
found by Bertl <bs@vpnet.at> (This used to be commit 389c17a225884b39d097dc0851a794d3669fdc31)
-rw-r--r--source3/passdb/passdb.c14
-rw-r--r--source3/passdb/sampassdb.c9
2 files changed, 20 insertions, 3 deletions
diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c
index 5b1ff38d2c6..3cb083bb766 100644
--- a/source3/passdb/passdb.c
+++ b/source3/passdb/passdb.c
@@ -208,7 +208,12 @@ struct smb_passwd *getsmbpwent(void *vp)
BOOL add_smbpwd_entry(struct smb_passwd *newpwd)
{
- return pwdb_ops->add_smbpwd_entry(pwdb_smb_map_names(newpwd));
+ struct smb_passwd *mapped = pwdb_smb_map_names(newpwd);
+ if (mapped)
+ {
+ return pwdb_ops->add_smbpwd_entry(mapped);
+ }
+ return False;
}
/************************************************************************
@@ -222,7 +227,12 @@ BOOL add_smbpwd_entry(struct smb_passwd *newpwd)
BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override)
{
- return pwdb_ops->mod_smbpwd_entry(pwdb_smb_map_names(pwd), override);
+ struct smb_passwd *mapped = pwdb_smb_map_names(pwd);
+ if (mapped)
+ {
+ return pwdb_ops->mod_smbpwd_entry(mapped, override);
+ }
+ return False;
}
/************************************************************************
diff --git a/source3/passdb/sampassdb.c b/source3/passdb/sampassdb.c
index dbfd2aab807..c784f786c56 100644
--- a/source3/passdb/sampassdb.c
+++ b/source3/passdb/sampassdb.c
@@ -134,10 +134,17 @@ struct sam_passwd *getsam21pwent(void *vp)
BOOL mod_sam21pwd_entry(struct sam_passwd* pwd, BOOL override)
{
+ struct sam_passwd *mapped;
+
DEBUG(10,("mod_sam21pwd_entry: unix user %s rid %d\n",
pwd->unix_name, pwd->user_rid));
- return pwdb_ops->mod_sam21pwd_entry(pwdb_sam_map_names(pwd), override);
+ mapped = pwdb_sam_map_names(pwd);
+ if (mapped != NULL)
+ {
+ return pwdb_ops->mod_sam21pwd_entry(mapped, override);
+ }
+ return False;
}
/************************************************************************