Project

General

Profile

Bug #5433

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

Added by Jason King over 4 years ago. Updated over 3 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

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

History

#1

Updated by Mohamed Khalfella over 3 years ago

session log after escaping the home directory and the environment variables.

#2

Updated by Electric Monk over 3 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>

Also available in: Atom PDF