]> code.ossystems Code Review - openembedded-core.git/commitdiff
meta: Use double colon for chown OWNER:GROUP
authorKosta Zertsekel <zertsekel@gmail.com>
Sun, 4 Nov 2018 19:24:46 +0000 (21:24 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Nov 2018 12:14:24 +0000 (12:14 +0000)
Rationale - excerp from `info chown`
====================================

OWNER‘:’GROUP
     If the OWNER is followed by a colon and a GROUP (a group name or
     numeric group ID), with no spaces between them, the group ownership
     of the files is changed as well (to GROUP).

   Some older scripts may still use ‘.’ in place of the ‘:’ separator.
POSIX 1003.1-2001 (*note Standards conformance::) does not require
support for that, but for backward compatibility GNU ‘chown’ supports
‘.’ so long as no ambiguity results.  New scripts should avoid the use
of ‘.’ because it is not portable, and because it has undesirable
results if the entire OWNER‘.’GROUP happens to identify a user whose
name contains ‘.’.

Signed-off-by: Kosta Zertsekel <zertsekel@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/images/build-appliance-image_15.0.0.bb
meta/recipes-core/initscripts/initscripts-1.0/populate-volatile.sh
meta/recipes-core/sysvinit/sysvinit_2.88dsf.bb

index 6abab60d7fe02a557ef478c0233e2a43262d9003..f03ef969adb92a33474796e25536267c27d683ec 100644 (file)
@@ -79,7 +79,7 @@ fakeroot do_populate_poky_src () {
        echo "# export ALL_PROXY=https://proxy.example.com:8080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
        echo "# export ALL_PROXY=socks://socks.example.com:1080" >> ${IMAGE_ROOTFS}/home/builder/.bashrc
 
-       chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/poky
+       chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/poky
        chmod -R ug+rw ${IMAGE_ROOTFS}/home/builder/poky
 
        # Assume we will need CDROM to install guest additions
@@ -107,8 +107,8 @@ fakeroot do_populate_poky_src () {
           pip3_install_params="${pip3_install_params} --proxy ${http_proxy}"
        fi
        pip3 install ${pip3_install_params}
-       chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.local
-       chown -R builder.builder ${IMAGE_ROOTFS}/home/builder/.cache
+       chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.local
+       chown -R builder:builder ${IMAGE_ROOTFS}/home/builder/.cache
 }
 
 IMAGE_PREPROCESS_COMMAND += "do_populate_poky_src; "
index 824f8f3a6baab50508caaf394b6264fc9a0243b0..6f965a6870635c27bdb1e48a742ca8b1e9808bce 100755 (executable)
@@ -37,7 +37,7 @@ create_file() {
        }
        EXEC="
        ${EXEC}
-       chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+       chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
        chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
 
        test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
@@ -60,7 +60,7 @@ create_file() {
 mk_dir() {
        EXEC="
        mkdir -p \"$1\";
-       chown ${TUSER}.${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
+       chown ${TUSER}:${TGROUP} $1 || echo \"Failed to set owner -${TUSER}- for -$1-.\" >/dev/tty0 2>&1;
        chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 "
 
        test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache.build
index a21e7e46f7345f28ce84f4d4ddde5c271a39d3f6..bfc1283f7387c848da43ed2a4e8f3de1fdce6df6 100644 (file)
@@ -105,6 +105,6 @@ do_install () {
        install -d ${D}${sysconfdir}/default/volatiles
        install -m 0644 ${WORKDIR}/01_bootlogd ${D}${sysconfdir}/default/volatiles
 
-       chown root.shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
+       chown root:shutdown ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
        chmod o-x,u+s ${D}${base_sbindir}/halt ${D}${base_sbindir}/shutdown
 }