aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnthony Pesch <inolen@gmail.com>2013-07-12 23:29:47 -0700
committerAnthony Pesch <inolen@gmail.com>2013-07-12 23:29:47 -0700
commitc711f1e6e6d294200b04ad580827358b2ffa2374 (patch)
tree3fc32e028641739a1d48d139e6396d7e30eadf6a /src
parentfe247614cd79a135d3145fb5e66e152b620c9025 (diff)
check write permission in posix_fallocate
Diffstat (limited to 'src')
-rw-r--r--src/library.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index bf969fd7..6e41496b 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1381,7 +1381,7 @@ LibraryManager.library = {
posix_fallocate: function(fd, offset, len) {
// int posix_fallocate(int fd, off_t offset, off_t len);
// http://pubs.opengroup.org/onlinepubs/009695399/functions/posix_fallocate.html
- if (!FS.streams[fd] || FS.streams[fd].link ||
+ if (!FS.streams[fd] || !FS.streams[fd].isWrite || FS.streams[fd].link ||
FS.streams[fd].isFolder || FS.streams[fd].isDevice) {
___setErrNo(ERRNO_CODES.EBADF);
return -1;