When posix access ACL is set, it can have an effect on file mode and it can also need to clear SGID if. - None of caller's group/supplementary groups match file owner group. AND - Caller is not priviliged (No CAP_FSETID). As of now fuser server is responsible for changing the file mode as well. But it does not know whether to clear SGID or not. So add a flag FUSE_SETXATTR_ACL_KILL_SGID and send this info with SETXATTR to let file server know that sgid needs to be cleared as well.
Showing the changes to include/uapi (1 of 2 files). Show all
Unified · Split
| @@ -180,6 +180,7 @@ · 179 unmodified lines | ||
| 180 | 180 | * - add FUSE_HANDLE_KILLPRIV_V2, FUSE_WRITE_KILL_SUIDGID, FATTR_KILL_SUIDGID |
| 181 | 181 | * - add FUSE_OPEN_KILL_SUIDGID |
| 182 | 182 | * - extend fuse_setxattr_in, add FUSE_SETXATTR_EXT |
| 183 | + * - add FUSE_SETXATTR_ACL_KILL_SGID | |
| 183 | 184 | */ |
| 184 | 185 | |
| 185 | 186 | #ifndef _LINUX_FUSE_H |
| @@ -454,6 +455,12 @@ struct fuse_file_lock { · 268 unmodified lines | ||
| 454 | 455 | */ |
| 455 | 456 | #define FUSE_OPEN_KILL_SUIDGID (1 << 0) |
| 456 | 457 | |
| 458 | +/** | |
| 459 | + * setxattr flags | |
| 460 | + * FUSE_SETXATTR_ACL_KILL_SGID: Clear SGID when system.posix_acl_access is set | |
| 461 | + */ | |
| 462 | +#define FUSE_SETXATTR_ACL_KILL_SGID (1 << 0) | |
| 463 | + | |
| 457 | 464 | enum fuse_opcode { |
| 458 | 465 | FUSE_LOOKUP = 1, |
| 459 | 466 | FUSE_FORGET = 2, /* no reply */ |