aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-11-16 12:45:51 -0800
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-11-16 12:45:51 -0800
commitc4c4819e853a572246c928feabb08028c41851ec (patch)
tree8ad44542abc5be1461c45201a9daecdd91db3754 /lib
parentdddd8196079f8472a7dbb93734cc8e098c9898e7 (diff)
Abort if fs requests capabilities not supported by kernel.
See also issue #114.
Diffstat (limited to 'lib')
-rw-r--r--lib/fuse_lowlevel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index 9fd9144..77fc014 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -1916,6 +1916,15 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg)
if (se->op.init)
se->op.init(se->userdata, &se->conn);
+ if (se->conn.want & (~se->conn.capable)) {
+ fprintf(stderr, "fuse: error: filesystem requested capabilites "
+ "that are not supported by kernel, aborting.\n");
+ fuse_reply_err(req, EPROTO);
+ se->error = -EPROTO;
+ fuse_session_exit(se);
+ return;
+ }
+
unsigned max_read_mo = get_max_read(se->mo);
if (se->conn.max_read != max_read_mo) {
fprintf(stderr, "fuse: error: init() and fuse_session_new() "