diff options
author | Andrew Bartlett <abartlet@samba.org> | 2018-12-21 14:51:54 +1300 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2018-12-22 01:58:48 +0100 |
commit | 42dde0bdd3af8aaa6350fec36fb99b98ab501aa1 (patch) | |
tree | 80d56cae7d6dcbcbc15ac654b7793d9a3d12cb56 | |
parent | 27273a55dd0634db9324c74a73b80a1989a64372 (diff) | |
download | samba-42dde0bdd3af8aaa6350fec36fb99b98ab501aa1.tar.gz |
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 <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Dec 22 01:58:48 CET 2018 on sn-devel-144
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/group_audit.c | 16 |
1 files changed, 8 insertions, 8 deletions
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); } |