mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
sed -i destroys symlinks
If /etc/passwd is a symlink, sed -i on same file will replace the symlink with a new file. Prevent that by adding --follow-symlinks option to sed (From OE-Core rev: 7b4343a30a02d8f8664ac4c4bc09e5acfb4fa60e) Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> (cherry picked from commit 6ec004b2e7b4342465af8e5e6cc66041834821a0) Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
40a11d6e2a
commit
d2d9fd7063
@@ -241,10 +241,10 @@ read_only_rootfs_hook () {
|
||||
#
|
||||
zap_empty_root_password () {
|
||||
if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then
|
||||
sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
|
||||
sed --follow-symlinks -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow
|
||||
fi
|
||||
if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then
|
||||
sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
|
||||
sed --follow-symlinks -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user