summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorWayne Davison <wayned@samba.org>2009-11-12 22:05:45 -0800
committerWayne Davison <wayned@samba.org>2009-11-12 22:05:45 -0800
commitaa381148a3b7fcf0772ea587e3d7969bd637dfcc (patch)
treee95bd8117025f5888e44af53c9a82a0687dd149b /testsuite
parentcece2e3f5e335b8d1bd0862dbc9edbf2d5a4f5dd (diff)
downloadrsync-aa381148a3b7fcf0772ea587e3d7969bd637dfcc.tar.gz
rsync-aa381148a3b7fcf0772ea587e3d7969bd637dfcc.tar.bz2
rsync-aa381148a3b7fcf0772ea587e3d7969bd637dfcc.zip
Fix the daemon test when running it as root.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/rsync.fns15
1 files changed, 13 insertions, 2 deletions
diff --git a/testsuite/rsync.fns b/testsuite/rsync.fns
index 19838776..b58bd0db 100644
--- a/testsuite/rsync.fns
+++ b/testsuite/rsync.fns
@@ -256,6 +256,17 @@ build_rsyncd_conf() {
logfile="$scratchdir/rsyncd.log"
hostname=`uname -n`
+ uid_setting='uid = 0'
+ gid_setting='gid = 0'
+ case `id -u` in
+ 0) ;;
+ *)
+ # Non-root cannot specify uid & gid settings
+ uid_setting="#$uid_setting"
+ gid_setting="#$gid_setting"
+ ;;
+ esac
+
cat >"$conf" <<EOF
# rsyncd configuration file autogenerated by $0
@@ -268,8 +279,8 @@ log format = %i %h [%a] %m (%u) %l %f%L
transfer logging = yes
exclude = ? foobar.baz
max verbosity = 4
-#uid = 0
-#gid = 0
+$uid_setting
+$gid_setting
[test-from]
path = $fromdir