appliance-tools/0001-open-nss-libs-in-the-c...

45 lines
1.2 KiB
Diff

From 39195b686af9ae20f77bd4143a61089c48eab9de Mon Sep 17 00:00:00 2001
From: Kevin Fenzi <kevin@scrye.com>
Date: Thu, 5 Jul 2018 13:15:26 -0700
Subject: [PATCH] open nss libs in the chroot to avoid install_root keeping
them open
Reference: https://bugzilla.redhat.com/show_bug.cgi?id=1591804
---
tools/appliance-creator | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/tools/appliance-creator b/tools/appliance-creator
index 3ec657e..eef1ede 100755
--- a/tools/appliance-creator
+++ b/tools/appliance-creator
@@ -171,8 +171,25 @@ def do_nss_sss_hack():
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())
--
2.17.2