Avoid -u option to id since solaris doesn't support it.
authorWayne Davison <wayned@samba.org>
Mon, 14 Dec 2009 02:15:09 +0000 (18:15 -0800)
committerWayne Davison <wayned@samba.org>
Mon, 14 Dec 2009 03:35:01 +0000 (19:35 -0800)
testsuite/chown.test
testsuite/daemon.test
testsuite/devices.test
testsuite/rsync.fns

index d2908d7a6fce069687e1ac2ecb81f424a717d13d..e081d871d4a1e34dc537dca3bf787c6fc0153b11 100644 (file)
@@ -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
index 8d224bb96132aecb027fd128b7b753d77aa34471..7b7038a1bdb39b054f108da1fcc1291fb3d1597e 100644 (file)
@@ -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"
index 23a8e5b9865aed33b02256c20bf28c993f007927..1e7b776257ed8c74d48af2c00cca393875956c5c 100644 (file)
@@ -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
index e17fe5ac546dffcb7274456804db65c7d731ec67..412ea3be85d84418565e1885df4fa6cb0c3d1503 100644 (file)
@@ -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