Add a patch to open nss libs in the chroot to avoid install_root keeping them open.

See https://bugzilla.redhat.com/show_bug.cgi?id=1591804
This commit is contained in:
Kevin Fenzi 2018-07-05 13:15:26 -07:00
parent 973d7dc325
commit 07b1928ed8
2 changed files with 35 additions and 1 deletions

View File

@ -1,7 +1,7 @@
Name: appliance-tools
Summary: Tools for building Appliances
Version: 008.0
Release: 8%{?dist}
Release: 9%{?dist}
License: GPLv2
Group: System Environment/Base
URL: https://pagure.io/appliance-tools
@ -13,6 +13,7 @@ Patch0: 0001-Set-releasever.patch
Patch1: 0002-Make-it-possible-to-disable-compression.patch
Patch3: 0001-Use-block-size-with-xz-to-make-seekable-xz-compresse.patch
Patch4: 0001-Remove-usage-of-kickstart.get_modules-rhbz-1544075.patch
Patch5: lookup-fake-user-for-nss.patch
# Ensure system deps are installed (rhbz#1409536)
Requires: python2-imgcreate >= 1:25.0-2
@ -57,6 +58,10 @@ rm -fv %{buildroot}%{_pkgdocdir}/COPYING
%{python2_sitelib}/ec2convert/*
%changelog
* Thu Jul 05 2018 Kevin Fenzi <kevin@scrye.com> - 008.0-9
- Add a patch to open nss libs in the chroot to avoid install_root keeping them open.
- See https://bugzilla.redhat.com/show_bug.cgi?id=1591804
* Sat Feb 10 2018 Neal Gompa <ngompa13@gmail.com> - 008.0-8
- Fix compatibility with pykickstart 3.9+ (#1544075)
- Bump requires of livecd-tools to minimum version with pykickstart 3.9+ compatibility

View File

@ -0,0 +1,29 @@
diff -Nur appliance-tools-008.0.orig/tools/appliance-creator appliance-tools-008.0/tools/appliance-creator
--- appliance-tools-008.0.orig/tools/appliance-creator 2018-07-05 13:09:19.391655392 -0700
+++ appliance-tools-008.0/tools/appliance-creator 2018-07-05 13:12:11.185416692 -0700
@@ -168,8 +168,25 @@
del forgettable
return hack
+#
+# https://bugzilla.redhat.com/show_bug.cgi?id=1591804
+# Try and look up a unknown user in the chroot so it
+# Opens and uses all the nss libraries in the chroot
+# Instead of doing so in the install root which might
+# Keep the libraries open and fail the build.
+#
+def do_unknown_user_hack():
+ import pwd as forgettable
+ try:
+ forgettable.getpwnam('fwefwkejkgre')
+ except:
+ pass
+ del forgettable
+ return
+
if __name__ == "__main__":
hack = do_nss_sss_hack()
+ do_unknown_user_hack()
sys.exit(main())