1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

Fix bug #6117 - Samba 3.3.0: pdbedit -a core dumps.

Jeremy.
This commit is contained in:
Jeremy Allison 2009-02-17 13:43:58 -08:00
parent 3737b758d6
commit fab0baeed1

View File

@ -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));