[Rpm-maint] [rpm-software-management/rpm] rpm install failed:error: unpacking of archive failed on file /usr/sbin/aaa;636c6826: cpio: open failed - No such file or directory (Issue #2273)

xujing notifications at github.com
Thu Nov 10 03:13:26 UTC 2022


1. rpmbuild --with=sbinsymlinks -bb test.spec
```
[root at localhost SPECS]# cat test.spec
%bcond_without sbinsymlinks

Name: test
Version: 1.0
Release: 1
License: MIT
Summary: Test
BuildArch: noarch

%description
Test

%prep

%build

%install
mkdir -p %{buildroot}/usr/sbin/
touch %{buildroot}/usr/sbin/aaa

%if %{with sbinsymlinks}
mkdir %{buildroot}/sbin/
cd %{buildroot}/sbin/
ln -sv ..%{_sbindir}/aaa .
%endif

%post

%files
/usr/sbin/aaa

%if %{with sbinsymlinks}
/sbin/aaa
%endif
```
2. rpm -i /root/rpmbuild/RPMS/noarch/test-1.0-1.noarch.rpm --force

when `sbin -> usr/sbin` soft link exists, according to the preceding steps, the following error information is displayed:
```
[root at localhost SPECS]# rpm -i /root/rpmbuild/RPMS/noarch/test-1.0-1.noarch.rpm --force
error: unpacking of archive failed on file /usr/sbin/aaa;636c693f: cpio: open failed - No such file or directory
error: test-1.0-1.noarch: install failed
```

The problem is caused by the a82251b44ee2d2802ee8aea1b3d89f88beee4bad submission. The cause is that a temporary file /usr/sbin/aaa;xxx is created using openat(), and then the file /sbin/aaa;xxx is created using openat(), openat() failed because the file already exists. Before the a82251b44ee2d2802ee8aea1b3d89f88beee4bad is integrated, the temporary file is renamed and then the next temporary file is generated. Therefore, there's no open same files case.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/2273
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/issues/2273 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20221109/d2c95dba/attachment-0001.html>


More information about the Rpm-maint mailing list