]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
group_audit: Ensure we still log membership changes (with an error) where status...
authorAndrew Bartlett <abartlet@samba.org>
Fri, 21 Dec 2018 01:51:54 +0000 (14:51 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 22 Dec 2018 00:58:48 +0000 (01:58 +0100)
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

source4/dsdb/samdb/ldb_modules/group_audit.c

index 9aba865ccd6ba1ebfe49c9415d563d5ef66de30d..4356046f67514bbb97fc2fdb32a5a3b5bd9ee0a1 100644 (file)
@@ -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);
 }