mirror of
https://github.com/RsyncProject/rsync.git
synced 2026-10-24 06:38:15 -04:00
Fix the daemon test when running it as root.
This commit is contained in:
1 parent
cece2e3f5e
commit
aa381148a3
1 file changed
+13
-2
+13
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user