Skip to content

Commit

Permalink
fix the operation not permitted error when rsync --daemon is NOT exec…
Browse files Browse the repository at this point in the history
…uted by root for rsync > 3.1 (#3)
fancy-rabbit authored and Axlgrep committed Jun 25, 2018
1 parent 0057f6f commit 94a49a8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions slash/src/rsync.cc
Original file line number Diff line number Diff line change
@@ -31,8 +31,11 @@ int StartRsync(const std::string& raw_path, const std::string& module, const std
log_warn("Open rsync conf file failed!");
return -1;
}
conf_stream << "uid = root" << std::endl;
conf_stream << "gid = root" << std::endl;

if (geteuid() == 0) {
conf_stream << "uid = root" << std::endl;
conf_stream << "gid = root" << std::endl;
}
conf_stream << "use chroot = no" << std::endl;
conf_stream << "max connections = 10" << std::endl;
conf_stream << "lock file = " << rsync_path + kRsyncLockFile << std::endl;

0 comments on commit 94a49a8

Please sign in to comment.