diff options
| -rw-r--r-- | meta/classes-recipe/rootfs-postcommands.bbclass | 4 | ||||
| -rw-r--r-- | meta/classes/useradd_base.bbclass | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/meta/classes-recipe/rootfs-postcommands.bbclass b/meta/classes-recipe/rootfs-postcommands.bbclass index 06388b72fb..29ee74932a 100644 --- a/meta/classes-recipe/rootfs-postcommands.bbclass +++ b/meta/classes-recipe/rootfs-postcommands.bbclass | |||
| @@ -241,10 +241,10 @@ read_only_rootfs_hook () { | |||
| 241 | # | 241 | # |
| 242 | zap_empty_root_password () { | 242 | zap_empty_root_password () { |
| 243 | if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then | 243 | if [ -e ${IMAGE_ROOTFS}/etc/shadow ]; then |
| 244 | sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow | 244 | sed --follow-symlinks -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/shadow |
| 245 | fi | 245 | fi |
| 246 | if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then | 246 | if [ -e ${IMAGE_ROOTFS}/etc/passwd ]; then |
| 247 | sed -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd | 247 | sed --follow-symlinks -i 's%^root::%root:*:%' ${IMAGE_ROOTFS}/etc/passwd |
| 248 | fi | 248 | fi |
| 249 | } | 249 | } |
| 250 | 250 | ||
diff --git a/meta/classes/useradd_base.bbclass b/meta/classes/useradd_base.bbclass index 863cb7b76c..f1a7a9695d 100644 --- a/meta/classes/useradd_base.bbclass +++ b/meta/classes/useradd_base.bbclass | |||
| @@ -160,7 +160,7 @@ perform_passwd_expire () { | |||
| 160 | local username=`echo "$opts" | awk '{ print $NF }'` | 160 | local username=`echo "$opts" | awk '{ print $NF }'` |
| 161 | local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`" | 161 | local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`" |
| 162 | if test "x$user_exists" != "x"; then | 162 | if test "x$user_exists" != "x"; then |
| 163 | eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO sed -i \''s/^\('$username':[^:]*\):[^:]*:/\1:0:/'\' $rootdir/etc/shadow \" || true | 163 | eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO sed -follow-symlinks -i \''s/^\('$username':[^:]*\):[^:]*:/\1:0:/'\' $rootdir/etc/shadow \" || true |
| 164 | local passwd_lastchanged="`grep "^$username:" $rootdir/etc/shadow | cut -d: -f3`" | 164 | local passwd_lastchanged="`grep "^$username:" $rootdir/etc/shadow | cut -d: -f3`" |
| 165 | if test "x$passwd_lastchanged" != "x0"; then | 165 | if test "x$passwd_lastchanged" != "x0"; then |
| 166 | bbfatal "${PN}: passwd --expire operation did not succeed." | 166 | bbfatal "${PN}: passwd --expire operation did not succeed." |
