@ttsc/darwin-x64 0.14.0-dev.20260529.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/go/VERSION +2 -2
- package/bin/go/bin/go +0 -0
- package/bin/go/bin/gofmt +0 -0
- package/bin/go/pkg/tool/darwin_amd64/asm +0 -0
- package/bin/go/pkg/tool/darwin_amd64/cgo +0 -0
- package/bin/go/pkg/tool/darwin_amd64/compile +0 -0
- package/bin/go/pkg/tool/darwin_amd64/cover +0 -0
- package/bin/go/pkg/tool/darwin_amd64/fix +0 -0
- package/bin/go/pkg/tool/darwin_amd64/link +0 -0
- package/bin/go/pkg/tool/darwin_amd64/preprofile +0 -0
- package/bin/go/pkg/tool/darwin_amd64/vet +0 -0
- package/bin/go/src/archive/tar/format.go +6 -0
- package/bin/go/src/archive/tar/reader.go +24 -4
- package/bin/go/src/builtin/builtin.go +13 -4
- package/bin/go/src/crypto/fips140/fips140.go +6 -0
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_fips140.go +97 -0
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_wasm.go +11 -0
- package/bin/go/src/crypto/internal/fips140/drbg/rand.go +1 -75
- package/bin/go/src/crypto/tls/conn.go +7 -3
- package/bin/go/src/crypto/tls/handshake_client_tls13.go +2 -2
- package/bin/go/src/crypto/tls/handshake_server_tls13.go +2 -2
- package/bin/go/src/crypto/tls/key_schedule.go +24 -3
- package/bin/go/src/crypto/x509/constraints.go +33 -33
- package/bin/go/src/crypto/x509/verify.go +28 -13
- package/bin/go/src/go/types/builtins.go +2 -2
- package/bin/go/src/go/types/signature.go +3 -0
- package/bin/go/src/go/types/under.go +3 -3
- package/bin/go/src/go.mod +1 -1
- package/bin/go/src/go.sum +2 -2
- package/bin/go/src/html/template/attr_string.go +3 -2
- package/bin/go/src/html/template/context.go +21 -1
- package/bin/go/src/html/template/element_string.go +3 -2
- package/bin/go/src/html/template/escape.go +16 -2
- package/bin/go/src/html/template/js.go +1 -0
- package/bin/go/src/html/template/state_string.go +5 -3
- package/bin/go/src/html/template/transition.go +43 -6
- package/bin/go/src/internal/buildcfg/zbootstrap.go +1 -1
- package/bin/go/src/internal/godebugs/table.go +1 -0
- package/bin/go/src/internal/poll/fd_windows.go +64 -38
- package/bin/go/src/internal/poll/fstatat_unix.go +22 -0
- package/bin/go/src/internal/poll/sendfile_windows.go +3 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_386.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_amd64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_loong64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mips64x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mipsx.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_riscv64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_s390x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/syscall_linux.go +14 -0
- package/bin/go/src/internal/syscall/unix/at.go +0 -17
- package/bin/go/src/internal/syscall/unix/at_sysnum_linux.go +2 -1
- package/bin/go/src/internal/syscall/unix/fchmodat_linux.go +51 -0
- package/bin/go/src/internal/syscall/unix/fchmodat_other.go +29 -0
- package/bin/go/src/internal/syscall/windows/at_windows.go +20 -3
- package/bin/go/src/internal/syscall/windows/registry/key.go +10 -2
- package/bin/go/src/internal/syscall/windows/registry/value.go +5 -1
- package/bin/go/src/internal/syscall/windows/syscall_windows.go +4 -0
- package/bin/go/src/internal/syscall/windows/types_windows.go +82 -0
- package/bin/go/src/internal/syscall/windows/zsyscall_windows.go +27 -0
- package/bin/go/src/net/cgo_unix.go +4 -1
- package/bin/go/src/net/http/doc.go +0 -1
- package/bin/go/src/net/http/h2_bundle.go +3 -3
- package/bin/go/src/net/http/httputil/reverseproxy.go +14 -0
- package/bin/go/src/net/lookup_windows.go +16 -3
- package/bin/go/src/net/mail/message.go +20 -9
- package/bin/go/src/net/sendfile.go +2 -0
- package/bin/go/src/net/sendfile_stub.go +2 -0
- package/bin/go/src/net/sendfile_windows.go +3 -0
- package/bin/go/src/net/url/url.go +22 -16
- package/bin/go/src/os/dir_darwin.go +2 -2
- package/bin/go/src/os/dir_unix.go +2 -2
- package/bin/go/src/os/file.go +0 -3
- package/bin/go/src/os/file_unix.go +9 -5
- package/bin/go/src/os/removeall_at.go +6 -2
- package/bin/go/src/os/removeall_unix.go +0 -8
- package/bin/go/src/os/removeall_windows.go +0 -4
- package/bin/go/src/os/root_unix.go +1 -0
- package/bin/go/src/os/stat.go +3 -0
- package/bin/go/src/os/statat.go +24 -0
- package/bin/go/src/os/statat_other.go +12 -0
- package/bin/go/src/os/statat_unix.go +20 -0
- package/bin/go/src/reflect/value.go +3 -2
- package/bin/go/src/runtime/defs_linux_386.go +4 -3
- package/bin/go/src/runtime/defs_linux_arm.go +4 -3
- package/bin/go/src/runtime/defs_linux_mips64x.go +1 -1
- package/bin/go/src/runtime/defs_linux_mipsx.go +5 -4
- package/bin/go/src/runtime/malloc.go +1 -53
- package/bin/go/src/runtime/mem.go +104 -9
- package/bin/go/src/runtime/metrics/doc.go +5 -0
- package/bin/go/src/runtime/os_linux.go +62 -0
- package/bin/go/src/runtime/os_linux32.go +14 -24
- package/bin/go/src/runtime/os_linux64.go +2 -0
- package/bin/go/src/runtime/print.go +16 -4
- package/bin/go/src/runtime/race/README +9 -9
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/race_darwin_arm64.patch +63 -0
- package/bin/go/src/runtime/race/race_darwin_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_arm64.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_loong64.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_loong64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_s390x.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_s390x.syso +0 -0
- package/bin/go/src/syscall/syscall_windows.go +5 -1
- package/bin/go/src/vendor/modules.txt +1 -1
- package/bin/ttsc +0 -0
- package/bin/ttscserver +0 -0
- package/package.json +1 -1
|
@@ -62,6 +62,8 @@ var (
|
|
|
62
62
|
procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken")
|
|
63
63
|
procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus")
|
|
64
64
|
procRevertToSelf = modadvapi32.NewProc("RevertToSelf")
|
|
65
|
+
procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW")
|
|
66
|
+
procSetNamedSecurityInfoW = modadvapi32.NewProc("SetNamedSecurityInfoW")
|
|
65
67
|
procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation")
|
|
66
68
|
procProcessPrng = modbcryptprimitives.NewProc("ProcessPrng")
|
|
67
69
|
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
|
|
@@ -236,6 +238,31 @@ func RevertToSelf() (err error) {
|
|
|
236
238
|
return
|
|
237
239
|
}
|
|
238
240
|
|
|
241
|
+
func SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) {
|
|
242
|
+
r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)))
|
|
243
|
+
if r0 != 0 {
|
|
244
|
+
ret = syscall.Errno(r0)
|
|
245
|
+
}
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
func SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
|
|
250
|
+
var _p0 *uint16
|
|
251
|
+
_p0, ret = syscall.UTF16PtrFromString(objectName)
|
|
252
|
+
if ret != nil {
|
|
253
|
+
return
|
|
254
|
+
}
|
|
255
|
+
return _SetNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
func _SetNamedSecurityInfo(objectName *uint16, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
|
|
259
|
+
r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)))
|
|
260
|
+
if r0 != 0 {
|
|
261
|
+
ret = syscall.Errno(r0)
|
|
262
|
+
}
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
|
|
239
266
|
func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32, tokenInformation unsafe.Pointer, tokenInformationLength uint32) (err error) {
|
|
240
267
|
r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(tokenHandle), uintptr(tokenInformationClass), uintptr(tokenInformation), uintptr(tokenInformationLength))
|
|
241
268
|
if r1 == 0 {
|
|
@@ -342,7 +342,10 @@ func cgoResSearch(hostname string, rtype, class int) ([]dnsmessage.Resource, err
|
|
|
342
342
|
// useful in the response, even though there *is* a response.
|
|
343
343
|
bufSize := maxDNSPacketSize
|
|
344
344
|
buf := (*_C_uchar)(_C_malloc(uintptr(bufSize)))
|
|
345
|
-
defer
|
|
345
|
+
defer func() {
|
|
346
|
+
// Free in a closure which captures buf to pick up a reallocated buffer from below.
|
|
347
|
+
_C_free(unsafe.Pointer(buf))
|
|
348
|
+
}()
|
|
346
349
|
|
|
347
350
|
s, err := syscall.BytePtrFromString(hostname)
|
|
348
351
|
if err != nil {
|
|
@@ -10152,6 +10152,9 @@ func (rl *http2clientConnReadLoop) processSettingsNoWrite(f *http2SettingsFrame)
|
|
|
10152
10152
|
|
|
10153
10153
|
var seenMaxConcurrentStreams bool
|
|
10154
10154
|
err := f.ForeachSetting(func(s http2Setting) error {
|
|
10155
|
+
if err := s.Valid(); err != nil {
|
|
10156
|
+
return err
|
|
10157
|
+
}
|
|
10155
10158
|
switch s.ID {
|
|
10156
10159
|
case http2SettingMaxFrameSize:
|
|
10157
10160
|
cc.maxFrameSize = s.Val
|
|
@@ -10183,9 +10186,6 @@ func (rl *http2clientConnReadLoop) processSettingsNoWrite(f *http2SettingsFrame)
|
|
|
10183
10186
|
cc.henc.SetMaxDynamicTableSize(s.Val)
|
|
10184
10187
|
cc.peerMaxHeaderTableSize = s.Val
|
|
10185
10188
|
case http2SettingEnableConnectProtocol:
|
|
10186
|
-
if err := s.Valid(); err != nil {
|
|
10187
|
-
return err
|
|
10188
|
-
}
|
|
10189
10189
|
// If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL,
|
|
10190
10190
|
// we require that it do so in the first SETTINGS frame.
|
|
10191
10191
|
//
|
|
@@ -10,6 +10,7 @@ import (
|
|
|
10
10
|
"context"
|
|
11
11
|
"errors"
|
|
12
12
|
"fmt"
|
|
13
|
+
"internal/godebug"
|
|
13
14
|
"io"
|
|
14
15
|
"log"
|
|
15
16
|
"mime"
|
|
@@ -922,11 +923,24 @@ func (c switchProtocolCopier) copyToBackend(errc chan<- error) {
|
|
|
922
923
|
errc <- errCopyDone
|
|
923
924
|
}
|
|
924
925
|
|
|
926
|
+
var urlmaxqueryparams = godebug.New("urlmaxqueryparams")
|
|
927
|
+
|
|
928
|
+
// Keep this in sync with net/url.
|
|
929
|
+
const defaultMaxParams = 10000
|
|
930
|
+
|
|
925
931
|
func cleanQueryParams(s string) string {
|
|
926
932
|
reencode := func(s string) string {
|
|
927
933
|
v, _ := url.ParseQuery(s)
|
|
928
934
|
return v.Encode()
|
|
929
935
|
}
|
|
936
|
+
if urlmaxqueryparams.Value() != "" {
|
|
937
|
+
// Always reencode when a non-default urlmaxqueryparams is set.
|
|
938
|
+
return reencode(s)
|
|
939
|
+
}
|
|
940
|
+
if numParams := strings.Count(s, "&") + 1; numParams > defaultMaxParams {
|
|
941
|
+
// Too many query parameters.
|
|
942
|
+
return reencode(s)
|
|
943
|
+
}
|
|
930
944
|
for i := 0; i < len(s); {
|
|
931
945
|
switch s[i] {
|
|
932
946
|
case ';':
|
|
@@ -215,8 +215,13 @@ func (r *Resolver) lookupPort(ctx context.Context, network, service string) (int
|
|
|
215
215
|
hints.Family = syscall.AF_INET6
|
|
216
216
|
}
|
|
217
217
|
|
|
218
|
+
servicep, err := syscall.UTF16PtrFromString(service)
|
|
219
|
+
if err != nil {
|
|
220
|
+
return 0, newDNSError(err, network+"/"+service, "")
|
|
221
|
+
}
|
|
222
|
+
|
|
218
223
|
var result *syscall.AddrinfoW
|
|
219
|
-
e := syscall.GetAddrInfoW(nil,
|
|
224
|
+
e := syscall.GetAddrInfoW(nil, servicep, &hints, &result)
|
|
220
225
|
if e != nil {
|
|
221
226
|
if port, err := lookupPortMap(network, service); err == nil {
|
|
222
227
|
return port, nil
|
|
@@ -269,7 +274,12 @@ func (r *Resolver) lookupCNAME(ctx context.Context, name string) (string, error)
|
|
|
269
274
|
}
|
|
270
275
|
defer syscall.DnsRecordListFree(rec, 1)
|
|
271
276
|
|
|
272
|
-
|
|
277
|
+
namep, err := syscall.UTF16PtrFromString(name)
|
|
278
|
+
if err != nil {
|
|
279
|
+
return "", newDNSError(err, name, "")
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
resolved := resolveCNAME(namep, rec)
|
|
273
283
|
cname := windows.UTF16PtrToString(resolved)
|
|
274
284
|
return absDomainName(cname), nil
|
|
275
285
|
}
|
|
@@ -415,7 +425,10 @@ const dnsSectionMask = 0x0003
|
|
|
415
425
|
|
|
416
426
|
// returns only results applicable to name and resolves CNAME entries.
|
|
417
427
|
func validRecs(r *syscall.DNSRecord, dnstype uint16, name string) []*syscall.DNSRecord {
|
|
418
|
-
cname := syscall.
|
|
428
|
+
cname, err := syscall.UTF16PtrFromString(name)
|
|
429
|
+
if err != nil {
|
|
430
|
+
return nil
|
|
431
|
+
}
|
|
419
432
|
if dnstype != syscall.DNS_TYPE_CNAME {
|
|
420
433
|
cname = resolveCNAME(cname, r)
|
|
421
434
|
}
|
|
@@ -575,8 +575,10 @@ func (p *addrParser) consumeAddrSpec() (spec string, err error) {
|
|
|
575
575
|
func (p *addrParser) consumePhrase() (phrase string, err error) {
|
|
576
576
|
debug.Printf("consumePhrase: [%s]", p.s)
|
|
577
577
|
// phrase = 1*word
|
|
578
|
-
var
|
|
579
|
-
|
|
578
|
+
var (
|
|
579
|
+
words []string
|
|
580
|
+
sb strings.Builder
|
|
581
|
+
)
|
|
580
582
|
for {
|
|
581
583
|
// obs-phrase allows CFWS after one word
|
|
582
584
|
if len(words) > 0 {
|
|
@@ -608,13 +610,22 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
|
|
|
608
610
|
break
|
|
609
611
|
}
|
|
610
612
|
debug.Printf("consumePhrase: consumed %q", word)
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
613
|
+
switch {
|
|
614
|
+
case isEncoded:
|
|
615
|
+
sb.WriteString(word)
|
|
616
|
+
case !isEncoded && sb.Len() > 0:
|
|
617
|
+
words = append(words, sb.String())
|
|
618
|
+
sb.Reset()
|
|
619
|
+
words = append(words, word)
|
|
620
|
+
default:
|
|
614
621
|
words = append(words, word)
|
|
615
622
|
}
|
|
616
|
-
isPrevEncoded = isEncoded
|
|
617
623
|
}
|
|
624
|
+
|
|
625
|
+
if sb.Len() > 0 {
|
|
626
|
+
words = append(words, sb.String())
|
|
627
|
+
}
|
|
628
|
+
|
|
618
629
|
// Ignore any error if we got at least one word.
|
|
619
630
|
if err != nil && len(words) == 0 {
|
|
620
631
|
debug.Printf("consumePhrase: hit err: %v", err)
|
|
@@ -832,7 +843,7 @@ func (p *addrParser) consumeComment() (string, bool) {
|
|
|
832
843
|
// '(' already consumed.
|
|
833
844
|
depth := 1
|
|
834
845
|
|
|
835
|
-
var comment
|
|
846
|
+
var comment strings.Builder
|
|
836
847
|
for {
|
|
837
848
|
if p.empty() || depth == 0 {
|
|
838
849
|
break
|
|
@@ -846,12 +857,12 @@ func (p *addrParser) consumeComment() (string, bool) {
|
|
|
846
857
|
depth--
|
|
847
858
|
}
|
|
848
859
|
if depth > 0 {
|
|
849
|
-
comment
|
|
860
|
+
comment.WriteByte(p.s[0])
|
|
850
861
|
}
|
|
851
862
|
p.s = p.s[1:]
|
|
852
863
|
}
|
|
853
864
|
|
|
854
|
-
return comment, depth == 0
|
|
865
|
+
return comment.String(), depth == 0
|
|
855
866
|
}
|
|
856
867
|
|
|
857
868
|
func (p *addrParser) decodeRFC2047Word(s string) (word string, isEncoded bool, err error) {
|
|
@@ -12,5 +12,8 @@ import "internal/syscall/windows"
|
|
|
12
12
|
// https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile
|
|
13
13
|
// https://golang.org/issue/73746
|
|
14
14
|
func supportsSendfile() bool {
|
|
15
|
+
if testHookSupportsSendfile != nil {
|
|
16
|
+
return testHookSupportsSendfile()
|
|
17
|
+
}
|
|
15
18
|
return windows.SupportUnlimitedTransmitFile()
|
|
16
19
|
}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
//go:generate go run gen_encoding_table.go
|
|
6
|
+
|
|
5
7
|
// Package url parses URLs and implements query escaping.
|
|
6
8
|
//
|
|
7
9
|
// See RFC 3986. This package generally follows RFC 3986, except where
|
|
8
10
|
// it deviates for compatibility reasons.
|
|
9
11
|
// RFC 6874 followed for IPv6 zone literals.
|
|
10
|
-
|
|
11
|
-
//go:generate go run gen_encoding_table.go
|
|
12
|
-
|
|
13
12
|
package url
|
|
14
13
|
|
|
15
14
|
// When sending changes, first search old issues for history on decisions.
|
|
@@ -547,7 +546,9 @@ func parseAuthority(scheme, authority string) (user *Userinfo, host string, err
|
|
|
547
546
|
// parseHost parses host as an authority without user
|
|
548
547
|
// information. That is, as host[:port].
|
|
549
548
|
func parseHost(scheme, host string) (string, error) {
|
|
550
|
-
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx
|
|
549
|
+
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx > 0 {
|
|
550
|
+
return "", errors.New("invalid IP-literal")
|
|
551
|
+
} else if openBracketIdx == 0 {
|
|
551
552
|
// Parse an IP-Literal in RFC 3986 and RFC 6874.
|
|
552
553
|
// E.g., "[fe80::1]", "[fe80::1%25en0]", "[fe80::1]:80".
|
|
553
554
|
closeBracketIdx := strings.LastIndex(host, "]")
|
|
@@ -605,18 +606,22 @@ func parseHost(scheme, host string) (string, error) {
|
|
|
605
606
|
} else if i := strings.Index(host, ":"); i != -1 {
|
|
606
607
|
lastColon := strings.LastIndex(host, ":")
|
|
607
608
|
if lastColon != i {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
urlstrictcolons.
|
|
609
|
+
// RFC 3986 does not allow colons to appear in the host subcomponent.
|
|
610
|
+
//
|
|
611
|
+
// However, a number of databases including PostgreSQL and MongoDB
|
|
612
|
+
// permit a comma-separated list of hosts (with optional ports) in the
|
|
613
|
+
// host subcomponent.
|
|
614
|
+
//
|
|
615
|
+
// Since we historically permitted colons to appear in the host,
|
|
616
|
+
// enforce strict colons only for http and https URLs.
|
|
617
|
+
//
|
|
618
|
+
// See https://go.dev/issue/75223 and https://go.dev/issue/78077.
|
|
619
|
+
if scheme == "http" || scheme == "https" {
|
|
620
|
+
if urlstrictcolons.Value() == "0" {
|
|
621
|
+
urlstrictcolons.IncNonDefault()
|
|
622
|
+
i = lastColon
|
|
623
|
+
}
|
|
624
|
+
} else {
|
|
620
625
|
i = lastColon
|
|
621
626
|
}
|
|
622
627
|
}
|
|
@@ -931,6 +936,7 @@ func ParseQuery(query string) (Values, error) {
|
|
|
931
936
|
|
|
932
937
|
var urlmaxqueryparams = godebug.New("urlmaxqueryparams")
|
|
933
938
|
|
|
939
|
+
// Keep this in sync with net/http/httputil.
|
|
934
940
|
const defaultMaxParams = 10000
|
|
935
941
|
|
|
936
942
|
func urlParamsWithinMax(params int) bool {
|
|
@@ -88,7 +88,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
88
88
|
if mode == readdirName {
|
|
89
89
|
names = append(names, string(name))
|
|
90
90
|
} else if mode == readdirDirEntry {
|
|
91
|
-
de, err := newUnixDirent(f
|
|
91
|
+
de, err := newUnixDirent(f, string(name), dtToType(dirent.Type))
|
|
92
92
|
if IsNotExist(err) {
|
|
93
93
|
// File disappeared between readdir and stat.
|
|
94
94
|
// Treat as if it didn't exist.
|
|
@@ -99,7 +99,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
99
99
|
}
|
|
100
100
|
dirents = append(dirents, de)
|
|
101
101
|
} else {
|
|
102
|
-
info, err :=
|
|
102
|
+
info, err := f.lstatat(string(name))
|
|
103
103
|
if IsNotExist(err) {
|
|
104
104
|
// File disappeared between readdir + stat.
|
|
105
105
|
// Treat as if it didn't exist.
|
|
@@ -138,7 +138,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
138
138
|
if mode == readdirName {
|
|
139
139
|
names = append(names, string(name))
|
|
140
140
|
} else if mode == readdirDirEntry {
|
|
141
|
-
de, err := newUnixDirent(f
|
|
141
|
+
de, err := newUnixDirent(f, string(name), direntType(rec))
|
|
142
142
|
if IsNotExist(err) {
|
|
143
143
|
// File disappeared between readdir and stat.
|
|
144
144
|
// Treat as if it didn't exist.
|
|
@@ -149,7 +149,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
149
149
|
}
|
|
150
150
|
dirents = append(dirents, de)
|
|
151
151
|
} else {
|
|
152
|
-
info, err :=
|
|
152
|
+
info, err := f.lstatat(string(name))
|
|
153
153
|
if IsNotExist(err) {
|
|
154
154
|
// File disappeared between readdir + stat.
|
|
155
155
|
// Treat as if it didn't exist.
|
package/bin/go/src/os/file.go
CHANGED
|
@@ -428,9 +428,6 @@ func openDir(name string) (*File, error) {
|
|
|
428
428
|
return openDirNolog(name)
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
// lstat is overridden in tests.
|
|
432
|
-
var lstat = Lstat
|
|
433
|
-
|
|
434
431
|
// Rename renames (moves) oldpath to newpath.
|
|
435
432
|
// If newpath already exists and is not a directory, Rename replaces it.
|
|
436
433
|
// If newpath already exists and is a directory, Rename returns an error.
|
|
@@ -63,6 +63,7 @@ type file struct {
|
|
|
63
63
|
nonblock bool // whether we set nonblocking mode
|
|
64
64
|
stdoutOrErr bool // whether this is stdout or stderr
|
|
65
65
|
appendMode bool // whether file is opened for appending
|
|
66
|
+
inRoot bool // whether file is opened in a Root
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
// fd is the Unix implementation of Fd.
|
|
@@ -458,24 +459,27 @@ func (d *unixDirent) Info() (FileInfo, error) {
|
|
|
458
459
|
if d.info != nil {
|
|
459
460
|
return d.info, nil
|
|
460
461
|
}
|
|
461
|
-
return
|
|
462
|
+
return Lstat(d.parent + "/" + d.name)
|
|
462
463
|
}
|
|
463
464
|
|
|
464
465
|
func (d *unixDirent) String() string {
|
|
465
466
|
return fs.FormatDirEntry(d)
|
|
466
467
|
}
|
|
467
468
|
|
|
468
|
-
func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
|
|
469
|
+
func newUnixDirent(parent *File, name string, typ FileMode) (DirEntry, error) {
|
|
469
470
|
ude := &unixDirent{
|
|
470
|
-
parent: parent,
|
|
471
|
+
parent: parent.name,
|
|
471
472
|
name: name,
|
|
472
473
|
typ: typ,
|
|
473
474
|
}
|
|
474
|
-
|
|
475
|
+
// When the parent file was opened in a Root,
|
|
476
|
+
// we cannot use a lazy lstat to load the FileInfo.
|
|
477
|
+
// Use lstatat here.
|
|
478
|
+
if typ != ^FileMode(0) && !parent.inRoot {
|
|
475
479
|
return ude, nil
|
|
476
480
|
}
|
|
477
481
|
|
|
478
|
-
info, err :=
|
|
482
|
+
info, err := parent.lstatat(name)
|
|
479
483
|
if err != nil {
|
|
480
484
|
return nil, err
|
|
481
485
|
}
|
|
@@ -93,10 +93,14 @@ func removeAllFrom(parentFd sysfdType, base string) error {
|
|
|
93
93
|
if IsNotExist(err) {
|
|
94
94
|
return nil
|
|
95
95
|
}
|
|
96
|
-
if err == syscall.ENOTDIR
|
|
97
|
-
// Not a directory; return the error from the
|
|
96
|
+
if err == syscall.ENOTDIR {
|
|
97
|
+
// Not a directory; return the error from the removefileat.
|
|
98
98
|
return &PathError{Op: "unlinkat", Path: base, Err: uErr}
|
|
99
99
|
}
|
|
100
|
+
if _, ok := err.(errSymlink); ok {
|
|
101
|
+
// Not a user-visible error.
|
|
102
|
+
err = uErr
|
|
103
|
+
}
|
|
100
104
|
recurseErr = &PathError{Op: "openfdat", Path: base, Err: err}
|
|
101
105
|
break
|
|
102
106
|
}
|
|
@@ -6,14 +6,6 @@
|
|
|
6
6
|
|
|
7
7
|
package os
|
|
8
8
|
|
|
9
|
-
import (
|
|
10
|
-
"internal/syscall/unix"
|
|
11
|
-
)
|
|
12
|
-
|
|
13
|
-
func isErrNoFollow(err error) bool {
|
|
14
|
-
return err == unix.NoFollowErrno
|
|
15
|
-
}
|
|
16
|
-
|
|
17
9
|
func newDirFile(fd int, name string) (*File, error) {
|
|
18
10
|
// We use kindNoPoll because we know that this is a directory.
|
|
19
11
|
return newFile(fd, name, kindNoPoll, false), nil
|
|
@@ -104,6 +104,7 @@ func rootOpenFileNolog(root *Root, name string, flag int, perm FileMode) (*File,
|
|
|
104
104
|
return nil, &PathError{Op: "openat", Path: name, Err: err}
|
|
105
105
|
}
|
|
106
106
|
f := newFile(fd, joinPath(root.Name(), name), kindOpenFile, unix.HasNonblockFlag(flag))
|
|
107
|
+
f.inRoot = true
|
|
107
108
|
return f, nil
|
|
108
109
|
}
|
|
109
110
|
|
package/bin/go/src/os/stat.go
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build !windows
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
import (
|
|
10
|
+
"internal/testlog"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func (f *File) lstatat(name string) (FileInfo, error) {
|
|
14
|
+
if stathook != nil {
|
|
15
|
+
fi, err := stathook(f, name)
|
|
16
|
+
if fi != nil || err != nil {
|
|
17
|
+
return fi, err
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if log := testlog.Logger(); log != nil {
|
|
21
|
+
log.Stat(joinPath(f.Name(), name))
|
|
22
|
+
}
|
|
23
|
+
return f.lstatatNolog(name)
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build (js && wasm) || plan9
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
func (f *File) lstatatNolog(name string) (FileInfo, error) {
|
|
10
|
+
// These platforms don't have fstatat, so use stat instead.
|
|
11
|
+
return Lstat(f.name + "/" + name)
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build aix || darwin || dragonfly || freebsd || wasip1 || linux || netbsd || openbsd || solaris
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
import (
|
|
10
|
+
"internal/syscall/unix"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func (f *File) lstatatNolog(name string) (FileInfo, error) {
|
|
14
|
+
var fs fileStat
|
|
15
|
+
if err := f.pfd.Fstatat(name, &fs.sys, unix.AT_SYMLINK_NOFOLLOW); err != nil {
|
|
16
|
+
return nil, f.wrapErr("fstatat", err)
|
|
17
|
+
}
|
|
18
|
+
fillFileStatFromSys(&fs, name)
|
|
19
|
+
return &fs, nil
|
|
20
|
+
}
|
|
@@ -1288,9 +1288,10 @@ func (v Value) Field(i int) Value {
|
|
|
1288
1288
|
// bunch of zero-sized fields. We must return the zero-sized
|
|
1289
1289
|
// fields indirectly, as only ptr-shaped things can be direct.
|
|
1290
1290
|
// See issue 74935.
|
|
1291
|
-
// We use
|
|
1291
|
+
// We use &zeroVal[0] instead of v.ptr as it doesn't matter and
|
|
1292
1292
|
// we can avoid pinning a possibly now-unused object.
|
|
1293
|
-
|
|
1293
|
+
// Don't use nil, see issue 77779.
|
|
1294
|
+
return Value{typ, unsafe.Pointer(&zeroVal[0]), fl | flagIndir}
|
|
1294
1295
|
}
|
|
1295
1296
|
|
|
1296
1297
|
// Either flagIndir is set and v.ptr points at struct,
|
|
@@ -152,13 +152,14 @@ func (ts *timespec32) setNsec(ns int64) {
|
|
|
152
152
|
|
|
153
153
|
type timespec struct {
|
|
154
154
|
tv_sec int64
|
|
155
|
-
tv_nsec
|
|
155
|
+
tv_nsec int32
|
|
156
|
+
_ [4]byte // the C ABI aligns int64 to 8 bytes
|
|
156
157
|
}
|
|
157
158
|
|
|
158
159
|
//go:nosplit
|
|
159
160
|
func (ts *timespec) setNsec(ns int64) {
|
|
160
|
-
ts.tv_sec =
|
|
161
|
-
ts.tv_nsec =
|
|
161
|
+
ts.tv_sec = ns / 1e9
|
|
162
|
+
ts.tv_nsec = int32(ns % 1e9)
|
|
162
163
|
}
|
|
163
164
|
|
|
164
165
|
type timeval struct {
|
|
@@ -111,13 +111,14 @@ func (ts *timespec32) setNsec(ns int64) {
|
|
|
111
111
|
|
|
112
112
|
type timespec struct {
|
|
113
113
|
tv_sec int64
|
|
114
|
-
tv_nsec
|
|
114
|
+
tv_nsec int32
|
|
115
|
+
_ [4]byte // the C ABI aligns int64 to 8 bytes
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
//go:nosplit
|
|
118
119
|
func (ts *timespec) setNsec(ns int64) {
|
|
119
|
-
ts.tv_sec =
|
|
120
|
-
ts.tv_nsec =
|
|
120
|
+
ts.tv_sec = ns / 1e9
|
|
121
|
+
ts.tv_nsec = int32(ns % 1e9)
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
type stackt struct {
|
|
@@ -12,7 +12,7 @@ const (
|
|
|
12
12
|
_EINTR = 0x4
|
|
13
13
|
_EAGAIN = 0xb
|
|
14
14
|
_ENOMEM = 0xc
|
|
15
|
-
_ENOSYS =
|
|
15
|
+
_ENOSYS = 0x59
|
|
16
16
|
|
|
17
17
|
_PROT_NONE = 0x0
|
|
18
18
|
_PROT_READ = 0x1
|
|
@@ -109,13 +109,14 @@ func (ts *timespec32) setNsec(ns int64) {
|
|
|
109
109
|
|
|
110
110
|
type timespec struct {
|
|
111
111
|
tv_sec int64
|
|
112
|
-
tv_nsec
|
|
112
|
+
tv_nsec int32
|
|
113
|
+
_ [4]byte // the C ABI aligns int64 to 8 bytes
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
//go:nosplit
|
|
116
117
|
func (ts *timespec) setNsec(ns int64) {
|
|
117
|
-
ts.tv_sec =
|
|
118
|
-
ts.tv_nsec =
|
|
118
|
+
ts.tv_sec = ns / 1e9
|
|
119
|
+
ts.tv_nsec = int32(ns % 1e9)
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
type timeval struct {
|