]> code.ossystems Code Review - openembedded-core.git/commitdiff
useradd_base: avoid unintended expansion for useradd parameters
authorMaxin B. John <maxin.john@intel.com>
Tue, 16 Aug 2016 11:12:03 +0000 (14:12 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 23 Sep 2016 14:26:09 +0000 (15:26 +0100)
Now, useradd dollar sign requires three prepending backslash characters to
avoid unintended expansion. It used to be just one prepending backslash
character before Krogoth. Restore that behaviour.

[YOCTO #10062]

(From OE-Core rev: 9e43a73c7ad576666d53c8c9e0283bc6bb9087a8)

Signed-off-by: Niko Mauno <niko.mauno@vaisala.com>
Signed-off-by: Maxin B. John <maxin.john@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/useradd_base.bbclass

index 0d81accd1aebbd540d47a1ad718cbfadd3be826e..f4dc7134cb41fec565ee868dd5adc906254f2afb 100644 (file)
@@ -17,7 +17,6 @@ perform_groupadd () {
        local groupname=`echo "$opts" | awk '{ print $NF }'`
        local group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
        if test "x$group_exists" = "x"; then
-               opts=`echo $opts | sed s/\'/\"/g`
                eval flock -x $rootdir${sysconfdir} -c \"$PSEUDO groupadd \$opts\" || true
                group_exists="`grep "^$groupname:" $rootdir/etc/group || true`"
                if test "x$group_exists" = "x"; then
@@ -35,7 +34,6 @@ perform_useradd () {
        local username=`echo "$opts" | awk '{ print $NF }'`
        local user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
        if test "x$user_exists" = "x"; then
-               opts=`echo $opts | sed s/\'/\"/g`
                eval flock -x $rootdir${sysconfdir} -c  \"$PSEUDO useradd \$opts\" || true
                user_exists="`grep "^$username:" $rootdir/etc/passwd || true`"
                if test "x$user_exists" = "x"; then