From 9a52d1a467c9ba601ab85a064bdb3d8732f53efd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Nov 2005 05:19:57 +0000 Subject: r11592: fixed a crash bug from the ldb_result changes (res was being used after being freed) (This used to be commit 5c7f3fef3e2324f0d1edda0f0f06f662bbcf7e08) --- source4/dsdb/samdb/ldb_modules/samldb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index bb69b86e1d..6f98298f6b 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -129,17 +129,15 @@ static struct ldb_dn *samldb_search_domain(struct ldb_module *module, TALLOC_CTX struct ldb_result *res = NULL; int ret = 0; - local_ctx = talloc_named(mem_ctx, 0, "samldb_search_domain memory conext"); + local_ctx = talloc_new(mem_ctx); if (local_ctx == NULL) return NULL; sdn = ldb_dn_copy(local_ctx, dn); do { ret = ldb_search(module->ldb, sdn, LDB_SCOPE_BASE, "objectClass=domain", NULL, &res); - talloc_free(res); - + talloc_steal(local_ctx, res); if (ret == LDB_SUCCESS && res->count == 1) break; - } while ((sdn = ldb_dn_get_parent(local_ctx, sdn))); if (ret != LDB_SUCCESS || res->count != 1) { @@ -451,6 +449,10 @@ static struct ldb_message *samldb_fill_user_or_computer_object(struct ldb_module return NULL; } + /* + useraccountcontrol: setting value 0 gives 0x200 for users + */ + /* TODO: objectCategory, userAccountControl, badPwdCount, codePage, countryCode, badPasswordTime, lastLogoff, lastLogon, pwdLastSet, primaryGroupID, accountExpires, logonCount */ return msg2; -- cgit