]> git.saurik.com Git - apt.git/commitdiff
test: Use :$(id -gn) instead of :root (when run as root)
authorJulian Andres Klode <jak@debian.org>
Thu, 25 Aug 2016 13:35:32 +0000 (15:35 +0200)
committerJulian Andres Klode <jak@debian.org>
Fri, 26 Aug 2016 20:24:24 +0000 (22:24 +0200)
On BSD systems, the root group is wheel, not root, so let's
just use the default group here.

Gbp-Dch: ignore

test/integration/framework
test/integration/test-authentication-basic

index 546f070d706d474a313a79943fd63c06c8a8cd06..c513ed12cceed851bfca78f9644c35d77271c315 100644 (file)
@@ -314,7 +314,7 @@ setupenvironment() {
                # relax permissions so that running as root with user switching works
                umask 022
                chmod 711 "$TMPWORKINGDIRECTORY"
-               chown _apt:root "${TMPWORKINGDIRECTORY}/downloaded"
+               chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/downloaded"
        fi
 
        TESTDIRECTORY="$(readlink -f "$(dirname $0)")"
@@ -442,7 +442,7 @@ EOF
 
        cp "${TESTDIRECTORY}/apt.pem" "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
        if [ "$(id -u)" = '0' ]; then
-               chown _apt:root "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
+               chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem"
        fi
        echo "Acquire::https::CaInfo \"${TMPWORKINGDIRECTORY}/rootdir/etc/webserver.pem\";" > rootdir/etc/apt/apt.conf.d/99https
        echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
@@ -1960,7 +1960,7 @@ mkdir() {
                command mkdir -m 700 -p "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
                touch "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/lock"
                if [ "$(id -u)" = '0' ]; then
-                       chown _apt:root "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
+                       chown _apt:$(id -gn) "${TMPWORKINGDIRECTORY}/rootdir/var/lib/apt/lists/partial"
                fi
        else
                command mkdir "$@"
index 9a15c760429bf1f98ef2e0c44f0f7689677954c8..3bfd076ce1a77478045eab98e8715ff38a1a35ae 100755 (executable)
@@ -30,7 +30,7 @@ testauthsuccess() {
        # lets see if got/retains acceptable permissions
        if [ -n "$AUTHCONF" ]; then
                if [ "$(id -u)" = '0' ]; then
-                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "_apt:root:600"
+                       testfilestats "$AUTHCONF" '%U:%G:%a' '=' "_apt:$(id -gn):600"
                else
                        testfilestats "$AUTHCONF" '%U:%G:%a' '=' "${TEST_DEFAULT_USER}:${TEST_DEFAULT_GROUP}:600"
                fi