vfs: check the X permission on set cwd.

* When you change the current working directory, you actually
  should have the permission to enter that directory.
* This gives us a 0.04% better score on the perl test suite :-)
This commit is contained in:
Axel Dörfler 2014-10-25 15:54:56 +02:00
parent 49c31016cd
commit 8efd5b7613

View File

@ -7883,6 +7883,13 @@ set_cwd(int fd, char* path, bool kernel)
goto err;
}
// We need to have the permission to enter the directory, too
if (HAS_FS_CALL(vnode, access)) {
status = FS_CALL(vnode, access, X_OK);
if (status != B_OK)
goto err;
}
// Get current io context and lock
context = get_current_io_context(kernel);
mutex_lock(&context->io_mutex);