]> Cypherpunks repositories - gostls13.git/commitdiff
internal/syscall/unix: use correct number of params in unlinkat, fchownat
authorDamien Neil <dneil@google.com>
Wed, 19 Mar 2025 20:13:51 +0000 (13:13 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 19 Mar 2025 22:39:13 +0000 (15:39 -0700)
We were calling syscall6 with an incorrect parameter count, omitting
the flags parameter.

Change-Id: Ife606bd57c1e4b899c0340767e9197bbe0aa81a9
Reviewed-on: https://go-review.googlesource.com/c/go/+/659415
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
src/internal/syscall/unix/at_libc.go

index 23db8cf6ac0ca6b7cdd0728c3ab121aeb9281744..70417c021078fb7ed522e9c26767fb8c240cdbf3 100644 (file)
@@ -35,7 +35,7 @@ func Unlinkat(dirfd int, path string, flags int) error {
                return err
        }
 
-       _, _, errno := syscall6(uintptr(unsafe.Pointer(&procUnlinkat)), 3, uintptr(dirfd), uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0)
+       _, _, errno := syscall6(uintptr(unsafe.Pointer(&procUnlinkat)), 4, uintptr(dirfd), uintptr(unsafe.Pointer(p)), uintptr(flags), 0, 0, 0)
        if errno != 0 {
                return errno
        }
@@ -134,7 +134,7 @@ func Fchownat(dirfd int, path string, uid, gid int, flags int) error {
        if err != nil {
                return err
        }
-       _, _, errno := syscall6(uintptr(unsafe.Pointer(&procFchownat)), 4,
+       _, _, errno := syscall6(uintptr(unsafe.Pointer(&procFchownat)), 5,
                uintptr(dirfd),
                uintptr(unsafe.Pointer(p)),
                uintptr(uid),