[lxc-devel] [PATCH 2/3] Fix version checking typos in Fedora template.

Michael H. Warfield mhw at WittsEnd.com
Thu Dec 19 16:37:24 UTC 2013


Fix version checking typos in Fedora template.

Backported typo fixes from CentOS template back to Fedora Template
Bumped default rev from Fedora 18 to Fedora 19

Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>
---
 templates/lxc-fedora.in | 32 +++++++++++++++++++++++++++++---
 1 file changed, 29 insertions(+), 3 deletions(-)

diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
index 044d2da..5f66ff1 100644
--- a/templates/lxc-fedora.in
+++ b/templates/lxc-fedora.in
@@ -51,7 +51,7 @@ fi
 if [ "${CPE_NAME}" = "" -a -e /etc/system-release-cpe ]
 then
     CPE_NAME=$(head -n1 /etc/system-release-cpe)
-    CPE_URI=$(expr ${CPE_NAME} : '\([^:]*:[^:*]\)')
+    CPE_URI=$(expr ${CPE_NAME} : '\([^:]*:[^:]*\)')
     if [ "${CPE_URI}" != "cpe:/o" ]
     then
         CPE_NAME=
@@ -117,6 +117,32 @@ configure_fedora()
     sed -i '/^session.*pam_loginuid.so/s/^session/# session/' ${rootfs_path}/etc/pam.d/login
     sed -i '/^session.*pam_loginuid.so/s/^session/# session/' ${rootfs_path}/etc/pam.d/sshd
 
+    if [ -f ${rootfs_path}/etc/pam.d/crond ]
+    then
+        sed -i '/^session.*pam_loginuid.so/s/^session/# session/' ${rootfs_path}/etc/pam.d/crond
+    fi
+
+    # In addition to disabling pam_loginuid in the above config files
+    # we'll also disable it by linking it to pam_permit to catch any
+    # we missed or any that get installed after the container is built.
+    #
+    # Catch either or both 32 and 64 bit archs.
+    if [ -f ${rootfs_path}/lib/security/pam_loginuid.so ]
+    then
+        ( cd ${rootfs_path}/lib/security/
+        mv pam_loginuid.so pam_loginuid.so.disabled
+        ln -s pam_permit.so pam_loginuid.so
+        )
+    fi
+
+    if [ -f ${rootfs_path}/lib64/security/pam_loginuid.so ]
+    then
+        ( cd ${rootfs_path}/lib64/security/
+        mv pam_loginuid.so pam_loginuid.so.disabled
+        ln -s pam_permit.so pam_loginuid.so
+        )
+    fi
+
     # configure the network using the dhcp
     cat <<EOF > ${rootfs_path}/etc/sysconfig/network-scripts/ifcfg-eth0
 DEVICE=eth0
@@ -1024,8 +1050,8 @@ if [ -z "$release" ]; then
     if [ "$is_fedora" -a "$fedora_host_ver" ]; then
         release=$fedora_host_ver
     else
-        echo "This is not a fedora host and release missing, defaulting to 18. use -R|--release to specify release"
-        release=18
+        echo "This is not a fedora host and release missing, defaulting to 19. use -R|--release to specify release"
+        release=19
     fi
 fi
 
-- 
1.8.3.1


-- 
Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
   /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
   NIC whois: MHW9          | An optimist believes we live in the best of all
 PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20131219/b9f1195e/attachment.pgp>


More information about the lxc-devel mailing list