svn commit: samba r16227 - in
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules: .
abartlet at samba.org
abartlet at samba.org
Wed Jun 14 16:09:35 GMT 2006
Author: abartlet
Date: 2006-06-14 16:09:34 +0000 (Wed, 14 Jun 2006)
New Revision: 16227
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16227
Log:
Don't segfault if the ldb_search() fails.
Andrew Bartlett
Modified:
branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2006-06-14 16:08:43 UTC (rev 16226)
+++ branches/SAMBA_4_0/source/dsdb/samdb/ldb_modules/samldb.c 2006-06-14 16:09:34 UTC (rev 16227)
@@ -292,7 +292,7 @@
struct ldb_result *res = NULL;
const struct ldb_dn *dom_dn;
int ret;
- struct dom_sid *dom_sid, *obj_sid;
+ struct dom_sid *dom_sid;
/* get the domain component part of the provided dn */
@@ -494,7 +494,10 @@
/* pull the template record */
ret = ldb_search(module->ldb, basedn, LDB_SCOPE_SUBTREE, filter, NULL, &res);
- if (ret != LDB_SUCCESS || res->count != 1) {
+ if (ret != LDB_SUCCESS) {
+ return ret;
+ }
+ if (res->count != 1) {
ldb_set_errstring(module->ldb, talloc_asprintf(module, "samldb_copy_template: ERROR: template '%s' matched %d records, expected 1\n", filter,
res->count));
return LDB_ERR_OPERATIONS_ERROR;
More information about the samba-cvs
mailing list