@ttsc/linux-arm 0.13.0 → 0.14.0-dev.20260528
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/linux_arm/asm +0 -0
- package/bin/go/pkg/tool/linux_arm/cgo +0 -0
- package/bin/go/pkg/tool/linux_arm/compile +0 -0
- package/bin/go/pkg/tool/linux_arm/cover +0 -0
- package/bin/go/pkg/tool/linux_arm/fix +0 -0
- package/bin/go/pkg/tool/linux_arm/link +0 -0
- package/bin/go/pkg/tool/linux_arm/preprofile +0 -0
- package/bin/go/pkg/tool/linux_arm/vet +0 -0
- package/bin/go/src/archive/tar/format.go +0 -6
- package/bin/go/src/archive/tar/reader.go +4 -24
- package/bin/go/src/builtin/builtin.go +4 -13
- package/bin/go/src/crypto/fips140/fips140.go +0 -6
- package/bin/go/src/crypto/internal/fips140/drbg/rand.go +75 -1
- package/bin/go/src/crypto/tls/conn.go +3 -7
- 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 +3 -24
- package/bin/go/src/crypto/x509/constraints.go +33 -33
- package/bin/go/src/crypto/x509/verify.go +13 -28
- package/bin/go/src/go/types/builtins.go +2 -2
- package/bin/go/src/go/types/signature.go +0 -3
- 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 +2 -3
- package/bin/go/src/html/template/context.go +1 -21
- package/bin/go/src/html/template/element_string.go +2 -3
- package/bin/go/src/html/template/escape.go +2 -16
- package/bin/go/src/html/template/js.go +0 -1
- package/bin/go/src/html/template/state_string.go +3 -5
- package/bin/go/src/html/template/transition.go +6 -43
- package/bin/go/src/internal/buildcfg/zbootstrap.go +1 -1
- package/bin/go/src/internal/godebugs/table.go +0 -1
- package/bin/go/src/internal/poll/fd_windows.go +38 -64
- package/bin/go/src/internal/poll/sendfile_windows.go +1 -3
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_386.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_amd64.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm64.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_loong64.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mips64x.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mipsx.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_riscv64.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_s390x.go +0 -1
- package/bin/go/src/internal/runtime/syscall/linux/syscall_linux.go +0 -14
- package/bin/go/src/internal/syscall/unix/at.go +17 -0
- package/bin/go/src/internal/syscall/unix/at_sysnum_linux.go +1 -2
- package/bin/go/src/internal/syscall/windows/at_windows.go +3 -20
- package/bin/go/src/internal/syscall/windows/registry/key.go +2 -10
- package/bin/go/src/internal/syscall/windows/registry/value.go +1 -5
- package/bin/go/src/internal/syscall/windows/syscall_windows.go +0 -4
- package/bin/go/src/internal/syscall/windows/types_windows.go +0 -82
- package/bin/go/src/internal/syscall/windows/zsyscall_windows.go +0 -27
- package/bin/go/src/net/cgo_unix.go +1 -4
- package/bin/go/src/net/http/doc.go +1 -0
- package/bin/go/src/net/http/h2_bundle.go +3 -3
- package/bin/go/src/net/http/httputil/reverseproxy.go +0 -14
- package/bin/go/src/net/lookup_windows.go +3 -16
- package/bin/go/src/net/mail/message.go +9 -20
- package/bin/go/src/net/sendfile.go +0 -2
- package/bin/go/src/net/sendfile_stub.go +0 -2
- package/bin/go/src/net/sendfile_windows.go +0 -3
- package/bin/go/src/net/url/url.go +16 -22
- 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 +3 -0
- package/bin/go/src/os/file_unix.go +5 -9
- package/bin/go/src/os/removeall_at.go +2 -6
- package/bin/go/src/os/removeall_unix.go +8 -0
- package/bin/go/src/os/removeall_windows.go +4 -0
- package/bin/go/src/os/root_unix.go +0 -1
- package/bin/go/src/os/stat.go +0 -3
- package/bin/go/src/reflect/value.go +2 -3
- package/bin/go/src/runtime/defs_linux_386.go +3 -4
- package/bin/go/src/runtime/defs_linux_arm.go +3 -4
- package/bin/go/src/runtime/defs_linux_mips64x.go +1 -1
- package/bin/go/src/runtime/defs_linux_mipsx.go +4 -5
- package/bin/go/src/runtime/malloc.go +53 -1
- package/bin/go/src/runtime/mem.go +9 -104
- package/bin/go/src/runtime/metrics/doc.go +0 -5
- package/bin/go/src/runtime/os_linux.go +0 -62
- package/bin/go/src/runtime/os_linux32.go +24 -14
- package/bin/go/src/runtime/os_linux64.go +0 -2
- package/bin/go/src/runtime/print.go +4 -16
- package/bin/go/src/runtime/race/README +9 -9
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/race_darwin_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_loong64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_s390x.syso +0 -0
- package/bin/go/src/syscall/syscall_windows.go +1 -5
- package/bin/go/src/vendor/modules.txt +1 -1
- package/bin/ttsc +0 -0
- package/bin/ttscserver +0 -0
- package/package.json +2 -2
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_fips140.go +0 -97
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_wasm.go +0 -11
- package/bin/go/src/internal/poll/fstatat_unix.go +0 -22
- package/bin/go/src/internal/syscall/unix/fchmodat_linux.go +0 -51
- package/bin/go/src/internal/syscall/unix/fchmodat_other.go +0 -29
- package/bin/go/src/os/statat.go +0 -24
- package/bin/go/src/os/statat_other.go +0 -12
- package/bin/go/src/os/statat_unix.go +0 -20
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.patch +0 -63
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.patch +0 -63
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.patch +0 -63
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.patch +0 -63
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.patch +0 -63
- package/bin/go/src/runtime/race/race_darwin_arm64.patch +0 -63
- package/bin/go/src/runtime/race/race_linux_arm64.patch +0 -63
- package/bin/go/src/runtime/race/race_linux_loong64.patch +0 -63
- package/bin/go/src/runtime/race/race_linux_s390x.patch +0 -63
|
@@ -86,17 +86,3 @@ func Pread(fd int, p []byte, offset int64) (n int, errno uintptr) {
|
|
|
86
86
|
}
|
|
87
87
|
return int(r1), e
|
|
88
88
|
}
|
|
89
|
-
|
|
90
|
-
type Utsname struct {
|
|
91
|
-
Sysname [65]byte
|
|
92
|
-
Nodename [65]byte
|
|
93
|
-
Release [65]byte
|
|
94
|
-
Version [65]byte
|
|
95
|
-
Machine [65]byte
|
|
96
|
-
Domainname [65]byte
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
func Uname(buf *Utsname) (errno uintptr) {
|
|
100
|
-
_, _, e := Syscall6(SYS_UNAME, uintptr(unsafe.Pointer(buf)), 0, 0, 0, 0, 0)
|
|
101
|
-
return e
|
|
102
|
-
}
|
|
@@ -80,6 +80,23 @@ func Mkdirat(dirfd int, path string, mode uint32) error {
|
|
|
80
80
|
return nil
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
+
func Fchmodat(dirfd int, path string, mode uint32, flags int) error {
|
|
84
|
+
p, err := syscall.BytePtrFromString(path)
|
|
85
|
+
if err != nil {
|
|
86
|
+
return err
|
|
87
|
+
}
|
|
88
|
+
_, _, errno := syscall.Syscall6(fchmodatTrap,
|
|
89
|
+
uintptr(dirfd),
|
|
90
|
+
uintptr(unsafe.Pointer(p)),
|
|
91
|
+
uintptr(mode),
|
|
92
|
+
uintptr(flags),
|
|
93
|
+
0, 0)
|
|
94
|
+
if errno != 0 {
|
|
95
|
+
return errno
|
|
96
|
+
}
|
|
97
|
+
return nil
|
|
98
|
+
}
|
|
99
|
+
|
|
83
100
|
func Fchownat(dirfd int, path string, uid, gid int, flags int) error {
|
|
84
101
|
p, err := syscall.BytePtrFromString(path)
|
|
85
102
|
if err != nil {
|
|
@@ -11,6 +11,7 @@ const (
|
|
|
11
11
|
openatTrap uintptr = syscall.SYS_OPENAT
|
|
12
12
|
readlinkatTrap uintptr = syscall.SYS_READLINKAT
|
|
13
13
|
mkdiratTrap uintptr = syscall.SYS_MKDIRAT
|
|
14
|
+
fchmodatTrap uintptr = syscall.SYS_FCHMODAT
|
|
14
15
|
fchownatTrap uintptr = syscall.SYS_FCHOWNAT
|
|
15
16
|
linkatTrap uintptr = syscall.SYS_LINKAT
|
|
16
17
|
symlinkatTrap uintptr = syscall.SYS_SYMLINKAT
|
|
@@ -23,6 +24,4 @@ const (
|
|
|
23
24
|
AT_SYMLINK_NOFOLLOW = 0x100
|
|
24
25
|
|
|
25
26
|
UTIME_OMIT = 0x3ffffffe
|
|
26
|
-
|
|
27
|
-
O_PATH = 0x200000
|
|
28
27
|
)
|
|
@@ -246,31 +246,14 @@ func Deleteat(dirfd syscall.Handle, name string, options uint32) error {
|
|
|
246
246
|
var h syscall.Handle
|
|
247
247
|
err := NtOpenFile(
|
|
248
248
|
&h,
|
|
249
|
-
FILE_READ_ATTRIBUTES|DELETE,
|
|
249
|
+
SYNCHRONIZE|FILE_READ_ATTRIBUTES|DELETE,
|
|
250
250
|
objAttrs,
|
|
251
251
|
&IO_STATUS_BLOCK{},
|
|
252
252
|
FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE,
|
|
253
|
-
FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|options,
|
|
253
|
+
FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|FILE_SYNCHRONOUS_IO_NONALERT|options,
|
|
254
254
|
)
|
|
255
255
|
if err != nil {
|
|
256
|
-
|
|
257
|
-
return ntCreateFileError(err, 0)
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
// Access denied, try opening with DELETE only.
|
|
261
|
-
// This may succeed if the file has restrictive permissions
|
|
262
|
-
// but the caller has delete child permission on the parent directory.
|
|
263
|
-
err = NtOpenFile(
|
|
264
|
-
&h,
|
|
265
|
-
DELETE,
|
|
266
|
-
objAttrs,
|
|
267
|
-
&IO_STATUS_BLOCK{},
|
|
268
|
-
FILE_SHARE_DELETE|FILE_SHARE_READ|FILE_SHARE_WRITE,
|
|
269
|
-
FILE_OPEN_REPARSE_POINT|FILE_OPEN_FOR_BACKUP_INTENT|options,
|
|
270
|
-
)
|
|
271
|
-
if err != nil {
|
|
272
|
-
return ntCreateFileError(err, 0)
|
|
273
|
-
}
|
|
256
|
+
return ntCreateFileError(err, 0)
|
|
274
257
|
}
|
|
275
258
|
defer syscall.CloseHandle(h)
|
|
276
259
|
|
|
@@ -132,11 +132,7 @@ loopItems:
|
|
|
132
132
|
func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool, err error) {
|
|
133
133
|
var h syscall.Handle
|
|
134
134
|
var d uint32
|
|
135
|
-
|
|
136
|
-
if err != nil {
|
|
137
|
-
return 0, false, err
|
|
138
|
-
}
|
|
139
|
-
err = regCreateKeyEx(syscall.Handle(k), pathp,
|
|
135
|
+
err = regCreateKeyEx(syscall.Handle(k), syscall.StringToUTF16Ptr(path),
|
|
140
136
|
0, nil, _REG_OPTION_NON_VOLATILE, access, nil, &h, &d)
|
|
141
137
|
if err != nil {
|
|
142
138
|
return 0, false, err
|
|
@@ -146,11 +142,7 @@ func CreateKey(k Key, path string, access uint32) (newk Key, openedExisting bool
|
|
|
146
142
|
|
|
147
143
|
// DeleteKey deletes the subkey path of key k and its values.
|
|
148
144
|
func DeleteKey(k Key, path string) error {
|
|
149
|
-
|
|
150
|
-
if err != nil {
|
|
151
|
-
return err
|
|
152
|
-
}
|
|
153
|
-
return regDeleteKey(syscall.Handle(k), pathp)
|
|
145
|
+
return regDeleteKey(syscall.Handle(k), syscall.StringToUTF16Ptr(path))
|
|
154
146
|
}
|
|
155
147
|
|
|
156
148
|
// A KeyInfo describes the statistics of a key. It is returned by Stat.
|
|
@@ -333,11 +333,7 @@ func (k Key) SetBinaryValue(name string, value []byte) error {
|
|
|
333
333
|
|
|
334
334
|
// DeleteValue removes a named value from the key k.
|
|
335
335
|
func (k Key) DeleteValue(name string) error {
|
|
336
|
-
|
|
337
|
-
if err != nil {
|
|
338
|
-
return err
|
|
339
|
-
}
|
|
340
|
-
return regDeleteValue(syscall.Handle(k), namep)
|
|
336
|
+
return regDeleteValue(syscall.Handle(k), syscall.StringToUTF16Ptr(name))
|
|
341
337
|
}
|
|
342
338
|
|
|
343
339
|
// ReadValueNames returns the value names of key k.
|
|
@@ -561,7 +561,6 @@ const (
|
|
|
561
561
|
STATUS_NOT_SUPPORTED NTStatus = 0xC00000BB
|
|
562
562
|
STATUS_INVALID_PARAMETER NTStatus = 0xC000000D
|
|
563
563
|
STATUS_INVALID_INFO_CLASS NTStatus = 0xC0000003
|
|
564
|
-
STATUS_ACCESS_DENIED NTStatus = 0xC0000022
|
|
565
564
|
)
|
|
566
565
|
|
|
567
566
|
const (
|
|
@@ -580,6 +579,3 @@ type FILE_MODE_INFORMATION struct {
|
|
|
580
579
|
//sys NtSetInformationFile(handle syscall.Handle, iosb *IO_STATUS_BLOCK, inBuffer unsafe.Pointer, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtSetInformationFile
|
|
581
580
|
//sys RtlIsDosDeviceName_U(name *uint16) (ret uint32) = ntdll.RtlIsDosDeviceName_U
|
|
582
581
|
//sys NtQueryInformationFile(handle syscall.Handle, iosb *IO_STATUS_BLOCK, inBuffer unsafe.Pointer, inBufferLen uint32, class uint32) (ntstatus error) = ntdll.NtQueryInformationFile
|
|
583
|
-
|
|
584
|
-
//sys SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW
|
|
585
|
-
//sys SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) = advapi32.SetNamedSecurityInfoW
|
|
@@ -301,85 +301,3 @@ const ValidFileFlagsMask = O_FILE_FLAG_OPEN_REPARSE_POINT |
|
|
|
301
301
|
O_FILE_FLAG_NO_BUFFERING |
|
|
302
302
|
O_FILE_FLAG_RANDOM_ACCESS |
|
|
303
303
|
O_FILE_FLAG_WRITE_THROUGH
|
|
304
|
-
|
|
305
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379636.aspx
|
|
306
|
-
type TRUSTEE struct {
|
|
307
|
-
MultipleTrustee *TRUSTEE
|
|
308
|
-
MultipleTrusteeOperation uint32
|
|
309
|
-
TrusteeForm uint32
|
|
310
|
-
TrusteeType uint32
|
|
311
|
-
Name uintptr
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379638.aspx
|
|
315
|
-
const (
|
|
316
|
-
TRUSTEE_IS_SID = 0x0
|
|
317
|
-
TRUSTEE_IS_NAME = 0x1
|
|
318
|
-
TRUSTEE_BAD_FORM = 0x2
|
|
319
|
-
TRUSTEE_IS_OBJECTS_AND_SID = 0x3
|
|
320
|
-
TRUSTEE_IS_OBJECTS_AND_NAME = 0x4
|
|
321
|
-
)
|
|
322
|
-
|
|
323
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
|
|
324
|
-
type EXPLICIT_ACCESS struct {
|
|
325
|
-
AccessPermissions uint32
|
|
326
|
-
AccessMode uint32
|
|
327
|
-
Inheritance uint32
|
|
328
|
-
Trustee TRUSTEE
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa374899.aspx
|
|
332
|
-
const (
|
|
333
|
-
NOT_USED_ACCESS = 0x0
|
|
334
|
-
GRANT_ACCESS = 0x1
|
|
335
|
-
SET_ACCESS = 0x2
|
|
336
|
-
DENY_ACCESS = 0x3
|
|
337
|
-
REVOKE_ACCESS = 0x4
|
|
338
|
-
SET_AUDIT_SUCCESS = 0x5
|
|
339
|
-
SET_AUDIT_FAILURE = 0x6
|
|
340
|
-
)
|
|
341
|
-
|
|
342
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa446627.aspx
|
|
343
|
-
const (
|
|
344
|
-
NO_INHERITANCE = 0x0
|
|
345
|
-
SUB_OBJECTS_ONLY_INHERIT = 0x1
|
|
346
|
-
SUB_CONTAINERS_ONLY_INHERIT = 0x2
|
|
347
|
-
SUB_CONTAINERS_AND_OBJECTS_INHERIT = 0x3
|
|
348
|
-
INHERIT_NO_PROPAGATE = 0x4
|
|
349
|
-
INHERIT_ONLY = 0x8
|
|
350
|
-
)
|
|
351
|
-
|
|
352
|
-
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa379593.aspx
|
|
353
|
-
const (
|
|
354
|
-
SE_UNKNOWN_OBJECT_TYPE = 0x0
|
|
355
|
-
SE_FILE_OBJECT = 0x1
|
|
356
|
-
SE_SERVICE = 0x2
|
|
357
|
-
SE_PRINTER = 0x3
|
|
358
|
-
SE_REGISTRY_KEY = 0x4
|
|
359
|
-
SE_LMSHARE = 0x5
|
|
360
|
-
SE_KERNEL_OBJECT = 0x6
|
|
361
|
-
SE_WINDOW_OBJECT = 0x7
|
|
362
|
-
SE_DS_OBJECT = 0x8
|
|
363
|
-
SE_DS_OBJECT_ALL = 0x9
|
|
364
|
-
SE_PROVIDER_DEFINED_OBJECT = 0xa
|
|
365
|
-
SE_WMIGUID_OBJECT = 0xb
|
|
366
|
-
SE_REGISTRY_WOW64_32KEY = 0xc
|
|
367
|
-
SE_REGISTRY_WOW64_64KEY = 0xd
|
|
368
|
-
)
|
|
369
|
-
|
|
370
|
-
// https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/23e75ca3-98fd-4396-84e5-86cd9d40d343
|
|
371
|
-
const (
|
|
372
|
-
OWNER_SECURITY_INFORMATION = 0x00000001
|
|
373
|
-
GROUP_SECURITY_INFORMATION = 0x00000002
|
|
374
|
-
DACL_SECURITY_INFORMATION = 0x00000004
|
|
375
|
-
SACL_SECURITY_INFORMATION = 0x00000008
|
|
376
|
-
LABEL_SECURITY_INFORMATION = 0x00000010
|
|
377
|
-
UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000
|
|
378
|
-
UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000
|
|
379
|
-
PROTECTED_SACL_SECURITY_INFORMATION = 0x40000000
|
|
380
|
-
PROTECTED_DACL_SECURITY_INFORMATION = 0x80000000
|
|
381
|
-
ATTRIBUTE_SECURITY_INFORMATION = 0x00000020
|
|
382
|
-
SCOPE_SECURITY_INFORMATION = 0x00000040
|
|
383
|
-
PROCESS_TRUST_LABEL_SECURITY_INFORMATION = 0x00000080
|
|
384
|
-
BACKUP_SECURITY_INFORMATION = 0x00010000
|
|
385
|
-
)
|
|
@@ -62,8 +62,6 @@ 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")
|
|
67
65
|
procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation")
|
|
68
66
|
procProcessPrng = modbcryptprimitives.NewProc("ProcessPrng")
|
|
69
67
|
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
|
|
@@ -238,31 +236,6 @@ func RevertToSelf() (err error) {
|
|
|
238
236
|
return
|
|
239
237
|
}
|
|
240
238
|
|
|
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
|
-
|
|
266
239
|
func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32, tokenInformation unsafe.Pointer, tokenInformationLength uint32) (err error) {
|
|
267
240
|
r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(tokenHandle), uintptr(tokenInformationClass), uintptr(tokenInformation), uintptr(tokenInformationLength))
|
|
268
241
|
if r1 == 0 {
|
|
@@ -342,10 +342,7 @@ 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
|
|
346
|
-
// Free in a closure which captures buf to pick up a reallocated buffer from below.
|
|
347
|
-
_C_free(unsafe.Pointer(buf))
|
|
348
|
-
}()
|
|
345
|
+
defer _C_free(unsafe.Pointer(buf))
|
|
349
346
|
|
|
350
347
|
s, err := syscall.BytePtrFromString(hostname)
|
|
351
348
|
if err != nil {
|
|
@@ -10152,9 +10152,6 @@ 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
|
-
}
|
|
10158
10155
|
switch s.ID {
|
|
10159
10156
|
case http2SettingMaxFrameSize:
|
|
10160
10157
|
cc.maxFrameSize = s.Val
|
|
@@ -10186,6 +10183,9 @@ func (rl *http2clientConnReadLoop) processSettingsNoWrite(f *http2SettingsFrame)
|
|
|
10186
10183
|
cc.henc.SetMaxDynamicTableSize(s.Val)
|
|
10187
10184
|
cc.peerMaxHeaderTableSize = s.Val
|
|
10188
10185
|
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,7 +10,6 @@ import (
|
|
|
10
10
|
"context"
|
|
11
11
|
"errors"
|
|
12
12
|
"fmt"
|
|
13
|
-
"internal/godebug"
|
|
14
13
|
"io"
|
|
15
14
|
"log"
|
|
16
15
|
"mime"
|
|
@@ -923,24 +922,11 @@ func (c switchProtocolCopier) copyToBackend(errc chan<- error) {
|
|
|
923
922
|
errc <- errCopyDone
|
|
924
923
|
}
|
|
925
924
|
|
|
926
|
-
var urlmaxqueryparams = godebug.New("urlmaxqueryparams")
|
|
927
|
-
|
|
928
|
-
// Keep this in sync with net/url.
|
|
929
|
-
const defaultMaxParams = 10000
|
|
930
|
-
|
|
931
925
|
func cleanQueryParams(s string) string {
|
|
932
926
|
reencode := func(s string) string {
|
|
933
927
|
v, _ := url.ParseQuery(s)
|
|
934
928
|
return v.Encode()
|
|
935
929
|
}
|
|
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
|
-
}
|
|
944
930
|
for i := 0; i < len(s); {
|
|
945
931
|
switch s[i] {
|
|
946
932
|
case ';':
|
|
@@ -215,13 +215,8 @@ 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
|
-
|
|
223
218
|
var result *syscall.AddrinfoW
|
|
224
|
-
e := syscall.GetAddrInfoW(nil,
|
|
219
|
+
e := syscall.GetAddrInfoW(nil, syscall.StringToUTF16Ptr(service), &hints, &result)
|
|
225
220
|
if e != nil {
|
|
226
221
|
if port, err := lookupPortMap(network, service); err == nil {
|
|
227
222
|
return port, nil
|
|
@@ -274,12 +269,7 @@ func (r *Resolver) lookupCNAME(ctx context.Context, name string) (string, error)
|
|
|
274
269
|
}
|
|
275
270
|
defer syscall.DnsRecordListFree(rec, 1)
|
|
276
271
|
|
|
277
|
-
|
|
278
|
-
if err != nil {
|
|
279
|
-
return "", newDNSError(err, name, "")
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
resolved := resolveCNAME(namep, rec)
|
|
272
|
+
resolved := resolveCNAME(syscall.StringToUTF16Ptr(name), rec)
|
|
283
273
|
cname := windows.UTF16PtrToString(resolved)
|
|
284
274
|
return absDomainName(cname), nil
|
|
285
275
|
}
|
|
@@ -425,10 +415,7 @@ const dnsSectionMask = 0x0003
|
|
|
425
415
|
|
|
426
416
|
// returns only results applicable to name and resolves CNAME entries.
|
|
427
417
|
func validRecs(r *syscall.DNSRecord, dnstype uint16, name string) []*syscall.DNSRecord {
|
|
428
|
-
cname
|
|
429
|
-
if err != nil {
|
|
430
|
-
return nil
|
|
431
|
-
}
|
|
418
|
+
cname := syscall.StringToUTF16Ptr(name)
|
|
432
419
|
if dnstype != syscall.DNS_TYPE_CNAME {
|
|
433
420
|
cname = resolveCNAME(cname, r)
|
|
434
421
|
}
|
|
@@ -575,10 +575,8 @@ 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
|
-
|
|
580
|
-
sb strings.Builder
|
|
581
|
-
)
|
|
578
|
+
var words []string
|
|
579
|
+
var isPrevEncoded bool
|
|
582
580
|
for {
|
|
583
581
|
// obs-phrase allows CFWS after one word
|
|
584
582
|
if len(words) > 0 {
|
|
@@ -610,22 +608,13 @@ func (p *addrParser) consumePhrase() (phrase string, err error) {
|
|
|
610
608
|
break
|
|
611
609
|
}
|
|
612
610
|
debug.Printf("consumePhrase: consumed %q", word)
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
case !isEncoded && sb.Len() > 0:
|
|
617
|
-
words = append(words, sb.String())
|
|
618
|
-
sb.Reset()
|
|
619
|
-
words = append(words, word)
|
|
620
|
-
default:
|
|
611
|
+
if isPrevEncoded && isEncoded {
|
|
612
|
+
words[len(words)-1] += word
|
|
613
|
+
} else {
|
|
621
614
|
words = append(words, word)
|
|
622
615
|
}
|
|
616
|
+
isPrevEncoded = isEncoded
|
|
623
617
|
}
|
|
624
|
-
|
|
625
|
-
if sb.Len() > 0 {
|
|
626
|
-
words = append(words, sb.String())
|
|
627
|
-
}
|
|
628
|
-
|
|
629
618
|
// Ignore any error if we got at least one word.
|
|
630
619
|
if err != nil && len(words) == 0 {
|
|
631
620
|
debug.Printf("consumePhrase: hit err: %v", err)
|
|
@@ -843,7 +832,7 @@ func (p *addrParser) consumeComment() (string, bool) {
|
|
|
843
832
|
// '(' already consumed.
|
|
844
833
|
depth := 1
|
|
845
834
|
|
|
846
|
-
var comment
|
|
835
|
+
var comment string
|
|
847
836
|
for {
|
|
848
837
|
if p.empty() || depth == 0 {
|
|
849
838
|
break
|
|
@@ -857,12 +846,12 @@ func (p *addrParser) consumeComment() (string, bool) {
|
|
|
857
846
|
depth--
|
|
858
847
|
}
|
|
859
848
|
if depth > 0 {
|
|
860
|
-
comment
|
|
849
|
+
comment += p.s[:1]
|
|
861
850
|
}
|
|
862
851
|
p.s = p.s[1:]
|
|
863
852
|
}
|
|
864
853
|
|
|
865
|
-
return comment
|
|
854
|
+
return comment, depth == 0
|
|
866
855
|
}
|
|
867
856
|
|
|
868
857
|
func (p *addrParser) decodeRFC2047Word(s string) (word string, isEncoded bool, err error) {
|
|
@@ -12,8 +12,5 @@ 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
|
-
}
|
|
18
15
|
return windows.SupportUnlimitedTransmitFile()
|
|
19
16
|
}
|
|
@@ -2,13 +2,14 @@
|
|
|
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
|
-
|
|
7
5
|
// Package url parses URLs and implements query escaping.
|
|
8
6
|
//
|
|
9
7
|
// See RFC 3986. This package generally follows RFC 3986, except where
|
|
10
8
|
// it deviates for compatibility reasons.
|
|
11
9
|
// RFC 6874 followed for IPv6 zone literals.
|
|
10
|
+
|
|
11
|
+
//go:generate go run gen_encoding_table.go
|
|
12
|
+
|
|
12
13
|
package url
|
|
13
14
|
|
|
14
15
|
// When sending changes, first search old issues for history on decisions.
|
|
@@ -546,9 +547,7 @@ func parseAuthority(scheme, authority string) (user *Userinfo, host string, err
|
|
|
546
547
|
// parseHost parses host as an authority without user
|
|
547
548
|
// information. That is, as host[:port].
|
|
548
549
|
func parseHost(scheme, host string) (string, error) {
|
|
549
|
-
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx
|
|
550
|
-
return "", errors.New("invalid IP-literal")
|
|
551
|
-
} else if openBracketIdx == 0 {
|
|
550
|
+
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx != -1 {
|
|
552
551
|
// Parse an IP-Literal in RFC 3986 and RFC 6874.
|
|
553
552
|
// E.g., "[fe80::1]", "[fe80::1%25en0]", "[fe80::1]:80".
|
|
554
553
|
closeBracketIdx := strings.LastIndex(host, "]")
|
|
@@ -606,22 +605,18 @@ func parseHost(scheme, host string) (string, error) {
|
|
|
606
605
|
} else if i := strings.Index(host, ":"); i != -1 {
|
|
607
606
|
lastColon := strings.LastIndex(host, ":")
|
|
608
607
|
if lastColon != i {
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
urlstrictcolons.IncNonDefault()
|
|
622
|
-
i = lastColon
|
|
623
|
-
}
|
|
624
|
-
} else {
|
|
608
|
+
if scheme == "postgresql" || scheme == "postgres" {
|
|
609
|
+
// PostgreSQL relies on non-RFC-3986 parsing to accept
|
|
610
|
+
// a comma-separated list of hosts (with optional ports)
|
|
611
|
+
// in the host subcomponent:
|
|
612
|
+
// https://www.postgresql.org/docs/11/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS
|
|
613
|
+
//
|
|
614
|
+
// Since we historically permitted colons to appear in the host,
|
|
615
|
+
// continue to permit it for postgres:// URLs only.
|
|
616
|
+
// https://go.dev/issue/75223
|
|
617
|
+
i = lastColon
|
|
618
|
+
} else if urlstrictcolons.Value() == "0" {
|
|
619
|
+
urlstrictcolons.IncNonDefault()
|
|
625
620
|
i = lastColon
|
|
626
621
|
}
|
|
627
622
|
}
|
|
@@ -936,7 +931,6 @@ func ParseQuery(query string) (Values, error) {
|
|
|
936
931
|
|
|
937
932
|
var urlmaxqueryparams = godebug.New("urlmaxqueryparams")
|
|
938
933
|
|
|
939
|
-
// Keep this in sync with net/http/httputil.
|
|
940
934
|
const defaultMaxParams = 10000
|
|
941
935
|
|
|
942
936
|
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, string(name), dtToType(dirent.Type))
|
|
91
|
+
de, err := newUnixDirent(f.name, 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 := f.
|
|
102
|
+
info, err := lstat(f.name + "/" + 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, string(name), direntType(rec))
|
|
141
|
+
de, err := newUnixDirent(f.name, 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 := f.
|
|
152
|
+
info, err := lstat(f.name + "/" + 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,6 +428,9 @@ 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
|
+
|
|
431
434
|
// Rename renames (moves) oldpath to newpath.
|
|
432
435
|
// If newpath already exists and is not a directory, Rename replaces it.
|
|
433
436
|
// If newpath already exists and is a directory, Rename returns an error.
|
|
@@ -63,7 +63,6 @@ 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
|
|
67
66
|
}
|
|
68
67
|
|
|
69
68
|
// fd is the Unix implementation of Fd.
|
|
@@ -459,27 +458,24 @@ func (d *unixDirent) Info() (FileInfo, error) {
|
|
|
459
458
|
if d.info != nil {
|
|
460
459
|
return d.info, nil
|
|
461
460
|
}
|
|
462
|
-
return
|
|
461
|
+
return lstat(d.parent + "/" + d.name)
|
|
463
462
|
}
|
|
464
463
|
|
|
465
464
|
func (d *unixDirent) String() string {
|
|
466
465
|
return fs.FormatDirEntry(d)
|
|
467
466
|
}
|
|
468
467
|
|
|
469
|
-
func newUnixDirent(parent
|
|
468
|
+
func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
|
|
470
469
|
ude := &unixDirent{
|
|
471
|
-
parent: parent
|
|
470
|
+
parent: parent,
|
|
472
471
|
name: name,
|
|
473
472
|
typ: typ,
|
|
474
473
|
}
|
|
475
|
-
|
|
476
|
-
// we cannot use a lazy lstat to load the FileInfo.
|
|
477
|
-
// Use lstatat here.
|
|
478
|
-
if typ != ^FileMode(0) && !parent.inRoot {
|
|
474
|
+
if typ != ^FileMode(0) {
|
|
479
475
|
return ude, nil
|
|
480
476
|
}
|
|
481
477
|
|
|
482
|
-
info, err := parent
|
|
478
|
+
info, err := lstat(parent + "/" + name)
|
|
483
479
|
if err != nil {
|
|
484
480
|
return nil, err
|
|
485
481
|
}
|