Bug 4825 - logrotate doesn't quote shell constructs in filenames
logrotate doesn't quote shell constructs in filenames
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: logrotate (Show other bugs)
6.0
All Linux
low Severity medium
: ---
: ---
Assigned To: Preston Brown
: Security
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-09-01 08:40 EDT by carlo
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-09-24 14:25:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description carlo 1999-09-01 08:40:09 EDT
Hiya,

I got the following mail:

From: root <root>
To: carlo@runaway.xs4all.nl
Subject: errors rotating logs

errors occured while rotating /home/carlo/irc/log/*

/home/carlo/irc/log/log.Flanders.Be.Eu.Undernet.org.: No
such file or directory
sh: Neo: command not found
sh: .1: command not found
failed to compress previous log
/home/carlo/irc/log/log.Flanders.Be.Eu.Undernet.org.|Neo|.1

Note that "log.Flanders.Be.Eu.Undernet.org.|Neo|" is a
FILE name. It tries (as root) to execute `Neo'. Surely
some quoting is missing somewhere :)

Greetings,

Carlo Wood
Comment 1 Preston Brown 1999-09-01 09:46:59 EDT
well I would hardly call this "arbitrary commands."  I can't see how a
user would be able to exploit this.  If root is logrotating logs, then
he has control over which directories and files to rotate.  If you are
running it as a user, you do as well.

However, you are correct that it isn't quoting everything (at least
that is how things appear).  I'll look into that.
Comment 2 Preston Brown 1999-09-24 14:25:59 EDT
it will be difficult to change logrotate to not do this.  Please
rename your log file.

Note You need to log in before you can comment on or make changes to this bug.