From: Andrew Bartlett Date: Fri, 21 Dec 2018 01:51:54 +0000 (+1300) Subject: group_audit: Ensure we still log membership changes (with an error) where status... X-Git-Tag: tdb-1.3.17~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42dde0bdd3af8aaa6350fec36fb99b98ab501aa1;p=thirdparty%2Fsamba.git group_audit: Ensure we still log membership changes (with an error) where status != LDB_SUCCESS This restores the previous behaviour. It causes (only) the event ID to be omitted if status != LDB_SUCCESS or there was a problem getting the group type. Errors at this stage are exceedingly rare, because the values have already been checked by the repl_meta_data module, but this is cosistent with the rest of the module again. Signed-off-by: Andrew Bartlett Reviewed-by: Douglas Bagnall Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Sat Dec 22 01:58:48 CET 2018 on sn-devel-144 --- diff --git a/source4/dsdb/samdb/ldb_modules/group_audit.c b/source4/dsdb/samdb/ldb_modules/group_audit.c index 9aba865ccd6..4356046f675 100644 --- a/source4/dsdb/samdb/ldb_modules/group_audit.c +++ b/source4/dsdb/samdb/ldb_modules/group_audit.c @@ -994,7 +994,7 @@ static void log_group_membership_changes( TALLOC_CTX *ctx = talloc_new(NULL); struct ldb_message_element *new_val = NULL; int ret; - uint32_t group_type; + uint32_t group_type = 0; const struct ldb_message *msg = dsdb_audit_get_message(acc->request); if (status == LDB_SUCCESS && msg != NULL) { struct ldb_result *res = NULL; @@ -1012,14 +1012,14 @@ static void log_group_membership_changes( new_val = ldb_msg_find_element(res->msgs[0], "member"); group_type = ldb_msg_find_attr_as_uint( res->msgs[0], "groupType", 0); - log_membership_changes(acc->module, - acc->request, - new_val, - acc->members, - group_type, - status); - } + } } + log_membership_changes(acc->module, + acc->request, + new_val, + acc->members, + group_type, + status); TALLOC_FREE(ctx); }