#715014 spamd sets its cmdline ($0) wrongly by using spaces

Package:
spamassassin
Source:
spamassassin
Submitter:
Wolodja Wentland
Date:
2022-04-18 17:36:04 UTC
Severity:
minor
Tags:
#715014#5
Date:
2013-07-05 13:30:22 UTC
From:
To:
Dear Maintainer,

spamd includes the following snippet (line 2623):

    sub daemonize {
        # Pretty command line in ps
        $0 = join (' ', $ORIG_ARG0, @ORIG_ARGV) unless would_log("dbg");

which incorrectly uses spaces to separate elements in the cmdline which, in
turn, breaks programs that parse /proc/$PID/cmdline and assume that elements
are separated with null bytes (cf. #715000). In particular proc(5) states that:

    /proc/[pid]/cmdline
        The commandline arguments appear in this file as a set of strings
        separated by null bytes ('\0'), with a further null byte after the
        last string.

It also sets $0 to 'spamd child' in line 1114 which would be equally wrong.