From 92374e51976c8a47e4705943f73cecbc6a27073b Mon Sep 17 00:00:00 2001 From: Kevin Krakauer Date: Tue, 23 Mar 2021 15:40:17 -0700 Subject: 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 --- pkg/p9/p9.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'pkg/p9/p9.go') 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 -- cgit v1.2.3