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 d2908d7..e081d87 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 2d00353..4fe94b2 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 5140055..bb73aad 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 b58bd0d..649039d 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