Fix support for FUSE_POSIX_ACL
authorMarcin Sulikowski <marcin.sulikowski@editshare.com>
Thu, 3 Aug 2017 14:24:39 +0000 (16:24 +0200)
committerNikolaus Rath <Nikolaus@rath.org>
Mon, 7 Aug 2017 13:53:02 +0000 (15:53 +0200)
The kernel may set the FUSE_POSIX_ACL flag in the FUSE_INIT request to
notify the userspace daemon that the OS does support POSIX ACLs for FUSE
file systems. If the filesystem implementation wants to enable POSIX
ACLs, it has to reply with the FUSE_POSIX_ACL flag set. However, the
reply to the kernel never includes this flag, even if the implementation
expresses the need by setting the FUSE_CAP_POSIX_ACL flag in the
fuse_conn_info::want variable passed to its init callback. We modify the
library to handle requests for FUSE_CAP_POSIX_ACL correctly, i.e., set
the FUSE_POSIX_ACL flag in the FUSE_INIT reply to the kernel.

Signed-off-by: Marcin Sulikowski <marcin.sulikowski@editshare.com>
ChangeLog.rst
lib/fuse_lowlevel.c

index 35317615084035a2ef4b7c96adf14ae717bcf2b4..95a98b0d3a38ff4bba156a1f6c645f24bc6412e2 100644 (file)
@@ -1,3 +1,10 @@
+Unreleased Changes
+==================
+
+* Fixed support for `FUSE_CAP_POSIX_ACL`: setting this capability
+  flag had no effect in the previous versions of libfuse 3.x;
+  now ACLs should actually work.
+
 libfuse 3.1.1 (2017-08-06)
 ==========================
 
index ccdb5a54b64bb15637d2f2cc8371a39ee05072ee..34bff00153dce04c390932c473fa357f9350e54a 100644 (file)
@@ -1981,6 +1981,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
                outarg.flags |= FUSE_ASYNC_DIO;
        if (se->conn.want & FUSE_CAP_WRITEBACK_CACHE)
                outarg.flags |= FUSE_WRITEBACK_CACHE;
+       if (se->conn.want & FUSE_CAP_POSIX_ACL)
+               outarg.flags |= FUSE_POSIX_ACL;
        outarg.max_readahead = se->conn.max_readahead;
        outarg.max_write = se->conn.max_write;
        if (se->conn.proto_minor >= 13) {