[Bug 507326] Re: alien crashes when trying to convert an RPM containing %ghost files

Martin Pitt martin.pitt at ubuntu.com
Wed Jul 14 06:52:00 BST 2010


SRU ack, please upload. I subscribed the sponsor team.

** Also affects: alien (Ubuntu Lucid)
   Importance: Undecided
       Status: New

-- 
alien crashes when trying to convert an RPM containing %ghost files
https://bugs.launchpad.net/bugs/507326
You received this bug notification because you are a member of Ubuntu
Sponsors Team, which is a direct subscriber.

Status in “alien” package in Ubuntu: Fix Released
Status in “alien” source package in Lucid: New

Bug description:
Binary package hint: alien

When trying to convert any RPM that contains one or more files marked (in the RPM specfile) with %ghost, alien fails with a message similar to
chown: cannot access 'foo/bar': No such file or directory
failed chowning bar to 0:0: Illegal seek at /usr/share/perl5/Alien/Package/Rpm.pm line 265, <GETPERMS> line 1.

where 'foo' is the name of the RPM package and 'bar' the pathname of the first file marked with %ghost. (I would expect instead that alien would complete with no errors, and generate a .deb file corresponding to the input .rpm.)

This occurs in:
Ubuntu release: 9.10 (32-bit, although I expect the problem to occur on all archs)
Package version: alien 8.78

To demonstrate, build a test RPM using the attached spec file, ghost.spec. (rpmbuild -ba ghost.spec; generates ghost-1.0-1.noarch.rpm). This RPM contains two files - a "real" file /etc/real and a "ghost" file /etc/ghost.

Next, attempt to convert to .deb with
$ fakeroot alien ghost-1.0-1.noarch.rpm

This fails with
chown: cannot access 'ghost-1.0//etc/ghost': No such file or directory
failed chowning /etc/ghost to 0:0: Illegal seek at /usr/share/perl5/Alien/Package/Rpm.pm line 265, <GETPERMS> line 1.

The failure occurs because alien, after unpacking the cpio archive containing the actual file contents, attempts to set the permissions and ownership on each file using information in the RPM header. %ghost files are not installed by RPM, so are in the RPM header but not the cpio archive, and so any attempt to chown/chmod these files will fail.

The attached patch (alien-ghost.patch) modifies Rpm.pm to check each file for existence before chown/chmod, and resolves the issue for me.





More information about the Ubuntu-sponsors mailing list