]> Cypherpunks repositories - gostls13.git/commit
os: do not follow dangling symlinks in Root when O_CREATE|O_EXCL on AIX
authorDamien Neil <dneil@google.com>
Fri, 30 May 2025 21:05:10 +0000 (14:05 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 10 Jun 2025 18:18:22 +0000 (11:18 -0700)
commitfb0c27c514b7d6bbb88b72cfd7baff01e567f6bb
tree4c5394aaeac80e80bd84046cc9ebb267e6924881
parent1cafdfb63bb9b8825c5f4143d154bce3b82ed6a1
os: do not follow dangling symlinks in Root when O_CREATE|O_EXCL on AIX

OpenFile with O_CREATE|O_EXCL should not follow dangling symlinks.
On AIX it does, because AIX's openat(2) apparently returns ELOOP
in this case. Most Unices return EEXIST.

Ensure that we never follow symlinks in the final component of
the path when opening a file with O_CREATE|O_EXCL.

Fixes #73924

Change-Id: I869afb7faefccb0bb29d155553a7d7e5be80467d
Reviewed-on: https://go-review.googlesource.com/c/go/+/677735
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Damien Neil <dneil@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/os/root_unix.go