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:
@@ -7883,6 +7883,13 @@ set_cwd(int fd, char* path, bool kernel)
|
|||||||
goto err;
|
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
|
// Get current io context and lock
|
||||||
context = get_current_io_context(kernel);
|
context = get_current_io_context(kernel);
|
||||||
mutex_lock(&context->io_mutex);
|
mutex_lock(&context->io_mutex);
|
||||||
|
|||||||
Reference in New Issue
Block a user