Bug 57108 - Trailing whitespace in rpmrc file not stripped
Trailing whitespace in rpmrc file not stripped
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jeff Johnson
Depends On:
  Show dependency treegraph
Reported: 2001-12-04 18:27 EST by dharris
Modified: 2008-05-01 11:38 EDT (History)
0 users

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

Attachments (Terms of Use)

  None (edit)
Description dharris 2001-12-04 18:27:56 EST
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 10:57:54 EST
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.