diff --git a/example/printcap.c b/example/printcap.c index 4c59582f9..2cc8cd0ee 100644 --- a/example/printcap.c +++ b/example/printcap.c @@ -65,6 +65,7 @@ static const struct cap_info capabilities[] = { {FUSE_CAP_DIRECT_IO_ALLOW_MMAP, "FUSE_CAP_DIRECT_IO_ALLOW_MMAP"}, {FUSE_CAP_NO_EXPORT_SUPPORT, "FUSE_CAP_NO_EXPORT_SUPPORT"}, {FUSE_CAP_PASSTHROUGH, "FUSE_CAP_PASSTHROUGH"}, + { FUSE_CAP_ALLOW_IDMAP, "FUSE_CAP_ALLOW_IDMAP"}, // Add any new capabilities here {0, NULL} // Sentinel to mark the end of the array }; diff --git a/include/fuse_common.h b/include/fuse_common.h index b6934599e..b5409890d 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -520,6 +520,11 @@ struct fuse_loop_config_v1 { */ #define FUSE_CAP_OVER_IO_URING (1UL << 31) +/** + * Indicates that creation of idmapped mounts is allowed + */ +#define FUSE_CAP_ALLOW_IDMAP (1ULL << 32) + /** * Ioctl flags * diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 00c281502..5592382c4 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2766,6 +2766,8 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, const void *op_in, se->conn.capable_ext |= FUSE_CAP_NO_EXPORT_SUPPORT; if (inargflags & FUSE_OVER_IO_URING) se->conn.capable_ext |= FUSE_CAP_OVER_IO_URING; + if (inargflags & FUSE_ALLOW_IDMAP) + se->conn.capable_ext |= FUSE_CAP_ALLOW_IDMAP; } else { se->conn.max_readahead = 0; @@ -2924,6 +2926,8 @@ _do_init(fuse_req_t req, const fuse_ino_t nodeid, const void *op_in, outargflags |= FUSE_OVER_IO_URING; enable_io_uring = true; } + if (se->conn.want_ext & FUSE_CAP_ALLOW_IDMAP) + outargflags |= FUSE_ALLOW_IDMAP; if ((inargflags & FUSE_REQUEST_TIMEOUT) && se->conn.request_timeout) { outargflags |= FUSE_REQUEST_TIMEOUT; diff --git a/meson.build b/meson.build index 01cd1a372..6ea1ad185 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('libfused', ['c'], - version: '1.2.0', # synced with fuse-3.18.3 + version: '1.2.1', # fuse-3.18.3 + FUSE_CAP_ALLOW_IDMAP meson_version: '>= 0.60.0', default_options: [ 'buildtype=debugoptimized',