Skip to content

Commit

Permalink
Fixed Stats.hasAccess other permissions conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Nov 11, 2024
1 parent 3dfa97f commit 9dac60d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/stats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,9 @@ export abstract class StatsCommon<T extends number | bigint> implements Node.Sta
}

// Others permissions
if (credentials.uid !== this.uid && credentials.gid !== this.gid) {
if (this.mode & S_IROTH) perm |= R_OK;
if (this.mode & S_IWOTH) perm |= W_OK;
if (this.mode & S_IXOTH) perm |= X_OK;
}
if (this.mode & S_IROTH) perm |= R_OK;
if (this.mode & S_IWOTH) perm |= W_OK;
if (this.mode & S_IXOTH) perm |= X_OK;

// Perform the access check
return (perm & mode) === mode;
Expand Down

0 comments on commit 9dac60d

Please sign in to comment.