Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 08 Aug 2020 12:28:15 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 248536] periodic(8) /absolute/path/where/basename/contains-hyphens interpreted as options to mail(1)
Message-ID:  <bug-248536-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D248536

            Bug ID: 248536
           Summary: periodic(8)
                    /absolute/path/where/basename/contains-hyphens
                    interpreted as options to mail(1)
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: danielsh@apache.org

I ran =C2=ABperiodic /usr/local/etc/periodic/one-off=C2=BB from /etc/cronta=
b and got the
following output:

[[[
Subject: Cron <root@zsh> periodic /usr/local/etc/periodic/one-off

mail: illegal option -- o
Usage: mail [-dEiInv] [-s subject] [-c cc-addr] [-b bcc-addr] [-F] to-addr =
...
            [-sendmail-option ...]
       mail [-dEHiInNv] [-F] -f [name]
       mail [-dEHiInNv] [-F] [-u user]
       mail [-d] -e [-f name]
]]]

What happens: The function output_pipe() is called with a first argument of
=C2=AB/usr/local/etc/periodic/one-off=C2=BB, which then runs =C2=ABeval=C2=
=BB on the string
=C2=ABoutput=3D$one-off_output=C2=BB, which sets the variable $output to th=
e value
=C2=AB-off_output=C2=BB (because $one expands to nothing), and that variabl=
e is then used
to build the mail command in $pipe, which works out to =C2=ABmail -E -s '=
=E2=80=A6'
-off_output=C2=BB, which produces the above output.

Reproduced in 11.2R, but by source inspection applies to CURRENT too.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-248536-227>