Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Unified Diff: native_client_sdk/src/libraries/nacl_io/mount_dev.cc

Issue 15800004: [NaCl SDK] nacl_io: Added support for access() syscall. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixes, implement httpfs, and write tests. Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698