Bug 122145 - Logrotate does not allow non-ASCII paths
Logrotate does not allow non-ASCII paths
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
: i18n
Depends On:
  Show dependency treegraph
Reported: 2004-04-30 17:19 EDT by Göran Uddeborg
Modified: 2007-11-30 17:10 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-01-09 05:05:48 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
This patch checks characters using widechar equivalent of isprint (534 bytes, patch)
2007-01-05 20:15 EST, Baris Cicek
no flags Details | Diff
could you test this please (1.62 KB, patch)
2007-01-08 09:50 EST, Peter Vrabec
no flags Details | Diff

  None (edit)
Description Göran Uddeborg 2004-04-30 17:19:49 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
The file config.c contains a little comment:

	/* this is technically too restrictive -- let's see if anyone
	   complains */
	while (*chptr && isprint(*chptr) && *chptr != ' ')

Well, here I am! :-)

The path I want to use is to my home directory.  The characters are
all printable *in my locale*.  But logrotate doesn't do any
setlocale() call, and thus only accepts ASCII.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Create a logrotate configuration file:
   /tmp/apa {
     olddir /tmp/göran
(In case bugzilla mangles it: I used my name for the directory name,
and it has o-diaeresis as its second character.)
2. touch /tmp/apa
3. mkdir /tmp/göran
4. logrotate -s status config

Actual Results:  error: config:2 bad olddir path /tmp/göran

Expected Results:  Rotation of /tmp/apa

Additional info:

The easy part is adding "#include <locale.h>" at the top and
"setlocale(LC_ALL, "")" just at the beginning of main in logrotate.c.
 Then of course the loop in config.c has to be redone to take
multibyte characters into consideration.
Comment 1 John Thacker 2006-10-30 09:44:37 EST
[This is a mass update sent to many bugs that missed earlier such messages due
to having their version set to a test version.]

This bug was originally filed against a version of Fedora Core which is no
longer supported, even for security updates.  Many changes have occured since
then.  Please retest this bug against a still supported version.  Note that FC3
and FC4 are supported by Fedora Legacy for security fixes only.  If
it still occurs on FC5 or FC6, please assign to the correct
version.  Otherwise, if this a security issue, please change the
product to Fedora Legacy.  Thanks, and we are sorry that we did not
get to this bug earlier.

This bug will be closed after a few weeks if no information is given indicating
that the bug is still present in a supported release.
Comment 2 Göran Uddeborg 2006-10-31 07:59:15 EST
This problem still remains in logrotate-3.7.4-7 of FC6.
Comment 3 Baris Cicek 2007-01-05 20:15:25 EST
Created attachment 144952 [details]
This patch checks characters using widechar equivalent of isprint

This patch is checking directory names using iswprint, instead of isprint.
Tested with directories that have widechar in it, and my tests show it works
with FC6.
Comment 4 Peter Vrabec 2007-01-08 09:47:32 EST
(In reply to comment #3)
> Created an attachment (id=144952) [edit]
> This patch checks characters using widechar equivalent of isprint

I'm sorry I don't think this is a proper usage of iswprint()
Comment 5 Peter Vrabec 2007-01-08 09:50:14 EST
Created attachment 145056 [details]
could you test this please
Comment 6 Baris Cicek 2007-01-08 10:18:12 EST
It looks alright. 
Comment 7 Peter Vrabec 2007-01-09 05:05:48 EST
fixed in logrotate-3.7.4-9.fc{6,7}

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