[Rpm-maint] [rpm-software-management/rpm] hardlinked symlinks (#418)

Alexey Tourbin notifications at github.com
Sun Mar 18 01:35:24 UTC 2018


Symlinks can be hardlinked, too, and rpm once willingly created packages with hardlinked symlinks. Such packages were pronounced "broken" and sort of outlawed in `rpm-4.6.0-rc1~93` (5c71ced2da7d99b870a07a83dd8f7e8d1f1b7e4b).

Whether such packages are really broken is a matter of opinion, but even if they are, rpm handles them less than gracefully - it fails with "cpio bad magic" (which means it tries to read the magic number in the wrong place, and can be misdirected).
```
$ sudo rpm -i hardsymlinks-1.0-0.x86_64.rpm
error: unpacking of archive failed: cpio: Bad magic
error: hardsymlinks-1.0-0.x86_64: install failed
```
What's worse, it leaves some of the unpacked files in the filesystem.
```
$ ls -l /usr/share/{a,b,c}
ls: cannot access '/usr/share/c': No such file or directory
-rw-r--r-- 1 root root 4 Mar 18 02:12 /usr/share/a
lrwxrwxrwx 1 root root 1 Mar 18 02:12 /usr/share/b -> a

$ rpm -q hardsymlinks
package hardsymlinks is not installed
```
I understand modern rpm supports transactions of sorts.  I'm now tempted to ask a poignant question: what do you exactly mean by transactions if the package is not installed but its garbage is scattered all over filesystem?  Quite a perfect scandal. :-)
```
Name: hardsymlinks
Version: 1.0
Release: 0
Summary: Contains hardlinked symlinks
License: GPL
Group: System
%description
%install
mkdir -p %buildroot%_datadir
cd %buildroot%_datadir
echo foo >a
ln -s a b
ln b c
%files
%_datadir/*
```


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/418
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20180317/2116967d/attachment.html>


More information about the Rpm-maint mailing list