Browse Source
Merge pull request #1106 from trapexit/xattrfix
Fix reading of setxattr name
pull/1107/head
trapexit
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
10 additions and
1 deletions
-
libfuse/include/fuse_common.h
-
libfuse/lib/fuse.c
-
libfuse/lib/fuse_lowlevel.c
|
@ -126,6 +126,7 @@ struct fuse_file_info_t |
|
|
#define FUSE_CAP_POSIX_ACL (1 << 19) |
|
|
#define FUSE_CAP_POSIX_ACL (1 << 19) |
|
|
#define FUSE_CAP_CACHE_SYMLINKS (1 << 20) |
|
|
#define FUSE_CAP_CACHE_SYMLINKS (1 << 20) |
|
|
#define FUSE_CAP_MAX_PAGES (1 << 21) |
|
|
#define FUSE_CAP_MAX_PAGES (1 << 21) |
|
|
|
|
|
#define FUSE_CAP_SETXATTR_EXT (1 << 22) |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Ioctl flags |
|
|
* Ioctl flags |
|
|
|
@ -2788,7 +2788,11 @@ fuse_lib_setxattr(fuse_req_t req, |
|
|
struct fuse_setxattr_in *arg; |
|
|
struct fuse_setxattr_in *arg; |
|
|
|
|
|
|
|
|
arg = fuse_hdr_arg(hdr_); |
|
|
arg = fuse_hdr_arg(hdr_); |
|
|
name = PARAM(arg); |
|
|
|
|
|
|
|
|
if((req->f->conn.capable & FUSE_SETXATTR_EXT) && (req->f->conn.want & FUSE_SETXATTR_EXT)) |
|
|
|
|
|
name = PARAM(arg); |
|
|
|
|
|
else |
|
|
|
|
|
name = (((char*)arg) + FUSE_COMPAT_SETXATTR_IN_SIZE); |
|
|
|
|
|
|
|
|
value = (name + strlen(name) + 1); |
|
|
value = (name + strlen(name) + 1); |
|
|
|
|
|
|
|
|
f = req_fuse_prepare(req); |
|
|
f = req_fuse_prepare(req); |
|
|
|
@ -1432,6 +1432,8 @@ do_init(fuse_req_t req, |
|
|
f->conn.capable |= FUSE_CAP_READDIR_PLUS; |
|
|
f->conn.capable |= FUSE_CAP_READDIR_PLUS; |
|
|
if (arg->flags & FUSE_READDIRPLUS_AUTO) |
|
|
if (arg->flags & FUSE_READDIRPLUS_AUTO) |
|
|
f->conn.capable |= FUSE_CAP_READDIR_PLUS_AUTO; |
|
|
f->conn.capable |= FUSE_CAP_READDIR_PLUS_AUTO; |
|
|
|
|
|
if (arg->flags & FUSE_SETXATTR_EXT) |
|
|
|
|
|
f->conn.capable |= FUSE_CAP_SETXATTR_EXT; |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
@ -1519,6 +1521,8 @@ do_init(fuse_req_t req, |
|
|
outarg.flags |= FUSE_DO_READDIRPLUS; |
|
|
outarg.flags |= FUSE_DO_READDIRPLUS; |
|
|
if (f->conn.want & FUSE_CAP_READDIR_PLUS_AUTO) |
|
|
if (f->conn.want & FUSE_CAP_READDIR_PLUS_AUTO) |
|
|
outarg.flags |= FUSE_READDIRPLUS_AUTO; |
|
|
outarg.flags |= FUSE_READDIRPLUS_AUTO; |
|
|
|
|
|
if (f->conn.want & FUSE_CAP_SETXATTR_EXT) |
|
|
|
|
|
outarg.flags |= FUSE_SETXATTR_EXT; |
|
|
|
|
|
|
|
|
outarg.max_readahead = f->conn.max_readahead; |
|
|
outarg.max_readahead = f->conn.max_readahead; |
|
|
outarg.max_write = f->conn.max_write; |
|
|
outarg.max_write = f->conn.max_write; |
|
|