diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-11-16 12:45:51 -0800 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-11-16 12:45:51 -0800 |
commit | c4c4819e853a572246c928feabb08028c41851ec (patch) | |
tree | 8ad44542abc5be1461c45201a9daecdd91db3754 /lib/fuse_lowlevel.c | |
parent | dddd8196079f8472a7dbb93734cc8e098c9898e7 (diff) |
Abort if fs requests capabilities not supported by kernel.
See also issue #114.
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r-- | lib/fuse_lowlevel.c | 9 |
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() " |