From 2eacba9c41238f8e52ed52791b9dda90d5807f45 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Sun, 13 Dec 2009 18:15:09 -0800 Subject: [PATCH] Avoid -u option to id since solaris doesn't support it. --- testsuite/chown.test | 2 +- testsuite/daemon.test | 2 +- testsuite/devices.test | 2 +- testsuite/rsync.fns | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/testsuite/chown.test b/testsuite/chown.test index d2908d7a..e081d871 100644 --- a/testsuite/chown.test +++ b/testsuite/chown.test @@ -37,7 +37,7 @@ case $0 in ;; *) RSYNC="$RSYNC --super" - case `id -u` in + case `get_testuid` in '') ;; # If "id" failed, try to continue... 0) ;; *) if [ -f /usr/bin/fakeroot ]; then diff --git a/testsuite/daemon.test b/testsuite/daemon.test index 8d224bb9..7b7038a1 100644 --- a/testsuite/daemon.test +++ b/testsuite/daemon.test @@ -42,7 +42,7 @@ cd "$scratchdir" ln -s test-rsyncd.conf rsyncd.conf confopt='' -case `id -u` in +case `get_testuid` in 0) # Root needs to specify the config file, or it uses /etc/rsyncd.conf. echo "Forcing --config=$conf" diff --git a/testsuite/devices.test b/testsuite/devices.test index 23a8e5b9..1e7b7762 100644 --- a/testsuite/devices.test +++ b/testsuite/devices.test @@ -51,7 +51,7 @@ case $0 in esac ;; *) - case `id -u` in + case `get_testuid` in '') ;; # If "id" failed, try to continue... 0) ;; *) if [ -f /usr/bin/fakeroot ]; then diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns index e17fe5ac..412ea3be 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -100,6 +100,10 @@ rsync_ls_lR() { find "$@" -print | sort | sed 's/ /\\ /g' | xargs "$TOOLDIR/tls" $TLS_ARGS } +get_testuid() { + id 2>/dev/null | sed 's/^[^0-9]*\([0-9][0-9]*\).*/\1/' +} + check_perms() { perms=`"$TOOLDIR/tls" "$1" | sed 's/^[-d]\(.........\).*/\1/'` if test $perms = $2; then -- 2.47.3