(file *protocol.FileInfo, path string)
| 15 | ) |
| 16 | |
| 17 | func (f *sendReceiveFolder) syncOwnership(file *protocol.FileInfo, path string) error { |
| 18 | if file.Platform.Windows == nil || file.Platform.Windows.OwnerName == "" { |
| 19 | // No owner data, nothing to do |
| 20 | return nil |
| 21 | } |
| 22 | |
| 23 | l.Debugf("Owner name for %s is %s (group=%v)", path, file.Platform.Windows.OwnerName, file.Platform.Windows.OwnerIsGroup) |
| 24 | usid, gsid, err := lookupUserAndGroup(file.Platform.Windows.OwnerName, file.Platform.Windows.OwnerIsGroup) |
| 25 | if err != nil { |
| 26 | return err |
| 27 | } |
| 28 | |
| 29 | l.Debugf("Owner for %s resolved to uid=%q gid=%q", path, usid, gsid) |
| 30 | return f.mtimefs.Lchown(path, usid, gsid) |
| 31 | } |
| 32 | |
| 33 | func lookupUserAndGroup(name string, group bool) (string, string, error) { |
| 34 | // Look up either the the user or the group, returning the other kind as |
nothing calls this directly
no test coverage detected