mirror of https://github.com/perkeep/perkeep.git
fs: correct the permission bit setting
Replace "executeBit" with "n.attr.Mode & 0100" in "0400 & executeBit". The result is "0400 & n.attr.Mode & 0100" which is always 0. So "n.attr.Mode" is always 0 after the assignment. The last two "&" should be "|" in the assignment. Change-Id: Iaeff864f330b9db07b8a3124b5c28ba1a3469e69
This commit is contained in:
parent
3374899d40
commit
3e4825a1c3
|
@ -276,7 +276,7 @@ func (n *node) populateAttr() error {
|
|||
n.attr.Uid = uint32(os.Getuid())
|
||||
n.attr.Gid = uint32(os.Getgid())
|
||||
executeBit := n.attr.Mode & 0100
|
||||
n.attr.Mode = (n.attr.Mode ^ n.attr.Mode.Perm()) & 0400 & executeBit
|
||||
n.attr.Mode = (n.attr.Mode ^ n.attr.Mode.Perm()) | 0400 | executeBit
|
||||
} else {
|
||||
n.attr.Uid = uint32(meta.MapUid())
|
||||
n.attr.Gid = uint32(meta.MapGid())
|
||||
|
|
Loading…
Reference in New Issue