Bug #5433
at(1) doesn't properly handle being invoked from a path containing spaces
Status:
Closed
Priority:
Low
Assignee:
-
Category:
cmd - userland programs
Start date:
2014-12-12
Due date:
% Done:
100%
Estimated time:
Difficulty:
Bite-size
Tags:
needs-triage
Gerrit CR:
Description
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
Files
Updated by Mohamed Khalfella over 5 years ago
- File 5433_session_log_01.txt 5433_session_log_01.txt added
session log after escaping the home directory and the environment variables.
Updated by Electric Monk over 5 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
git commit a725189c0accbf47b39f735d1f32a7b54ae91c6d
commit a725189c0accbf47b39f735d1f32a7b54ae91c6d Author: Mohamed A. Khalfella <khalfella@gmail.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 <gary_mills@fastmail.fm> Approved by: Dan McDonald <danmcd@omniti.com>