diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-05-10 01:14:54 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-05-10 01:14:54 +0000 |
commit | 86e8603ba256c474566c9d8254c4e281d82fcaa6 (patch) | |
tree | c2ff0f50dd51293b5a8073bf01d2848fc7504746 | |
parent | 10b7dca58b72f8fef2fa53e6c85d90301689b24f (diff) | |
parent | 168d2f5cd383e4798aab678077d3ba4076f8ea5e (diff) | |
download | libfuse-android14-platform-release.tar.gz |
Snap for 10098552 from 168d2f5cd383e4798aab678077d3ba4076f8ea5e to udc-releaseandroid-vts-14.0_r4android-vts-14.0_r3android-vts-14.0_r2android-vts-14.0_r1android-security-14.0.0_r8android-security-14.0.0_r7android-security-14.0.0_r6android-security-14.0.0_r5android-security-14.0.0_r4android-security-14.0.0_r3android-security-14.0.0_r2android-security-14.0.0_r1android-platform-14.0.0_r7android-platform-14.0.0_r6android-platform-14.0.0_r5android-platform-14.0.0_r4android-platform-14.0.0_r3android-platform-14.0.0_r2android-platform-14.0.0_r1android-cts-14.0_r4android-cts-14.0_r3android-cts-14.0_r2android-cts-14.0_r1android-14.0.0_r28android-14.0.0_r2android-14.0.0_r15android-14.0.0_r14android-14.0.0_r13android-14.0.0_r1android14-tests-releaseandroid14-security-releaseandroid14-s2-releaseandroid14-s1-releaseandroid14-releaseandroid14-platform-release
Change-Id: I2443a8cc102a3e6edcb3e69ffd7a62e819380f61
-rw-r--r-- | include/fuse_common.h | 7 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h index d6fa3e2..efaf754 100644 --- a/include/fuse_common.h +++ b/include/fuse_common.h @@ -400,6 +400,13 @@ struct fuse_loop_config { #define FUSE_CAP_EXPLICIT_INVAL_DATA (1 << 25) /** + * Indicates that an extended 'struct fuse_setxattr' is used by the kernel + * side - extra_flags are passed, which are used (as of now by acl) processing. + * For example FUSE_SETXATTR_ACL_KILL_SGID might be set. + */ +#define FUSE_CAP_SETXATTR_EXT (1 << 27) + +/** * Indicates support for passthrough mode access for read/write operations. * * If this flag is set in the `capable` field of the `fuse_conn_info` diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index e5004be..4c75e3b 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -1719,10 +1719,14 @@ static void do_statfs(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) static void do_setxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) { + struct fuse_session *se = req->se; + unsigned int xattr_ext = !!(se->conn.want & FUSE_CAP_SETXATTR_EXT); struct fuse_setxattr_in *arg = (struct fuse_setxattr_in *) inarg; - char *name = PARAM(arg); + char *name = xattr_ext ? PARAM(arg) : + (char *)arg + FUSE_COMPAT_SETXATTR_IN_SIZE; char *value = name + strlen(name) + 1; + /* XXX:The API should be extended to support extra_flags/setxattr_flags */ if (req->se->op.setxattr) req->se->op.setxattr(req, nodeid, name, value, arg->size, arg->flags); @@ -2131,6 +2135,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) se->conn.capable |= FUSE_CAP_NO_OPENDIR_SUPPORT; if (arg->flags & FUSE_EXPLICIT_INVAL_DATA) se->conn.capable |= FUSE_CAP_EXPLICIT_INVAL_DATA; + if (arg->flags & FUSE_SETXATTR_EXT) + se->conn.capable |= FUSE_CAP_SETXATTR_EXT; if (!(arg->flags & FUSE_MAX_PAGES)) { size_t max_bufsize = FUSE_DEFAULT_MAX_PAGES_PER_REQ * getpagesize() @@ -2268,6 +2274,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) outarg.flags |= FUSE_CACHE_SYMLINKS; if (se->conn.want & FUSE_CAP_EXPLICIT_INVAL_DATA) outarg.flags |= FUSE_EXPLICIT_INVAL_DATA; + if (se->conn.want & FUSE_CAP_SETXATTR_EXT) + outarg.flags |= FUSE_SETXATTR_EXT; outarg.max_readahead = se->conn.max_readahead; outarg.max_write = se->conn.max_write; if (se->conn.proto_minor >= 13) { |