* [PATCH] rootfs-postcommands.bbclass: Filter out dangling symlinks in ssh_allow_empty_password()
@ 2017-08-09 16:45 Khem Raj
2017-08-14 8:30 ` Richard Purdie
0 siblings, 1 reply; 2+ messages in thread
From: Khem Raj @ 2017-08-09 16:45 UTC (permalink / raw)
To: openembedded-core
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
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
meta/classes/rootfs-postcommands.bbclass | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass
index 78f7c55933..e26aa90d73 100644
--- a/meta/classes/rootfs-postcommands.bbclass
+++ b/meta/classes/rootfs-postcommands.bbclass
@@ -158,7 +158,10 @@ ssh_allow_empty_password () {
fi
if [ -d ${IMAGE_ROOTFS}${sysconfdir}/pam.d ] ; then
- sed -i 's/nullok_secure/nullok/' ${IMAGE_ROOTFS}${sysconfdir}/pam.d/*
+ for f in `find ${IMAGE_ROOTFS}${sysconfdir}/pam.d -type l -exec test -e {} \; -print`
+ do
+ sed -i 's/nullok_secure/nullok/' $f
+ done
fi
}
--
2.14.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-08-14 8:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-09 16:45 [PATCH] rootfs-postcommands.bbclass: Filter out dangling symlinks in ssh_allow_empty_password() Khem Raj
2017-08-14 8:30 ` Richard Purdie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox