smbpasswd -a segfaults

Bertl bs at vpnet.at
Thu Apr 1 14:45:03 GMT 1999


Yesterday I sucked samba 2.1 prealpha from CVS and discovered
that smbpasswd -a SEGFAULTs if lp_server_role() == ROLE_DOMAIN_NONE
_AND_ there's no usermap (is this a bug??).

When I set domain logon = Yes => no problem...

below is an ugly little patch that fixes the segfault, but
a message would be much nicer (if only I knew, how it should
behave...)

PS: Of course this kind of trouble is what one expects from prealpha
software, so just hit me if this is the wrong list and I'll not annoy
you with stuff like this in the future :)

diff -urN samba/source/passdb/passdb.c
samba_patch/source/passdb/passdb.c
--- samba/source/passdb/passdb.c        Wed Mar  3 19:48:48 1999
+++ samba_patch/source/passdb/passdb.c  Thu Apr  1 15:52:41 1999
@@ -208,7 +208,9 @@
 
 BOOL add_smbpwd_entry(struct smb_passwd *newpwd)
 {
-       return pwdb_ops->add_smbpwd_entry(pwdb_smb_map_names(newpwd));
+       return (newpwd = pwdb_smb_map_names(newpwd)) != NULL ?
+               pwdb_ops->add_smbpwd_entry(newpwd) :
+               False;
 }
 

/************************************************************************
@@ -222,7 +224,9 @@
 
 BOOL mod_smbpwd_entry(struct smb_passwd* pwd, BOOL override)
 {
-       return pwdb_ops->mod_smbpwd_entry(pwdb_smb_map_names(pwd),
override);
+       return (pwd = pwdb_smb_map_names(pwd)) != NULL ?
+               pwdb_ops->mod_smbpwd_entry(pwd, override) :
+               False;
 }
 

/************************************************************************


More information about the samba mailing list