summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-02-27 21:28:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:10:51 -0500
commit2479b8305b71bc153f808827cd63618af8fe93d8 (patch)
treea4abb3ef4a48f33755475327db353a4b6cb3e293 /source3
parent06e720a66c9f05cd99ef5a7cb8b2018b5cde5ff0 (diff)
downloadsamba-2479b8305b71bc153f808827cd63618af8fe93d8.tar.gz
samba-2479b8305b71bc153f808827cd63618af8fe93d8.tar.xz
samba-2479b8305b71bc153f808827cd63618af8fe93d8.zip
r13729: Fix smbpasswd -x
(This used to be commit 2afcbbfb6f2efcc2e10106b10a87365556013787)
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_tdb.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index b0f8a117886..fdf22d9c428 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -1157,12 +1157,12 @@ static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, struct
uint32 rid;
fstring name;
- /* make sure we have an open handle to the tdb. Should have happened
- at module initialization time */
-
- if ( !tdbsam ) {
- DEBUG(0,("tdbsam_delete_sam_account: tdbsam not open!\n"));
- return NT_STATUS_NO_SUCH_USER;
+ /* open the database */
+
+ if ( !tdbsam_open( tdbsam_filename ) ) {
+ DEBUG(0,("tdbsam_delete_sam_account: failed to open %s!\n",
+ tdbsam_filename));
+ return NT_STATUS_ACCESS_DENIED;
}
fstrcpy(name, pdb_get_username(sam_pass));
@@ -1176,13 +1176,6 @@ static NTSTATUS tdbsam_delete_sam_account(struct pdb_methods *my_methods, struct
rid = pdb_get_user_rid(sam_pass);
- /* open the database */
-
- if ( !tdbsam_open( tdbsam_filename ) ) {
- DEBUG(0,("tdbsam_delete_sam_account: failed to open %s!\n", tdbsam_filename));
- return NT_STATUS_ACCESS_DENIED;
- }
-
/* it's outaa here! 8^) */
if ( tdb_delete(tdbsam, key) != TDB_SUCCESS ) {