From 8e7f3107a4cffa09d85c40f9f6e7fe114b8b5861 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 | 6 +++++- 4 files changed, 8 insertions(+), 4 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 2d003530..4fe94b23 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 51400550..bb73aad3 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 b58bd0db..649039dc 100644 --- a/testsuite/rsync.fns +++ b/testsuite/rsync.fns @@ -99,6 +99,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 @@ -258,7 +262,7 @@ build_rsyncd_conf() { uid_setting='uid = 0' gid_setting='gid = 0' - case `id -u` in + case `get_testuid` in 0) ;; *) # Non-root cannot specify uid & gid settings -- 2.34.1