Skip to content

Commit

Permalink
syscall: fix O_NOFOLLOW inverted logic
Browse files Browse the repository at this point in the history
  • Loading branch information
dgryski committed Jan 30, 2024
1 parent 96129dc commit 90028f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/syscall/libc_wasip2.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,8 @@ func open(pathname *byte, flags int32, mode uint32) int32 {

// By default, follow symlinks for open() unless O_NOFOLLOW was passed
var pflags types.PathFlags = types.PathFlagsSymlinkFollow
if flags&O_NOFOLLOW == 0 { // FIXME(ydnar): is == 0 right?
if flags&O_NOFOLLOW == O_NOFOLLOW {
// O_NOFOLLOW was passed, so turn off SymlinkFollow
pflags &^= types.PathFlagsSymlinkFollow
}

Expand Down

0 comments on commit 90028f7

Please sign in to comment.