mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
75dcff0a0e
This adds a folder option "CopyOwnershipFromParent" which, when set, makes Syncthing attempt to retain the owner/group information when syncing files. Specifically, at the finisher stage we look at the parent dir to get owner/group and then attempt a Lchown call on the temp file. For this to succeed Syncthing must be running with the appropriate permissions. On Linux this is CAP_FOWNER, which can be granted by the service manager on startup or set on the binary in the filesystem. Other operating systems do other things, but often it's not required to run as full "root". On Windows this patch does nothing - ownership works differently there and is generally less of a deal, as permissions are inherited as ACLs anyway. There are unit tests on the Lchown functionality, which requires the above permissions to run. There is also a unit test on the folder which uses the fake filesystem and hence does not need special permissions. |
||
---|---|---|
.. | ||
testdata | ||
bytesemaphore_test.go | ||
bytesemaphore.go | ||
debug.go | ||
deviceactivity_test.go | ||
deviceactivity.go | ||
devicedownloadstate_test.go | ||
devicedownloadstate.go | ||
doc.go | ||
folder_recvonly_test.go | ||
folder_recvonly.go | ||
folder_sendonly.go | ||
folder_sendrecv_test.go | ||
folder_sendrecv.go | ||
folder_test.go | ||
folder.go | ||
folderstate.go | ||
model_test.go | ||
model.go | ||
progressemitter_test.go | ||
progressemitter.go | ||
queue_test.go | ||
queue.go | ||
requests_test.go | ||
sentdownloadstate.go | ||
sharedpullerstate_test.go | ||
sharedpullerstate.go | ||
testos_test.go | ||
util.go |