Chromium Code Reviews| Index: native_client_sdk/src/libraries/nacl_io/mount_dev.cc |
| diff --git a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc |
| index 11893ea09e8ff985c82bd569b12f5731b1132ac6..d79cc56e308c7669e2f7c11b1e2b2d1cad32c327 100644 |
| --- a/native_client_sdk/src/libraries/nacl_io/mount_dev.cc |
| +++ b/native_client_sdk/src/libraries/nacl_io/mount_dev.cc |
| @@ -9,6 +9,7 @@ |
| #include <errno.h> |
| #include <fcntl.h> |
| #include <string.h> |
| +#include <unistd.h> |
| #include "nacl_io/kernel_wrap_real.h" |
| #include "nacl_io/mount_dev.h" |
| #include "nacl_io/mount_node.h" |
| @@ -269,6 +270,19 @@ Error UrandomNode::Write(size_t offs, |
| } // namespace |
| +Error MountDev::Access(const Path& path, int a_mode) { |
| + MountNode* node = NULL; |
|
binji
2013/06/19 16:46:28
probably OK not to, but I would AutoLock the mount
Matt Giuca
2013/06/20 01:43:14
Done.
|
| + int error = root_->FindChild(path.Join(), &node); |
| + if (error) |
| + return error; |
| + |
| + // Don't allow execute access. |
| + if (a_mode & X_OK) |
| + return EACCES; |
| + |
| + return 0; |
| +} |
| + |
| Error MountDev::Open(const Path& path, int mode, MountNode** out_node) { |
| *out_node = NULL; |