Bug 122145 - Logrotate does not allow non-ASCII paths
Summary: Logrotate does not allow non-ASCII paths
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: 6
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-04-30 21:19 UTC by Göran Uddeborg
Modified: 2007-11-30 22:10 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-01-09 10:05:48 UTC
Type: ---
Embargoed:


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

Description Göran Uddeborg 2004-04-30 21:19:49 UTC
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 != ' ')
	    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):
logrotate-3.7-4.1

How reproducible:
Always

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 14:44:37 UTC
[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 12:59:15 UTC
This problem still remains in logrotate-3.7.4-7 of FC6.

Comment 3 Baris Cicek 2007-01-06 01:15:25 UTC
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 14:47:32 UTC
(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 14:50:14 UTC
Created attachment 145056 [details]
could you test this please

Comment 6 Baris Cicek 2007-01-08 15:18:12 UTC
It looks alright. 

Comment 7 Peter Vrabec 2007-01-09 10:05:48 UTC
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.