Bug 57108 - Trailing whitespace in rpmrc file not stripped
Summary: Trailing whitespace in rpmrc file not stripped
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: rpm   
(Show other bugs)
Version: 7.2
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jeff Johnson
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2001-12-04 23:27 UTC by dharris
Modified: 2008-05-01 15:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-12-04 23:28:00 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description dharris 2001-12-04 23:27:56 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Description of problem:
When trailing whitespace exists on a line in an rpmrc file, it is not 
stripped before the value is used by other parts of RPM.

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

How reproducible:

Steps to Reproduce:

Here is how I encountered this problem. I had this line (enclosed in 
quotes to show trailing whitespace) in an rpmrc file:

"macrofiles:     /usr/lib/rpm/macros:/usr/lib/rpm/%
{_target}/macros:~/.rpmmacros:/root/build/kernel/rpmmacros "

RPM attempts to open the "/root/build/kernel/rpmmacros " file, which of 
course does not exist. I was able to see RPM attempt to open the file with 
the space on a systrace, shown here:

open("/root/cvs_explore_source/rpmmacros ", O_RDONLY) = -1 ENOENT (No such 
file or directory)

I wanted RPM to attempt to open the "/root/build/kernel/rpmmacros" file.

Actual Results:  RPM attempted to open the 
file "/root/build/kernel/rpmmacros ". (See above description.)

Expected Results:  RPM should have attempted to open the 
file "/root/build/kernel/rpmmacros". (See above description.)

Additional info:

I don't know if whitespace really *should* be stripped from the ends of 
entries in rpmrc files. Since the whitespace between the attribute and the 
colon and the value is stripped, I would expected that trailing whitespace 
should be stripped as well.

I looked in the documentation and was not able to find a definition of how 
an rcfile should act with trailing whitespace.

I did find this, however, which defines that whitespace should be stripped 
for entries in macro files. 

From /usr/share/doc/rpm-4.0.3/macros:

} To define a macro use:
} \verbatim
}         %define <name>[(opts)] <body>
} \endverbatim
} All whitespace surrounding <body> is removed.  Name may be
} composed of alphanumeric characters....

Comment 1 Jeff Johnson 2001-12-05 15:57:54 UTC
The fix -- when attempted -- will be to remove rpmrc configuration

Meanwhile, the workaround is
	Don't do that.

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