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 02:15:09 +0000 (18:15 -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 2d003530510f3aa63fe9dfde5488e32ad30d7442..4fe94b23da136e947fe56b65fdda333f68b2f84c 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 514005507ec66d1905ffb167a660bd5ad5aaf32d..bb73aad39555b7c3ed79c95f62d8948a8d03eb38 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 b58bd0db43922d6a09492dbff1c4a3f08206e65c..649039dc8ddae91766acbeb82fb051e2418cda15 100644 (file)
@@ -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