Add mknod check_access

Signed-off-by: Jashan Kamboj <jashank42@gmail.com>
This commit is contained in:
Jashan Kamboj 2015-07-15 02:59:43 +05:30 committed by Sage Weil
parent 74b8f0c770
commit 5a1988673c

View File

@ -4438,6 +4438,9 @@ void Server::handle_client_mknod(MDRequestRef& mdr)
if (!mds->locker->acquire_locks(mdr, rdlocks, wrlocks, xlocks))
return;
if (!check_access(mdr, diri, MAY_WRITE))
return;
unsigned mode = req->head.args.mknod.mode;
if ((mode & S_IFMT) == 0)
mode |= S_IFREG;