From 08ac8aee19938ce86d45c5776c013bc4d9303750 Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Wed, 16 Apr 2025 00:24:42 +0200 Subject: conn: prevent duplicate flag conversion in high-level interface The high-level interface triggers flag conversion twice: once in the high-level init and once in the low-level init. This caused false "both 'want' and 'want_ext' are set" errors when using fuse_set_feature_flag() or fuse_unset_feature_flag(). The existing check for duplicate conversion only worked when 32-bit flags were set directly. When using the preferred flag manipulation functions, conn->want and the lower 32 bits of conn->want_ext would differ, triggering the error. Fix this by synchronizing conn->want with the lower 32 bits of conn->want_ext after conversion, ensuring consistent state for subsequent calls. Closes: https://github.com/libfuse/libfuse/issues/1171 Signed-off-by: Bernd Schubert --- lib/fuse_i.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/fuse_i.h') diff --git a/lib/fuse_i.h b/lib/fuse_i.h index 23fcaa6..48b8294 100644 --- a/lib/fuse_i.h +++ b/lib/fuse_i.h @@ -256,5 +256,8 @@ static inline int convert_to_conn_want_ext(struct fuse_conn_info *conn, conn->want; } + /* ensure there won't be a second conversion */ + conn->want = fuse_lower_32_bits(conn->want_ext); + return 0; } -- cgit v1.2.3