summaryrefslogtreecommitdiff
path: root/testsuite/chown.test
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2005-03-18 02:07:25 +0000
committerWayne Davison <wayned@samba.org>2005-03-18 02:07:25 +0000
commit648859bda2ecf1ed112277b05adc1430c72747c1 (patch)
tree36a189ed941428b1b9f8357a25cb0934e80957cf /testsuite/chown.test
parentf328e0f3a8a1d4726b0d3315838c6a109d579acb (diff)
downloadrsync-648859bda2ecf1ed112277b05adc1430c72747c1.tar.gz
If we're not root and the "fakeroot" command is available, use it
to re-run the script while pretending to be root.
Diffstat (limited to 'testsuite/chown.test')
-rw-r--r--testsuite/chown.test9
1 files changed, 9 insertions, 0 deletions
diff --git a/testsuite/chown.test b/testsuite/chown.test
index 755ffdf8..8f3a3e08 100644
--- a/testsuite/chown.test
+++ b/testsuite/chown.test
@@ -15,6 +15,15 @@
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"