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

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

Issue 660353003: [NaCl SDK] nacl_io: Fix utime() on directories. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
diff --git a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
index f7bf16313f554758a19ebbbdf70a48132edc3707..4f88bbf8c6de542164875651c7204cc97ac75a90 100644
--- a/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
+++ b/native_client_sdk/src/libraries/nacl_io/kernel_handle.cc
@@ -44,6 +44,11 @@ Error KernelHandle::Init(int open_flags) {
return EACCES;
}
+ // Directories can only be opened read-only.
+ if ((open_flags & 3) != O_RDONLY && node_->IsaDir()) {
+ return EISDIR;
+ }
+
if (open_flags & O_APPEND) {
Error error = node_->GetSize(&handle_attr_.offs);
if (error)
« no previous file with comments | « no previous file | native_client_sdk/src/libraries/nacl_io/kernel_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698