summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-02-17 13:43:58 -0800
committerJeremy Allison <jra@samba.org>2009-02-17 13:43:58 -0800
commitfab0baeed143464a152375c721c391d975e9b061 (patch)
treeaf05ca9b44f69573a724b922b2cc29fa9956359c /source3
parent3737b758d63dfae13b8aa537210663cf4c5effe8 (diff)
downloadsamba-fab0baeed143464a152375c721c391d975e9b061.tar.gz
samba-fab0baeed143464a152375c721c391d975e9b061.tar.bz2
samba-fab0baeed143464a152375c721c391d975e9b061.zip
Fix bug #6117 - Samba 3.3.0: pdbedit -a core dumps.
Jeremy.
Diffstat (limited to 'source3')
-rw-r--r--source3/passdb/pdb_tdb.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source3/passdb/pdb_tdb.c b/source3/passdb/pdb_tdb.c
index eab91100fd..143a2e2390 100644
--- a/source3/passdb/pdb_tdb.c
+++ b/source3/passdb/pdb_tdb.c
@@ -357,7 +357,7 @@ static NTSTATUS tdbsam_getsampwrid (struct pdb_methods *my_methods,
/* open the database */
if ( !tdbsam_open( tdbsam_filename ) ) {
- DEBUG(0,("tdbsam_getsampwnam: failed to open %s!\n", tdbsam_filename));
+ DEBUG(0,("tdbsam_getsampwrid: failed to open %s!\n", tdbsam_filename));
return NT_STATUS_ACCESS_DENIED;
}
@@ -400,6 +400,11 @@ static bool tdb_delete_samacct_only( struct samu *sam_pass )
slprintf(keystr, sizeof(keystr)-1, "%s%s", USERPREFIX, name);
/* it's outaa here! 8^) */
+ if ( !tdbsam_open( tdbsam_filename ) ) {
+ DEBUG(0,("tdb_delete_samacct_only: failed to open %s!\n",
+ tdbsam_filename));
+ return false;
+ }
status = dbwrap_delete_bystring(db_sam, keystr);
if (!NT_STATUS_IS_OK(status)) {
@@ -777,6 +782,12 @@ static bool tdbsam_new_rid(struct pdb_methods *methods, uint32 *prid)
rid = BASE_RID; /* Default if not set */
+ if (!tdbsam_open(tdbsam_filename)) {
+ DEBUG(0,("tdbsam_new_rid: failed to open %s!\n",
+ tdbsam_filename));
+ return false;
+ }
+
if (dbwrap_change_uint32_atomic(db_sam, NEXT_RID_STRING, &rid, 1) != 0) {
DEBUG(3, ("tdbsam_new_rid: Failed to increase %s\n",
NEXT_RID_STRING));