all: Support syncing extended attributes (fixes #2698) (#8513)

This adds support for syncing extended attributes on supported
filesystem on Linux, macOS, FreeBSD and NetBSD. Windows is currently
excluded because the APIs seem onerous and annoying and frankly the uses
cases seem few and far between. On Unixes this also covers ACLs as those
are stored as extended attributes.

Similar to ownership syncing this will optional & opt-in, which two
settings controlling the main behavior: one to "sync" xattrs (read &
write) and another one to "scan" xattrs (only read them so other devices
can "sync" them, but not apply any locally).

Co-authored-by: Tomasz Wilczyński <twilczynski@naver.com>
This commit is contained in:
Jakob Borg
2022-09-14 09:50:55 +02:00
committed by GitHub
co-authored by Tomasz Wilczyński
parent 8065cf7e97
commit 6cac308bcd
37 changed files with 2720 additions and 527 deletions
+22 -1
View File
@@ -55,10 +55,31 @@ message FolderConfiguration {
bool case_sensitive_fs = 33 [(ext.goname) = "CaseSensitiveFS", (ext.xml) = "caseSensitiveFS", (ext.json) = "caseSensitiveFS"];
bool follow_junctions = 34 [(ext.goname) = "JunctionsAsDirs", (ext.xml) = "junctionsAsDirs", (ext.json) = "junctionsAsDirs"];
bool sync_ownership = 35;
bool scan_ownership = 36;
bool send_ownership = 36;
bool sync_xattrs = 37;
bool send_xattrs = 38;
XattrFilter xattr_filter = 39;
// Legacy deprecated
bool read_only = 9000 [deprecated=true, (ext.xml) = "ro,attr,omitempty"];
double min_disk_free_pct = 9001 [deprecated=true];
int32 pullers = 9002 [deprecated=true];
bool scan_ownership = 9003 [deprecated=true];
}
// Extended attribute filter. This is a list of patterns to match (glob
// style), each with an action (permit or deny). First match is used. If the
// filter is empty, all strings are permitted. If the filter is non-empty,
// the default action becomes deny. To counter this, you can use the "*"
// pattern to match all strings at the end of the filter. There are also
// limits on the size of accepted attributes.
message XattrFilter {
repeated XattrFilterEntry entries = 1 [(ext.xml) = "entry"];
int32 max_single_entry_size = 2 [(ext.xml) = "maxSingleEntrySize", (ext.default) = "1024"];
int32 max_total_size = 3 [(ext.xml) = "maxTotalSize", (ext.default) = "4096"];
}
message XattrFilterEntry {
string match = 1 [(ext.xml) = "match,attr"];
bool permit = 2 [(ext.xml) = "permit,attr"];
}