Bug 11979 - rpm ignores excludepath on some packages
rpm ignores excludepath on some packages
Status: CLOSED DUPLICATE of bug 19666
Product: Red Hat Linux
Classification: Retired
Component: rpm (Show other bugs)
6.2
i386 Linux
medium Severity high
: ---
: ---
Assigned To: Jeff Johnson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-08 09:18 EDT by peter.benie
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-10-04 13:33:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description peter.benie 2000-06-08 09:18:21 EDT
[rpm-3.0.4-0.48]

rpm --excludepath /usr/doc --excludepath /opt -ivh \
         kpackage-1.3.10-3.i386.rpm
will cause rpm to segault in relocateFileList() at line 436 of
rpm-3.0.4/lib/transaction.c:
	len = strlen(relocations[j].newPath);

When excluding a path, rpm adds the exclusion to the list of redirects:
oldPath is set to the excluded path, and newPath is set to NULL.
When installing a package, relocateFileList is called twice: once with
action!=NULL, and once with action==NULL. Line 436 is avoided when
action!=NULL due to the explicit test on lines 424-430:

  if (actions && relocations[j].newPath == NULL) {
    /* On install, a relocate to NULL means skip the path. */
    skipDirList[i] = 1;
    rpmMessage(RPMMESS_DEBUG, _("excluding directory %s\n"), 
      dirNames[i]);
   continue;
  }

When relocateFileList is called with action set to NULL, the above test
fails and the NULL pointer is dereferenced.
Comment 1 peter.benie 2000-06-08 10:23:23 EDT
If you have a package that includes /usr/doc/foo, but not /usr/doc (eg.
make-3.78.1-4.i386.rpm), then rpm ignores --excludepath /usr/doc.

The logic in rpm is a little strange. Again, this is in relocateFileList:

1) Create skipDirlist[], initialised to NULLs.

2) Interate over files, honouring skipDirList[].
   Set skipDirList[i] if the filename in an RPM exactly matches a redirect
and      is an excluded directory. (Never happens for make-3.78.1-4.)

3) Iterate over directories.
   Set skipDirList[i] if the directory is excluded.

4) Throw skipDirList[] away.

The effect is that while the debug messages from (3) say that /usr/doc/foo is
excluded, the information about which directories are excluded is thrown away
before being used.

The comments in relocateFileList() imply that (1) and (2) used to be in the
opposite order, which makes sense for skipDirList().
Comment 2 Vincent 2000-10-04 13:33:02 EDT
I have tried to use the "--excludepath /usr/share/doc" with quite a few RH7's 
packages on a new Redhat 7 system.  The rpm still install the documents in the 
/usr/share/doc directory.  If I use the "--excludepath /usr/doc", the rpm will 
install the documentations in the /usr/doc directory instead of /usr/share/doc 
directory.
Comment 3 Jeff Johnson 2001-01-08 11:04:49 EST
Yup, --excludepath is broke.

*** This bug has been marked as a duplicate of 19666 ***

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