diff options
author | Andrew Bartlett <abartlet@samba.org> | 2001-09-25 14:40:25 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2001-09-25 14:40:25 +0000 |
commit | 00842ae2530a67129c9885e4e9bec914c9743a93 (patch) | |
tree | 705344152a015e625b38643accb97c510393cf2a /source3 | |
parent | cc96a00014ce383e3fad2b4c441d82da4debfbc3 (diff) | |
download | samba-00842ae2530a67129c9885e4e9bec914c9743a93.tar.gz samba-00842ae2530a67129c9885e4e9bec914c9743a93.tar.bz2 samba-00842ae2530a67129c9885e4e9bec914c9743a93.zip |
Don't segfault when deleting accounts not in /etc/passwd. The RID we want is
the one in the sampass anyway.
Andrew Bartlett
(This used to be commit 29b7434293d7778376486b241f9458a71fa843a6)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/pdb_tdb.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c index 66ebb73b1a..cf2a7f2ec1 100644 --- a/source3/passdb/pdb_tdb.c +++ b/source3/passdb/pdb_tdb.c @@ -616,7 +616,6 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid) ****************************************************************************/ BOOL pdb_delete_sam_account(char *sname) { - struct passwd *pwd = NULL; SAM_ACCOUNT *sam_pass = NULL; TDB_CONTEXT *pwd_tdb; TDB_DATA key, data; @@ -669,12 +668,10 @@ BOOL pdb_delete_sam_account(char *sname) } SAFE_FREE(data.dptr); - pwd = sys_getpwnam(sam_pass->username); - + rid = pdb_get_user_rid(sam_pass); + pdb_free_sam (sam_pass); - rid = pdb_uid_to_user_rid (pwd->pw_uid); - /* it's outaa here! 8^) */ if (tdb_delete(pwd_tdb, key) != TDB_SUCCESS) { |