Skip to content

Commit

Permalink
start marking and using fid types
Browse files Browse the repository at this point in the history
Each dispatch function must now explicitly call for the
types of fids it allows (or rejects).  This lets us make
sure insane clients will not send xattr fids into walk
and mkdir operations, for instance, which would confuse
the back-end code.

(This also fixes existing issues with broken clients doing
things like using Twalk on an open directory, which can leak
open file descriptors.  The protocol prohibits this but the
existing backend code never checks.)

This has no effect on any well-behaved client, since the
backend has no extattr code yet, but it is needed to enable
the backend to work with attribute fids, which need special
action on clunk.  Rather than making the backend check,
we provide separate xattr read, write, and clunk here.
  • Loading branch information
Chris Torek committed Jul 15, 2016
1 parent 2dc8ab6 commit 06d704c
Show file tree
Hide file tree
Showing 2 changed files with 604 additions and 121 deletions.
3 changes: 3 additions & 0 deletions backend/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ struct l9p_backend {
int (*setattr)(void *, struct l9p_request *);
int (*xattrwalk)(void *, struct l9p_request *);
int (*xattrcreate)(void *, struct l9p_request *);
int (*xattrread)(void *, struct l9p_request *);
int (*xattrwrite)(void *, struct l9p_request *);
int (*xattrclunk)(void *, struct l9p_fid *);
int (*readdir)(void *, struct l9p_request *);
int (*fsync)(void *, struct l9p_request *);
int (*lock)(void *, struct l9p_request *);
Expand Down
Loading

0 comments on commit 06d704c

Please sign in to comment.