mirror of
https://github.com/xcat2/confluent.git
synced 2026-08-05 10:17:51 +00:00
271e3b4d93
The rsync push carried no preservation flags, so files arrived with their special permission bits explicitly disabled and a setuid/setgid entry could only be honored by the permissions= chmod on the client side. Preservation was turned on once before ine52a9ff70f("Have syncfiles attempt to preserve more") and rolled back the same day inc0287e93ed("Roll back rsync ownership"), because rsync also applied the staging copy's attributes to the parent directories it merely traversed on the way to the synced files, clobbering the permissions of system directories such as /etc. Naming every staged file explicitly through --files-from and adding --no-implied-dirs confines preservation to the content actually being synchronized, leaving traversed directories alone and creating missing ones with default attributes. Two details follow from the way the staging tree is built. Files are staged as symlinks, so rsync reads their attributes through to the real file, but directories are staged as directories and need the source attributes copied onto them for the otherwise empty ones that have to be named explicitly. Ownership is mapped from the account the daemon runs as to root, since that account generally does not exist on the node and would otherwise arrive as a meaningless numeric id. --xattrs from that earlier attempt is deliberately left out: with --copy-links rsync reads xattrs off the symlink rather than its referent, so it transfers nothing here while adding a failure mode on hosts without xattr support.