Bug 1001553 - error reading from file in case if rpm has only one file within
error reading from file in case if rpm has only one file within
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Panu Matilainen
Fedora Extras Quality Assurance
: Upstream
Depends On:
  Show dependency treegraph
Reported: 2013-08-27 05:30 EDT by Artem
Modified: 2013-09-22 20:16 EDT (History)
8 users (show)

See Also:
Fixed In Version: rpm-4.11.1-3.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-09-10 22:05:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
rpm for reproducing the issue (2.49 KB, application/octet-stream)
2013-08-27 06:34 EDT, Artem
no flags Details

  None (edit)
Description Artem 2013-08-27 05:30:27 EDT
Description of problem:
In case if I try to install the rpm which is consists from only one file to the specific directory with doubled slashes in the path, then I'll get the error.
But if I remove the duplicate slash from the prefix path or choose the package with two or more files then no any errors will apear.
Version-Release number of selected component (if applicable):
RPM version

How reproducible: always

Steps to Reproduce:
1. Create the rpm with one file within.
2. Run the rpm install with following command:

[root@nntclxxx rpm]# rpm -i --nodeps --prefix="/opt/aaa//bbb" "intel-mkl-pgi-devel-080-11.1-0.x86_64.rpm"

Actual results: Following error appeared: 
"error: error reading from file intel-mkl-pgi-devel-080-11.1-0.x86_64.rpm"

Expected results: The rpm installed w/o any errors.

Additional info: This bug cannot be reproduced on other OS'es.
Comment 1 Artem 2013-08-27 05:40:26 EDT
The problem can be reproduced not only with prefix with double slash, for example it can be reproooodduced with following command:

rpm -i --nodeps --prefix="/opt/aaa" "intel-mkl-pgi-devel-080-11.1-0.x86_64.rpm"

But the following command installs rpm w/o errors:

rpm -i --nodeps --prefix="/opt/aaa/bbb" "intel-mkl-pgi-devel-080-11.1-0.x86_64.rpm"
Comment 2 Panu Matilainen 2013-08-27 05:47:45 EDT
Can you provide a pointer to the reproducer package?
Comment 3 Artem 2013-08-27 06:34:55 EDT
Created attachment 790884 [details]
rpm for reproducing the issue

The RPM for reproducing the issue was attached.
Comment 4 Panu Matilainen 2013-08-27 07:36:27 EDT
Okay, easily reproduced with that, thanks. The problem starts with this commit (between rpm 4.9.x and 4.10.x):

commit 502d07cf24fda57fdf0998a220b1a1176dadd985
Author: Panu Matilainen <pmatilai@redhat.com>
Date:   Sat Jan 28 17:53:11 2012 +0200

    Test for filename triplet sanity in rpmfiNew()
    - Basename and dirindex counts must be equal, dirnames count must be
      larger than zero and no larger than number of basenames. Check
      that directory indexes are within range.
    - There are mountains of further checks to be added here (and elsewhere)
      but we gotta start somewhere... and filename triplets are one of the more
      critical elements we got.

In other words, its tripping up on this new sanity check when relocating, which suggests a bug in the relocation code. By the look of things, the relocation bug is old as ages but as its mostly harmless in that it just leaves an "orphan"  (ie unused) directory name in the header nobody has noticed it prior to the sanity check.
Comment 6 Michael Stahl 2013-09-02 06:44:00 EDT
ran into this problem too, i've even tracked it down to the indexSane function some weeks ago but then totally forgot about the problem :(

this is why one can't install LibreOffice upstream RPM releases 
on Fedora 19 with the user-install script, which uses rpm --relocate;
the (first) failure is on the libreoffice4.0-base RPM which contains
a single file.

with the commit from comment #5 it works again, thanks!
Comment 7 Fedora Update System 2013-09-09 08:42:30 EDT
rpm-4.11.1-7.fc20 has been submitted as an update for Fedora 20.
Comment 8 Fedora Update System 2013-09-09 08:44:33 EDT
rpm-4.11.1-2.fc19 has been submitted as an update for Fedora 19.
Comment 9 Fedora Update System 2013-09-09 19:58:48 EDT
Package rpm-4.11.1-3.fc19:
* should fix your issue,
* was pushed to the Fedora 19 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing rpm-4.11.1-3.fc19'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).
Comment 10 Fedora Update System 2013-09-10 22:05:55 EDT
rpm-4.11.1-3.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.
Comment 11 Fedora Update System 2013-09-22 20:16:15 EDT
rpm-4.11.1-7.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

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