mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-07 19:41:54 -04:00
Fix access mode check in open() call
This commit is contained in:
parent
e6dc6731e7
commit
c3de719134
@ -466,7 +466,8 @@ int op_open_common(LogProxy& log_, dwarfs_userdata* userdata,
|
||||
if (entry) {
|
||||
if (entry->is_directory()) {
|
||||
err = EISDIR;
|
||||
} else if (fi->flags & (O_APPEND | O_CREAT | O_TRUNC)) {
|
||||
} else if ((fi->flags & O_ACCMODE) != O_RDONLY ||
|
||||
(fi->flags & (O_APPEND | O_TRUNC)) != 0) {
|
||||
err = EACCES;
|
||||
} else {
|
||||
fi->fh = entry->inode_num();
|
||||
|
Loading…
x
Reference in New Issue
Block a user