at(1) doesn't properly handle being invoked from a path containing spaces
If you happen to submit an at job from a path that contains one or more spaces, it does not properly quote/escape the path when it writes out the info to /var/spool/cron/atjobs/XXXXXX.a (after expanding the prototype in /etc/cron.d/.proto). E.g.
mkdir "/tmp/dir with spaces"
cd "/tmp/dir with spaces"
echo /bin/true | at now + 5min
If you examine the resulting job, it will contain a line cd /tmp/dir with spaces
which will of course cause 'cd: no such file or directory: /tmp/dir' in the output.
It should just be a matter of escaping the output at usr/src/cmd/cron/at.c:681
Updated by Electric Monk over 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit a725189c0accbf47b39f735d1f32a7b54ae91c6d Author: Mohamed A. Khalfella <email@example.com> Date: 2015-09-17T11:58:16.000Z 5433 at(1) doesn't properly handle being invoked from a path containing spaces Reviewed by: Gary Mills <firstname.lastname@example.org> Approved by: Dan McDonald <email@example.com>