"ldb_dn_validate" is NULL-safe and does the check implicitly.
Reviewed by: Tridge
const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, "objectCategory");
dn = ldb_dn_from_ldb_val(ctx, ldb, val);
const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, "objectCategory");
dn = ldb_dn_from_ldb_val(ctx, ldb, val);
- if (dn && ldb_dn_validate(dn)) {
+ if (ldb_dn_validate(dn)) {
talloc_free(dn);
return val_copy(module, ctx, val);
}
talloc_free(dn);
return val_copy(module, ctx, val);
}
}
ret = ldb_dn_new(mem_ctx, ldb_ctx, str);
}
ret = ldb_dn_new(mem_ctx, ldb_ctx, str);
-
- if (ret == NULL || !ldb_dn_validate(ret)) {
+ if (!ldb_dn_validate(ret)) {
talloc_free(mem_ctx);
PyErr_SetString(PyExc_ValueError, "unable to parse dn string");
return NULL;
talloc_free(mem_ctx);
PyErr_SetString(PyExc_ValueError, "unable to parse dn string");
return NULL;
}
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
}
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
- if (!req_dn ||
- !ldb_dn_validate(req_dn) ||
+ if (!ldb_dn_validate(req_dn) ||
ldb_dn_compare(req_dn, rid_manager_dn) != 0) {
/* that isn't the RID Manager DN */
DEBUG(0,(__location__ ": RID Alloc request for wrong DN %s\n",
ldb_dn_compare(req_dn, rid_manager_dn) != 0) {
/* that isn't the RID Manager DN */
DEBUG(0,(__location__ ": RID Alloc request for wrong DN %s\n",
*/
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
*/
req_dn = drs_ObjectIdentifier_to_dn(mem_ctx, ldb, req10->naming_context);
- if (!req_dn ||
- !ldb_dn_validate(req_dn)) {
+ if (!ldb_dn_validate(req_dn)) {
/* that is not a valid dn */
DEBUG(0,(__location__ ": FSMO role transfer request for invalid DN %s\n",
drs_ObjectIdentifier_to_string(mem_ctx, req10->naming_context)));
/* that is not a valid dn */
DEBUG(0,(__location__ ": FSMO role transfer request for invalid DN %s\n",
drs_ObjectIdentifier_to_string(mem_ctx, req10->naming_context)));