]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dsdb:audit_log: avoid printing "... remote host [Unknown] SID [(NULL SID)] ..."
authorStefan Metzmacher <metze@samba.org>
Fri, 26 Apr 2019 14:31:46 +0000 (14:31 +0000)
committerKarolin Seeger <kseeger@samba.org>
Fri, 21 Jun 2019 07:56:17 +0000 (07:56 +0000)
We better print "... remote host [Unknown] SID [S-1-5-18] ..."
in 'dsdb_audit' message, this matches what we print for
'dsdb_json_audit'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13916

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit 706aba5bf62e674ae12786f6ab275752b8714464)

source4/dsdb/samdb/ldb_modules/audit_log.c

index 16acf1461946bb80da62922ba4f8e33196e91596..cfa066820022a875b1103ac428977e5143505d64 100644 (file)
@@ -884,6 +884,7 @@ static char *operation_human_readable(
 {
        struct ldb_context *ldb = NULL;
        const char *remote_host = NULL;
+       const struct tsocket_address *remote = NULL;
        const struct dom_sid *sid = NULL;
        const char *user_sid = NULL;
        const char *timestamp = NULL;
@@ -898,7 +899,8 @@ static char *operation_human_readable(
        ldb = ldb_module_get_ctx(module);
 
        remote_host = dsdb_audit_get_remote_host(ldb, ctx);
-       if (remote_host != NULL && dsdb_audit_is_system_session(module)) {
+       remote = dsdb_audit_get_remote_address(ldb);
+       if (remote != NULL && dsdb_audit_is_system_session(module)) {
                sid = dsdb_audit_get_actual_sid(ldb);
        } else {
                sid = dsdb_audit_get_user_sid(module);