From 9fd3416452ac82d27dac7b8c16f6ad89f5551f6b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 8 Aug 2007 06:37:37 +0000 Subject: r24277: Tidyup as requested by metze. Andrew Bartlett (This used to be commit 43d62181f204fb32e487b7689729c1a91b8d23ad) --- source4/dsdb/samdb/ldb_modules/objectclass.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'source4/dsdb') diff --git a/source4/dsdb/samdb/ldb_modules/objectclass.c b/source4/dsdb/samdb/ldb_modules/objectclass.c index a9ef93cab1..0d55ef07db 100644 --- a/source4/dsdb/samdb/ldb_modules/objectclass.c +++ b/source4/dsdb/samdb/ldb_modules/objectclass.c @@ -201,16 +201,18 @@ static int objectclass_sort(struct ldb_module *module, return LDB_SUCCESS; } -DATA_BLOB *get_sd(struct ldb_module *module, TALLOC_CTX *mem_ctx, - const struct dsdb_class *objectclass) +static DATA_BLOB *get_sd(struct ldb_module *module, TALLOC_CTX *mem_ctx, + const struct dsdb_class *objectclass) { NTSTATUS status; DATA_BLOB *linear_sd; struct auth_session_info *session_info = ldb_get_opaque(module->ldb, "sessionInfo"); - struct security_descriptor *sd = sddl_decode(mem_ctx, - objectclass->defaultSecurityDescriptor, - samdb_domain_sid(module->ldb)); + struct security_descriptor *sd + = sddl_decode(mem_ctx, + objectclass->defaultSecurityDescriptor, + samdb_domain_sid(module->ldb)); + if (!session_info || !session_info->security_token) { return NULL; } @@ -300,17 +302,21 @@ static int objectclass_add(struct ldb_module *module, struct ldb_request *req) for (current = sorted; current; current = current->next) { ret = ldb_msg_add_string(msg, "objectClass", current->objectclass); if (ret != LDB_SUCCESS) { - ldb_set_errstring(module->ldb, "objectclass: could not re-add sorted objectclass to modify msg"); + ldb_set_errstring(module->ldb, + "objectclass: could not re-add sorted " + "objectclass to modify msg"); talloc_free(mem_ctx); return ret; } /* Last one is the critical one */ if (schema && !current->next) { const struct dsdb_class *objectclass - = dsdb_class_by_lDAPDisplayName(schema, current->objectclass); + = dsdb_class_by_lDAPDisplayName(schema, + current->objectclass); if (objectclass) { if (!ldb_msg_find_element(msg, "objectCategory")) { - ldb_msg_add_string(msg, "objectCategory", objectclass->defaultObjectCategory); + ldb_msg_add_string(msg, "objectCategory", + objectclass->defaultObjectCategory); } if (!ldb_msg_find_element(msg, "ntSecurityDescriptor")) { DATA_BLOB *sd = get_sd(module, mem_ctx, objectclass); -- cgit