summaryrefslogtreecommitdiffhomepage
path: root/pkg/p9
diff options
context:
space:
mode:
authorKevin Krakauer <krakauer@google.com>2021-03-23 15:40:17 -0700
committergVisor bot <gvisor-bot@google.com>2021-03-23 15:42:12 -0700
commit92374e51976c8a47e4705943f73cecbc6a27073b (patch)
tree5f267314a82b8dbdc4638c8eb1e2c5b062890ca0 /pkg/p9
parentacb4c62885629d6d3ee977b93c27282abed0b33f (diff)
setgid directory support in goferfs
Also adds support for clearing the setuid bit when appropriate (writing, truncating, changing size, changing UID, or changing GID). VFS2 only. PiperOrigin-RevId: 364661835
Diffstat (limited to 'pkg/p9')
-rw-r--r--pkg/p9/p9.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/p9/p9.go b/pkg/p9/p9.go
index 2235f8968..648cf4b49 100644
--- a/pkg/p9/p9.go
+++ b/pkg/p9/p9.go
@@ -151,9 +151,16 @@ const (
// Sticky is a mode bit indicating sticky directories.
Sticky FileMode = 01000
+ // SetGID is the set group ID bit.
+ SetGID FileMode = 02000
+
+ // SetUID is the set user ID bit.
+ SetUID FileMode = 04000
+
// permissionsMask is the mask to apply to FileModes for permissions. It
- // includes rwx bits for user, group and others, and sticky bit.
- permissionsMask FileMode = 01777
+ // includes rwx bits for user, group, and others, as well as the sticky
+ // bit, setuid bit, and setgid bit.
+ permissionsMask FileMode = 07777
)
// QIDType is the most significant byte of the FileMode word, to be used as the