History

fuse: optional supplementary group in create requests

Permission to create an object (create, mkdir, symlink, mknod) needs to take supplementary groups into account. Add a supplementary group request extension. This can contain an arbitrary number of group IDs and can be added to any request. This extension is not added to any request by default. Add FUSE_CREATE_SUPP_GROUP init flag to enable supplementary group info in creation requests. This adds just a single supplementary group that matches the parent group in the case described above. In other cases the extension is not added.

Miklos Szeredi committed 4 years ago

Commit 8ed7cb31 parent 15d937d4 files · +84 −4Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/fuse.h+17−0
@@ -204,6 +204,8 @@ · 203 unmodified lines
204204 * - add total_extlen to fuse_in_header
205205 * - add FUSE_MAX_NR_SECCTX
206206 * - add extension header
207+ * - add FUSE_EXT_GROUPS
208+ * - add FUSE_CREATE_SUPP_GROUP
207209 */
208210
209211 #ifndef _LINUX_FUSE_H
@@ -365,6 +367,8 @@ struct fuse_file_lock { · 155 unmodified lines
365367 * FUSE_SECURITY_CTX: add security context to create, mkdir, symlink, and
366368 * mknod
367369 * FUSE_HAS_INODE_DAX: use per inode DAX
370+ * FUSE_CREATE_SUPP_GROUP: add supplementary group info to create, mkdir,
371+ * symlink and mknod (single group that matches parent)
368372 */
369373 #define FUSE_ASYNC_READ (1 << 0)
370374 #define FUSE_POSIX_LOCKS (1 << 1)
@@ -401,6 +405,7 @@ struct fuse_file_lock { · 30 unmodified lines
401405 /* bits 32..63 get shifted down 32 bits into the flags2 field */
402406 #define FUSE_SECURITY_CTX (1ULL << 32)
403407 #define FUSE_HAS_INODE_DAX (1ULL << 33)
408+#define FUSE_CREATE_SUPP_GROUP (1ULL << 34)
404409
405410 /**
406411 * CUSE INIT request/reply flags
@@ -509,10 +514,12 @@ struct fuse_file_lock { · 102 unmodified lines
509514 /**
510515 * extension type
511516 * FUSE_MAX_NR_SECCTX: maximum value of &fuse_secctx_header.nr_secctx
517+ * FUSE_EXT_GROUPS: &fuse_supp_groups extension
512518 */
513519 enum fuse_ext_type {
514520 /* Types 0..31 are reserved for fuse_secctx_header */
515521 FUSE_MAX_NR_SECCTX = 31,
522+ FUSE_EXT_GROUPS = 32,
516523 };
517524
518525 enum fuse_opcode {
@@ -1073,4 +1080,14 @@ struct fuse_ext_header { · 554 unmodified lines
10731080 uint32_t type;
10741081 };
10751082
1083+/**
1084+ * struct fuse_supp_groups - Supplementary group extension
1085+ * @nr_groups: number of supplementary groups
1086+ * @groups: flexible array of group IDs
1087+ */
1088+struct fuse_supp_groups {
1089+ uint32_t nr_groups;
1090+ uint32_t groups[];
1091+};
1092+
10761093 #endif /* _LINUX_FUSE_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t