userlandfs: Fix access mask check

CID 1255052 and CID 1255053
This commit is contained in:
Philippe Saint-Pierre 2015-07-03 16:14:09 -04:00
parent 189c10b089
commit 76a1eb689c

View File

@ -604,7 +604,7 @@ BeOSKernelVolume::ReadAttr(void* node, void* _cookie, off_t pos,
AttributeCookie* cookie = (AttributeCookie*)_cookie; AttributeCookie* cookie = (AttributeCookie*)_cookie;
// check, if open mode allows reading // 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; return B_FILE_ERROR;
// read // read
@ -624,7 +624,7 @@ BeOSKernelVolume::WriteAttr(void* node, void* _cookie, off_t pos,
AttributeCookie* cookie = (AttributeCookie*)_cookie; AttributeCookie* cookie = (AttributeCookie*)_cookie;
// check, if open mode allows writing // 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; return B_FILE_ERROR;
// write // write