Package: cron
Version: 3.0pl1-162
Severity: normal

Dear Maintainer,

A new line in root's crontab led to this error mail:
        /bin/sh: 1: Syntax error: Unterminated quoted string

It took a while to find the cause because the string was not reported in the 
mail (-> wishlist).
It is because of this line
        34 2 * * * /usr/local/scripts/fsdu /var > /tmp/fsdu.$(/bin/date 
"+%Y%m%d-%H%M%S")
The % is an escape character that is replaced with \n by cron. We weren't aware 
of this,

The crontab(5) manpage has an explanation of this and an example for the use as 
a newline:
        0 22 * * 1-5   mail -s "It's 10pm" joe%Joe,%%Where are your kids?%
An example for the escaped % is missing. Digging deeper, we found this in 
/usr/share/man/man5/crontab.5.gz:
        33 22 * * *     expr $(date +\%s) / 60 / 60 / 24 \% 9 > /dev/null || 
echo Wax the floor.
The backslashes are eaten by *roff rendering. Replacing them with double 
backslashes yields this:
        33 22 * * *     expr $(date +\%s) / 60 / 60 / 24 \% 9 > /dev/null || 
echo Wax the floor.

I'm submitting this as severity normal because it took us a significant amount 
of time to analyze and work around.

-- Package-specific info:
--- EDITOR:


--- /usr/bin/editor:
/usr/bin/vim.tiny

--- /usr/bin/crontab:
-rwxr-sr-x 1 root crontab 43648 Mar  2  2023 /usr/bin/crontab

--- /var/spool/cron:
drwxr-xr-x 5 root root 1024 Mar 16  2021 /var/spool/cron

--- /var/spool/cron/crontabs:
drwx-wx--T 2 root crontab 1024 Apr  2 08:43 /var/spool/cron/crontabs

--- /etc/cron.d:
drwxr-xr-x 2 root root 4096 Mar 10 07:41 /etc/cron.d

--- /etc/cron.daily:
drwxr-xr-x 2 root root 4096 Dec 28 07:42 /etc/cron.daily

--- /etc/cron.hourly:
drwxr-xr-x 2 root root 4096 Dec 26 12:48 /etc/cron.hourly

--- /etc/cron.monthly:
drwxr-xr-x 2 root root 4096 Dec 26 12:50 /etc/cron.monthly

--- /etc/cron.weekly:
drwxr-xr-x 2 root root 4096 Dec 26 12:50 /etc/cron.weekly


-- System Information:
Debian Release: 12.10
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-32-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages cron depends on:
ii  cron-daemon-common   3.0pl1-162
ii  init-system-helpers  1.65.2
ii  libc6                2.36-9+deb12u10
ii  libpam-runtime       1.5.2-6+deb12u1
ii  libpam0g             1.5.2-6+deb12u1
ii  libselinux1          3.4-1+b6
ii  sensible-utils       0.0.17+nmu1

Versions of packages cron recommends:
ii  sendmail-bin [mail-transport-agent]  8.17.1.9-2+deb12u2

Versions of packages cron suggests:
pn  anacron        <none>
pn  checksecurity  <none>
ii  logrotate      3.21.0-1

Versions of packages cron is related to:
pn  libnss-ldap   <none>
pn  libnss-ldapd  <none>
pn  libpam-ldap   <none>
pn  libpam-mount  <none>
pn  nis           <none>
pn  nscd          <none>

-- debconf-show failed

Reply via email to