From 3e4825a1c3fc432096ed84993192bd8a90b17ed4 Mon Sep 17 00:00:00 2001 From: Jingguo Yao Date: Sun, 9 Nov 2014 13:53:23 +0800 Subject: [PATCH] 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 --- pkg/fs/fs.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/fs/fs.go b/pkg/fs/fs.go index 70d27d82e..82453b887 100644 --- a/pkg/fs/fs.go +++ b/pkg/fs/fs.go @@ -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())