Convenience functions for flag testing

This commit is contained in:
Jakob Borg
2014-05-23 12:53:26 +02:00
parent 7bc36cbbd1
commit b60d648e22
6 changed files with 47 additions and 19 deletions

View File

@@ -109,3 +109,15 @@ func compareClusterConfig(local, remote protocol.ClusterConfigMessage) error {
return nil
}
func permsEqual(a, b uint32) bool {
switch runtime.GOOS {
case "windows":
// There is only writeable and read only, represented for user, group
// and other equally. We only compare against user.
return a&0600 == b&0600
default:
// All bits count
return a&0777 == b&0777
}
}