Skip to content

Commit

Permalink
userlandfs: Fix access mask check
Browse files Browse the repository at this point in the history
CID 1255052 and CID 1255053
  • Loading branch information
stpere committed Jul 3, 2015
1 parent 189c10b commit 76a1eb6
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ BeOSKernelVolume::ReadAttr(void* node, void* _cookie, off_t pos,
AttributeCookie* cookie = (AttributeCookie*)_cookie;

// check, if open mode allows reading
if ((open_mode_to_access(cookie->fOpenMode) | R_OK) == 0)
if ((open_mode_to_access(cookie->fOpenMode) & R_OK) == 0)
return B_FILE_ERROR;

// read
Expand All @@ -624,7 +624,7 @@ BeOSKernelVolume::WriteAttr(void* node, void* _cookie, off_t pos,
AttributeCookie* cookie = (AttributeCookie*)_cookie;

// check, if open mode allows writing
if ((open_mode_to_access(cookie->fOpenMode) | W_OK) == 0)
if ((open_mode_to_access(cookie->fOpenMode) & W_OK) == 0)
return B_FILE_ERROR;

// write
Expand Down

0 comments on commit 76a1eb6

Please sign in to comment.