diff options
author | Khem Raj <raj.khem@gmail.com> | 2017-08-16 22:43:17 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-08-18 23:46:38 +0100 |
commit | ad140e7788d4cdcb740701850b90c617c76f23d4 (patch) | |
tree | c15544e85f3cd277d0c906b119d8eea038b67249 | |
parent | 163d2a34c776bd3709b4622984cddd9582bf2678 (diff) | |
download | poky-ad140e7788d4cdcb740701850b90c617c76f23d4.tar.gz |
rootfs-postcommands.bbclass: Filter out dangling symlinks in ssh_allow_empty_password()
In images built with pam in DISTRO_FEATURES, we end up with dangling symlinks
if su is not packaged into image
$ ls /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/su-l -l
lrwxrwxrwx 1 kraj users 2 Aug 9 07:56 /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/su-l -> su
This causes image do_rootfs to fail
| sed: can't read /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/rootfs/etc/pam.d/s
u-l: No such file or directory
| WARNING: /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi/core-image-minimal/1.0-r0/temp/run.ssh_allow_empty_
password.19238:1 exit 2 from 'sed -i 's/nullok_secure/nullok/' /mnt/a/oe/build/tmp/work/raspberrypi3-bec-linux-gnueabi
/core-image-minimal/1.0-r0/rootfs/etc/pam.d/*'
Therefore we need to filter out dangling symlinks before sed'ing
things out
(From OE-Core rev: b92105e5a085c8cd3c650579644922ed97163e73)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index c92df7b0de..e7999d448a 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
@@ -158,7 +158,10 @@ ssh_allow_empty_password () { | |||
158 | fi | 158 | fi |
159 | 159 | ||
160 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then | 160 | if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then |
161 | sed -i 's/nullok_secure/nullok/' ${IMAGE_ROOTFS}${sysconfdir}/pam.d/* | 161 | for f in `find ${IMAGE_ROOTFS}${sysconfdir}/pam.d/* -type f -exec test -e {} \; -print` |
162 | do | ||
163 | sed -i 's/nullok_secure/nullok/' $f | ||
164 | done | ||
162 | fi | 165 | fi |
163 | } | 166 | } |
164 | 167 | ||