From: Adam Johnston Date: Tue, 21 Nov 2023 19:05:28 +0000 (+0000) Subject: useradd_base: Fix sed command line for passwd-expire X-Git-Tag: yocto-4.3.2~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=67721b71bf677097645b9150a31ac833125c0c23;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git useradd_base: Fix sed command line for passwd-expire A previous commit tried to add the --follow-symlinks option to the perform_passwd_expire function in useradd_base.bbclass, however it used a single -. This is interpreted as --file=ollow-symlinks which results in... sed: couldn't open file ollow-symlinks: No such file or directory and... ERROR: : passwd --expire operation did not succeed. Fix by adding the missing - Signed-off-by: Adam Johnston Signed-off-by: Richard Purdie (cherry picked from commit 3c0deafcfcea3f610c7dd9a2d2884a16fbfe0497) Signed-off-by: Steve Sakoman --- diff --git a/meta/classes/useradd_base.bbclass b/meta/classes/useradd_base.bbclass index f1a7a9695dd..5e1c6991184 100644 --- a/meta/classes/useradd_base.bbclass +++ b/meta/classes/useradd_base.bbclass @@ -160,7 +160,7 @@ perform_passwd_expire () { local username=`echo "$opts" | awk '{ print $NF }'` local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`" if test "x$user_exists" != "x"; then - eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO sed -follow-symlinks -i \''s/^\('$username':[^:]*\):[^:]*:/\1:0:/'\' $rootdir/etc/shadow \" || true + eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO sed --follow-symlinks -i \''s/^\('$username':[^:]*\):[^:]*:/\1:0:/'\' $rootdir/etc/shadow \" || true local passwd_lastchanged="`grep "^$username:" $rootdir/etc/shadow | cut -d: -f3`" if test "x$passwd_lastchanged" != "x0"; then bbfatal "${PN}: passwd --expire operation did not succeed."