ports/net/samba/patches/patch-auth_auth_log_c

47 lines
1.5 KiB
Text

Avoid printf("%s", NULL);
Index: auth/auth_log.c
--- auth/auth_log.c.orig
+++ auth/auth_log.c
@@ -622,7 +622,8 @@ static void log_authentication_event_human_readable(
ui->netlogon_trust_account.account_name);
nl = talloc_asprintf(frame,
" NETLOGON computer [%s] trust account [%s]",
- trust_computer_name, trust_account_name);
+ trust_computer_name, trust_account_name ?
+ trust_account_name : "(NULL)");
}
remote = tsocket_address_string(ui->remote_host, frame);
@@ -640,8 +641,10 @@ static void log_authentication_event_human_readable(
logon_line = talloc_asprintf(
frame,
" mapped to [%s]\\[%s].",
- log_escape(frame, ui->mapped.domain_name),
- log_escape(frame, ui->mapped.account_name));
+ log_escape(frame, ui->mapped.domain_name ?
+ ui->mapped.domain_name : "(NULL)"),
+ log_escape(frame, ui->mapped.account_name ?
+ ui->mapped.account_name : "(NULL)"));
}
DEBUGC(DBGC_AUTH_AUDIT, debug_level,
@@ -651,13 +654,14 @@ static void log_authentication_event_human_readable(
"%s local host [%s]"
" %s\n",
ui->service_description,
- ui->auth_description,
- log_escape(frame, clientDomain),
+ ui->auth_description ? ui->auth_description : "(NULL)",
+ log_escape(frame, clientDomain ? clientDomain : "(NULL)"),
log_escape(frame, clientAccount),
ts,
- password_type,
+ password_type ? password_type : "(NULL)",
nt_errstr(status),
- log_escape(frame, ui->workstation_name),
+ log_escape(frame, ui->workstation_name ?
+ ui->workstation_name : "(NULL)"),
remote,
logon_line,
local,