Project

General

Profile

Bug #5433

at(1) doesn't properly handle being invoked from a path containing spaces

Added by Jason King over 6 years ago. Updated over 5 years ago.

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

5433_session_log_01.txt (14.7 KB) 5433_session_log_01.txt Mohamed Khalfella, 2015-09-17 12:35 PM

Also available in: Atom PDF