diff --git a/server/fd.c b/server/fd.c index cf3a306..11bb457 100644 --- a/server/fd.c +++ b/server/fd.c @@ -1478,9 +1478,10 @@ static int check_sharing( struct fd *fd, unsigned int access, unsigned int shari if ((access & FILE_UNIX_READ_ACCESS) && !(existing_sharing & FILE_SHARE_READ)) return 0; if ((access & FILE_UNIX_WRITE_ACCESS) && !(existing_sharing & FILE_SHARE_WRITE)) return 0; if ((access & DELETE) && !(existing_sharing & FILE_SHARE_DELETE)) return 0; - if ((existing_access & FILE_UNIX_READ_ACCESS) && !(sharing & FILE_SHARE_READ)) return 0; - if ((existing_access & FILE_UNIX_WRITE_ACCESS) && !(sharing & FILE_SHARE_WRITE)) return 0; - if ((existing_access & DELETE) && !(sharing & FILE_SHARE_DELETE)) return 0; + if ((access & FILE_UNIX_READ_ACCESS) && (existing_access & FILE_UNIX_READ_ACCESS) && !(sharing & FILE_SHARE_READ)) return 0; + if ((access & FILE_UNIX_WRITE_ACCESS) && (existing_access & FILE_UNIX_WRITE_ACCESS) && !(sharing & FILE_SHARE_WRITE)) return 0; + if ((access & DELETE) && (existing_access & DELETE) && !(sharing & FILE_SHARE_DELETE)) return 0; return 1; }