If we're not root and the "fakeroot" command is available, use it
[rsync/rsync.git] / testsuite / chown.test
index 755ffdf..8f3a3e0 100644 (file)
 
 set -x
 
+case `id -u` in
+'') ;; # If "id" failed, try to continue...
+0)  ;;
+*)  if [ -f /usr/bin/fakeroot ]; then
+       exec /usr/bin/fakeroot /bin/sh "$0"
+    fi
+    ;;
+esac
+
 # Build some hardlinks
 
 mkdir "$fromdir"