From: Jacob Bachmeyer Date: Fri, 10 Dec 2021 22:54:51 +0000 (-0600) Subject: Ensure that upload handler syslog messages do not span lines X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e5da5b01b58189d7b357fd6ae7f93c1c177838f6;p=gatekeeper.git Ensure that upload handler syslog messages do not span lines --- diff --git a/upload-ftp-v1.2.pl b/upload-ftp-v1.2.pl index b59b71f..b423ce1 100755 --- a/upload-ftp-v1.2.pl +++ b/upload-ftp-v1.2.pl @@ -1452,6 +1452,12 @@ sub ftp_die($$) { sub ftp_syslog { my ($priority,$message) = @_; + + # Remove a trailing newline + $message =~ s/[\r\n]+$//; + # Collapse the message to a single line for syslog + $message =~ s/[\r\n]+/ \/ /g; + # The syslog function is pretty picky, and (sometimes) dies silently # when using non-valid syslog priorities. # That's why we run it inside an eval, and print out any errors to STDERR.