Filesystem has a dependency on /bin/sh (rhbz#1306489)

Fix wrong usage of posix.exec() and replace it with rpm.execute():

https://bugzilla.redhat.com/show_bug.cgi?id=1306489#c20
This commit is contained in:
Martin Osvald 2022-08-09 15:22:29 +02:00
parent 47d37ac941
commit 50fad43210

View File

@ -1,7 +1,7 @@
Summary: The basic directory layout for a Linux system Summary: The basic directory layout for a Linux system
Name: filesystem Name: filesystem
Version: 3.18 Version: 3.18
Release: 1%{?dist} Release: 2%{?dist}
License: Public Domain License: Public Domain
URL: https://pagure.io/filesystem URL: https://pagure.io/filesystem
Source1: https://pagure.io/filesystem/raw/master/f/lang-exceptions Source1: https://pagure.io/filesystem/raw/master/f/lang-exceptions
@ -170,20 +170,8 @@ return 0
%posttrans -p <lua> %posttrans -p <lua>
--# we need to restorecon on some dirs created in %pretrans or by other packages --# we need to restorecon on some dirs created in %pretrans or by other packages
if posix.access ("/usr/sbin/restorecon", "x") then if posix.access ("/usr/sbin/restorecon", "x") then
local pid = posix.fork() rpm.execute("/usr/sbin/restorecon", "/var", "/var/run", "/var/lock", "/sys", "/boot", "/dev", "/media", "/afs")
if pid == 0 then rpm.execute("/usr/sbin/restorecon", "-r", "/usr/lib/debug")
posix.exec("/usr/sbin/restorecon", "/var")
posix.exec("/usr/sbin/restorecon", "/var/run")
posix.exec("/usr/sbin/restorecon", "/var/lock")
posix.exec("/usr/sbin/restorecon", "-r", "/usr/lib/debug/")
posix.exec("/usr/sbin/restorecon", "/sys")
posix.exec("/usr/sbin/restorecon", "/boot")
posix.exec("/usr/sbin/restorecon", "/dev")
posix.exec("/usr/sbin/restorecon", "/media")
posix.exec("/usr/sbin/restorecon", "/afs")
elseif pid > 0 then
posix.wait(pid)
end
end end
%files content %files content
@ -322,6 +310,9 @@ end
/var/yp /var/yp
%changelog %changelog
* Tue Aug 09 2022 Martin Osvald <mosvald@redhat.com> - 3.18-2
- Filesystem has a dependency on /bin/sh (rhbz#1306489)
* Tue Jul 26 2022 Martin Osvald <mosvald@redhat.com> - 3.18-1 * Tue Jul 26 2022 Martin Osvald <mosvald@redhat.com> - 3.18-1
- Filesystem has a dependency on /bin/sh (#1306489) - Filesystem has a dependency on /bin/sh (#1306489)
- Add /usr/share/X11/fonts/ to default filesystem (#2107447) - Add /usr/share/X11/fonts/ to default filesystem (#2107447)