From: Stefan Metzmacher Date: Fri, 26 Apr 2019 14:31:46 +0000 (+0000) Subject: dsdb:audit_log: avoid printing "... remote host [Unknown] SID [(NULL SID)] ..." X-Git-Tag: ldb-2.0.5~614 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=706aba5bf62e674ae12786f6ab275752b8714464;p=thirdparty%2Fsamba.git dsdb:audit_log: avoid printing "... remote host [Unknown] SID [(NULL SID)] ..." 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 Reviewed-by: Ralph Boehme --- diff --git a/source4/dsdb/samdb/ldb_modules/audit_log.c b/source4/dsdb/samdb/ldb_modules/audit_log.c index 931147efc72..ef674950100 100644 --- a/source4/dsdb/samdb/ldb_modules/audit_log.c +++ b/source4/dsdb/samdb/ldb_modules/audit_log.c @@ -928,6 +928,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; struct dom_sid_buf user_sid; const char *timestamp = NULL; @@ -942,7 +943,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);