aboutsummaryrefslogtreecommitdiff
path: root/src/database/sql/sql_test.go
diff options
context:
space:
mode:
authorMichael Anthony Knyszek <mknyszek@google.com>2025-02-07 23:22:50 +0000
committerGopher Robot <gobot@golang.org>2025-02-10 10:18:55 -0800
commita704d39b29dfc21599f644909c0f98bbfa745cb4 (patch)
tree35c8ac50a735b6bb8a082ee4b0ce4ca22f141d22 /src/database/sql/sql_test.go
parent47d0b0f2bf9d507d5bc9ea8f456cc821829fe21c (diff)
downloadgo-a704d39b29dfc21599f644909c0f98bbfa745cb4.tar.xz
os: hide SetFinalizer from users of Root
Currently Root embeds a root and calls SetFinalizer on &r.root. This sets the finalizer on the outer root, which is visible to users of os.Root, and thus they can mutate the finalizer attached to it. This change modifies Root to not embed its inner root, but rather to refer to it by pointer. This allows us to set the finalizer on this independent inner object, preventing users of os.Root from changing the finalizer. This follows the same pattern as os.File's finalizer. Fixes #71617. Change-Id: Ibd199bab1b3c877d5e12ef380fd4647b4e10221f Reviewed-on: https://go-review.googlesource.com/c/go/+/647876 Auto-Submit: Michael Knyszek <mknyszek@google.com> Reviewed-by: Damien Neil <dneil@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/database/sql/sql_test.go')
0 files changed, 0 insertions, 0 deletions