Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package fzf for openSUSE:Factory checked in at 2024-07-08 19:09:23 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fzf (Old) and /work/SRC/openSUSE:Factory/.fzf.new.2080 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fzf" Mon Jul 8 19:09:23 2024 rev:54 rq:1186202 version:0.54.0 Changes: -------- --- /work/SRC/openSUSE:Factory/fzf/fzf.changes 2024-06-07 15:03:56.433026920 +0200 +++ /work/SRC/openSUSE:Factory/.fzf.new.2080/fzf.changes 2024-07-08 19:09:46.538065309 +0200 @@ -1,0 +2,28 @@ +Mon Jul 8 14:09:41 UTC 2024 - Joshua Smith <smolsh...@opensuse.org> + +- Add new "v" prefix to tag in URL +- Update to 0.54.0: + * Implemented line wrap of long items + * Updated shell integration scripts to leverage line wrap + * Added --info-command option for customizing the info line + * Pointer and marker signs can be set to empty strings + * Better cache management and improved rendering for --tail + * Improved --sync behavior: When --sync is provided, fzf will not + render the interface until the initial filtering and the + associated actions (bound to any of start, load, result, or + focus) are complete. + * GET endpoint is now available from execute and transform + actions (it used to timeout due to lock conflict) + * Added offset-middle action to place the current item is in the + middle of the screen + * fzf will not start the initial reader when reload or + reload-sync is bound to start event. fzf < /dev/null or : | fzf + are no longer required and extraneous load event will not fire + due to the empty list. + * Fixed crash when using --tiebreak=end with very long items + * zsh 5.0 compatibility + * Fixed --walker-skip to also skip symlinks to directories + * Fixed result event not fired when input stream is not complete + * New tags will have v prefix + +------------------------------------------------------------------- Old: ---- fzf-0.53.0.tar.gz New: ---- fzf-0.54.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fzf.spec ++++++ --- /var/tmp/diff_new_pack.LS9V1s/_old 2024-07-08 19:09:47.094085645 +0200 +++ /var/tmp/diff_new_pack.LS9V1s/_new 2024-07-08 19:09:47.098085792 +0200 @@ -18,13 +18,13 @@ %global _lto_cflags %{nil} Name: fzf -Version: 0.53.0 +Version: 0.54.0 Release: 0 Summary: A command-line fuzzy finder License: MIT Group: Productivity/File utilities URL: https://github.com/junegunn/fzf -Source0: https://github.com/junegunn/fzf/archive/refs/tags/%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source0: https://github.com/junegunn/fzf/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz Source1: vendor.tar.zst BuildRequires: zstd BuildRequires: golang(API) >= 1.19 ++++++ fzf-0.53.0.tar.gz -> fzf-0.54.0.tar.gz ++++++ ++++ 5004 lines of diff (skipped) ++++++ vendor.tar.zst ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/Makefile new/vendor/github.com/charlievieth/fastwalk/Makefile --- old/vendor/github.com/charlievieth/fastwalk/Makefile 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/Makefile 2024-07-08 16:14:30.000000000 +0200 @@ -1,3 +1,6 @@ +.PHONY: all +all: test test_build + .PHONY: test_build_darwin_arm64 test_build_darwin_arm64: GOOS=darwin GOARCH=arm64 go test -c -o /dev/null @@ -18,6 +21,10 @@ test_build_windows_amd64: GOOS=windows GOARCH=amd64 go test -c -o /dev/null +.PHONY: test_build_windows_arm64 +test_build_windows_arm64: + GOOS=windows GOARCH=arm64 go test -c -o /dev/null + .PHONY: test_build_freebsd_amd64 test_build_freebsd_amd64: GOOS=freebsd GOARCH=amd64 go test -c -o /dev/null @@ -30,19 +37,49 @@ test_build_netbsd_amd64: GOOS=netbsd GOARCH=amd64 go test -c -o /dev/null +.PHONY: test_build_dragonfly_amd64 +test_build_dragonfly_amd64: + GOOS=dragonfly GOARCH=amd64 go test -c -o /dev/null + +.PHONY: test_build_solaris_amd64 +test_build_solaris_amd64: + GOOS=solaris GOARCH=amd64 go test -c -o /dev/null + +.PHONY: test_build_wasip1_wasm +test_build_wasip1_wasm: + GOOS=wasip1 GOARCH=wasm go test -c -o /dev/null + +.PHONY: test_build_aix_ppc64 +test_build_aix_ppc64: + GOOS=aix GOARCH=ppc64 go test -c -o /dev/null + +.PHONY: test_build_js_wasm +test_build_js_wasm: + GOOS=js GOARCH=wasm go test -c -o /dev/null + +# TODO: clean this up and add all supported targets +# # Test that we can build fastwalk on multiple platforms .PHONY: test_build -test_build: test_build_darwin_arm64 test_build_darwin_amd64 \ - test_build_linux_arm64 test_build_linux_amd64 \ - test_build_windows_amd64 test_build_freebsd_amd64 \ - test_build_openbsd_amd64 test_build_netbsd_amd64 +test_build: \ + test_build_aix_ppc64 \ + test_build_darwin_amd64 \ + test_build_darwin_arm64 \ + test_build_dragonfly_amd64 \ + test_build_freebsd_amd64 \ + test_build_js_wasm \ + test_build_linux_amd64 \ + test_build_linux_arm64 \ + test_build_netbsd_amd64 \ + test_build_openbsd_amd64 \ + test_build_solaris_amd64 \ + test_build_wasip1_wasm \ + test_build_windows_amd64 \ + test_build_windows_arm64 .PHONY: test test: # runs all tests against the package with race detection and coverage percentage @go test -race -cover ./... -ifeq "$(shell go env GOOS)" "darwin" - @go test -tags nogetdirentries -race -cover ./... -endif .PHONY: quick quick: # runs all tests without coverage or the race detector @@ -50,11 +87,13 @@ .PHONY: bench bench: - @go test -run '^$' -bench . -benchmem ./... + go test -run '^$$' -bench . -benchmem ./... .PHONY: bench_comp bench_comp: @go run ./scripts/bench_comp.go -.PHONY: all -all: test test_build +.PHONY: clean +clean: + @go clean + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/README.md new/vendor/github.com/charlievieth/fastwalk/README.md --- old/vendor/github.com/charlievieth/fastwalk/README.md 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/README.md 2024-07-08 16:14:30.000000000 +0200 @@ -191,28 +191,3 @@ alloc/op 6.14MB ± 0% 6.76MB ± 0% +10.24% allocs/op 100k ± 0% 90k ± 0% -9.59% ``` - -## Darwin: getdirentries64 - -The `nogetdirentries` build tag can be used to prevent `fastwalk` from using -and linking to the non-public `__getdirentries64` syscall. This is required -if an app using `fastwalk` is to be distributed via Apple's App Store (see -https://github.com/golang/go/issues/30933 for more details). When using -`__getdirentries64` is disabled, `fastwalk` will use `readdir_r` instead, -which is what the Go standard library uses for -[`os.ReadDir`](https://pkg.go.dev/os#ReadDir) and is about \~10% slower than -`__getdirentries64` -([benchmarks](https://github.com/charlievieth/fastwalk/blob/2e6a1b8a1ce88e578279e6e631b2129f7144ec87/fastwalk_darwin_test.go#L19-L57)). - -Example of how to build and test that your program is not linked to `__getdirentries64`: -```sh -# NOTE: the following only applies to darwin (aka macOS) - -# Build binary that imports fastwalk without linking to __getdirentries64. -$ go build -tags nogetdirentries -o YOUR_BINARY -# Test that __getdirentries64 is not linked (this should print no output). -$ ! otool -dyld_info YOUR_BINARY | grep -F getdirentries64 -``` - -There is a also a script [scripts/links2getdirentries.bash](scripts/links2getdirentries.bash) -that can be used to check if a program binary links to getdirentries. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/dirent.go new/vendor/github.com/charlievieth/fastwalk/dirent.go --- old/vendor/github.com/charlievieth/fastwalk/dirent.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/dirent.go 2024-07-08 16:14:30.000000000 +0200 @@ -5,6 +5,7 @@ "os" "sync" "sync/atomic" + "syscall" "unsafe" ) @@ -36,6 +37,9 @@ // If fs.DirEntry de is a fastwalk.DirEntry it's Stat() method is used and the // returned fs.FileInfo may be a previously cached result. func StatDirEntry(path string, de fs.DirEntry) (fs.FileInfo, error) { + if de == nil { + return nil, &os.PathError{Op: "stat", Path: path, Err: syscall.EINVAL} + } if de.Type()&os.ModeSymlink == 0 { return de.Info() } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/dirent_portable.go new/vendor/github.com/charlievieth/fastwalk/dirent_portable.go --- old/vendor/github.com/charlievieth/fastwalk/dirent_portable.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/dirent_portable.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,5 +1,4 @@ -//go:build appengine || solaris || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +build appengine solaris !linux,!darwin,!freebsd,!openbsd,!netbsd +//go:build !darwin && !(aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris) package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/dirent_unix.go new/vendor/github.com/charlievieth/fastwalk/dirent_unix.go --- old/vendor/github.com/charlievieth/fastwalk/dirent_unix.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/dirent_unix.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,7 +1,4 @@ -//go:build (aix || darwin || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd) && !appengine && !solaris -// +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd -// +build !appengine -// +build !solaris +//go:build darwin || aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/entry_filter_portable.go new/vendor/github.com/charlievieth/fastwalk/entry_filter_portable.go --- old/vendor/github.com/charlievieth/fastwalk/entry_filter_portable.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/entry_filter_portable.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,5 +1,4 @@ -//go:build appengine || (!linux && !darwin && !freebsd && !openbsd && !netbsd && !windows && !solaris) -// +build appengine !linux,!darwin,!freebsd,!openbsd,!netbsd,!windows,!solaris +//go:build !darwin && !windows && !(aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris) package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/entry_filter_unix.go new/vendor/github.com/charlievieth/fastwalk/entry_filter_unix.go --- old/vendor/github.com/charlievieth/fastwalk/entry_filter_unix.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/entry_filter_unix.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,6 +1,4 @@ -//go:build (linux || darwin || freebsd || openbsd || netbsd || !windows) && !appengine -// +build linux darwin freebsd openbsd netbsd !windows -// +build !appengine +//go:build darwin || aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/entry_filter_windows.go new/vendor/github.com/charlievieth/fastwalk/entry_filter_windows.go --- old/vendor/github.com/charlievieth/fastwalk/entry_filter_windows.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/entry_filter_windows.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,5 +1,4 @@ -//go:build windows && !appengine -// +build windows,!appengine +//go:build windows package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk.go new/vendor/github.com/charlievieth/fastwalk/fastwalk.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk.go 2024-07-08 16:14:30.000000000 +0200 @@ -60,7 +60,7 @@ var SkipDir = fs.SkipDir // DefaultNumWorkers returns the default number of worker goroutines to use in -// fastwalk.Walk and is the value of runtime.GOMAXPROCS(-1) clamped to a range +// [fastwalk.Walk] and is the value of [runtime.GOMAXPROCS](-1) clamped to a range // of 4 to 32 except on Darwin where it is either 4 (8 cores or less) or 6 // (more than 8 cores). This is because Walk / IO performance on Darwin // degrades with more concurrency. @@ -87,9 +87,42 @@ return numCPU } +// DefaultToSlash returns true if this is a Go program compiled for Windows +// running in an environment ([WSL] or [MSYS/MSYS2]) that uses forward slashes +// as the path separator instead of the native backslash. +// On all other platforms this is a no-op and returns false since the native +// path separator is a forward slash and does not need to be converted. +// +// This check does not apply to programs compiled in [WSL] [MSYS/MSYS2] or for +// Linux (GOOS=linux). It only applies to Go programs compiled for Windows +// (GOOS=windows) that are executed from [WSL] or [MSYS/MSYS2]. +// +// To detect if we're running in [MSYS/MSYS2] we check that "MSYSTEM" environment +// variable is either "MINGW64", "MINGW32", or "MSYS". +// +// The following heuristics are used to detect if we're running in [WSL]: +// +// - Existence of "/proc/sys/fs/binfmt_misc/WSLInterop". +// - If the "WSL_DISTRO_NAME" environment variable is set. +// - If "/proc/version" contains either "Microsoft" or "microsoft". +// +// The result of the WSL check is cached for performance reasons. +// +// See: https://github.com/junegunn/fzf/issues/3859 +// +// [WSL]: https://learn.microsoft.com/en-us/windows/wsl/about +// [MSYS/MSYS2]: https://www.msys2.org/ +func DefaultToSlash() bool { + if runtime.GOOS != "windows" { + return false + } + return useForwardSlash() +} + // DefaultConfig is the default Config used when none is supplied. var DefaultConfig = Config{ Follow: false, + ToSlash: DefaultToSlash(), NumWorkers: DefaultNumWorkers(), } @@ -107,8 +140,22 @@ // respected. Follow bool + // Join all paths using a forward slash "/" instead of the system + // default (the root path will be converted with filepath.ToSlash). + // This option exists for users on Windows Subsystem for Linux (WSL) + // that are running a Windows executable (like FZF) in WSL and need + // forward slashes for compatibility (since binary was compiled for + // Windows the path separator will be "\" which can cause issues in + // in a Unix shell). + // + // This option has no effect when the OS path separator is a + // forward slash "/". + // + // See FZF issue: https://github.com/junegunn/fzf/issues/3859 + ToSlash bool + // Number of parallel workers to use. If NumWorkers if ⤠0 then - // the greater of runtime.NumCPU() or 4 is used. + // [DefaultNumWorkers] is used. NumWorkers int } @@ -158,13 +205,16 @@ // sentinel error. It is the walkFn's responsibility to prevent // Walk from going into symlink cycles. func Walk(conf *Config, root string, walkFn fs.WalkDirFunc) error { + fi, err := os.Stat(root) + if err != nil { + return err + } if conf == nil { dupe := DefaultConfig conf = &dupe } - fi, err := os.Lstat(root) - if err != nil { - return err + if conf.ToSlash { + root = filepath.ToSlash(root) } // Make sure to wait for all workers to finish, otherwise @@ -187,12 +237,11 @@ // buffered for correctness & not leaking goroutines: resc: make(chan error, numWorkers), - follow: conf.Follow, + follow: conf.Follow, + toSlash: conf.ToSlash, } if w.follow { - if fi, err := os.Stat(root); err == nil { - w.ignoredDirs = append(w.ignoredDirs, fi) - } + w.ignoredDirs = append(w.ignoredDirs, fi) } defer close(w.donec) @@ -270,6 +319,7 @@ ignoredDirs []os.FileInfo follow bool + toSlash bool } type walkItem struct { @@ -322,17 +372,23 @@ } } -func joinPaths(dir, base string) string { +func (w *walker) joinPaths(dir, base string) string { // Handle the case where the root path argument to Walk is "/" // without this the returned path is prefixed with "//". - if os.PathSeparator == '/' && dir == "/" { - return dir + base + if os.PathSeparator == '/' { + if dir == "/" { + return dir + base + } + return dir + "/" + base + } + if w.toSlash { + return dir + "/" + base } return dir + string(os.PathSeparator) + base } func (w *walker) onDirEnt(dirName, baseName string, de fs.DirEntry) error { - joined := joinPaths(dirName, baseName) + joined := w.joinPaths(dirName, baseName) typ := de.Type() if typ == os.ModeDir { w.enqueue(walkItem{dir: joined, info: de}) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk_darwin.go new/vendor/github.com/charlievieth/fastwalk/fastwalk_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk_darwin.go 1970-01-01 01:00:00.000000000 +0100 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk_darwin.go 2024-07-08 16:14:30.000000000 +0200 @@ -0,0 +1,98 @@ +//go:build darwin && go1.13 + +package fastwalk + +import ( + "io/fs" + "os" + "syscall" + "unsafe" +) + +//sys closedir(dir uintptr) (err error) +//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) + +func readDir(dirName string, fn func(dirName, entName string, de fs.DirEntry) error) (err error) { + var fd uintptr + for { + fd, err = opendir(dirName) + if err != syscall.EINTR { + break + } + } + if err != nil { + return &os.PathError{Op: "opendir", Path: dirName, Err: err} + } + defer closedir(fd) //nolint:errcheck + + skipFiles := false + var dirent syscall.Dirent + var entptr *syscall.Dirent + for { + if errno := readdir_r(fd, &dirent, &entptr); errno != 0 { + if errno == syscall.EINTR { + continue + } + return &os.PathError{Op: "readdir", Path: dirName, Err: errno} + } + if entptr == nil { // EOF + break + } + // Darwin may return a zero inode when a directory entry has been + // deleted but not yet removed from the directory. The man page for + // getdirentries(2) states that programs are responsible for skipping + // those entries: + // + // Users of getdirentries() should skip entries with d_fileno = 0, + // as such entries represent files which have been deleted but not + // yet removed from the directory entry. + // + if dirent.Ino == 0 { + continue + } + typ := dtToType(dirent.Type) + if skipFiles && typ.IsRegular() { + continue + } + name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] + for i, c := range name { + if c == 0 { + name = name[:i] + break + } + } + // Check for useless names before allocating a string. + if string(name) == "." || string(name) == ".." { + continue + } + nm := string(name) + if err := fn(dirName, nm, newUnixDirent(dirName, nm, typ)); err != nil { + if err != ErrSkipFiles { + return err + } + skipFiles = true + } + } + + return nil +} + +func dtToType(typ uint8) os.FileMode { + switch typ { + case syscall.DT_BLK: + return os.ModeDevice + case syscall.DT_CHR: + return os.ModeDevice | os.ModeCharDevice + case syscall.DT_DIR: + return os.ModeDir + case syscall.DT_FIFO: + return os.ModeNamedPipe + case syscall.DT_LNK: + return os.ModeSymlink + case syscall.DT_REG: + return 0 + case syscall.DT_SOCK: + return os.ModeSocket + } + return ^os.FileMode(0) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk_getdirentries_darwin.go new/vendor/github.com/charlievieth/fastwalk/fastwalk_getdirentries_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk_getdirentries_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk_getdirentries_darwin.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,130 +0,0 @@ -//go:build darwin && go1.13 && !appengine && !nogetdirentries -// +build darwin,go1.13,!appengine,!nogetdirentries - -package fastwalk - -import ( - "io/fs" - "os" - "sync" - "syscall" - "unsafe" -) - -const direntBufSize = 32 * 1024 - -var direntBufPool = sync.Pool{ - New: func() interface{} { - b := make([]byte, direntBufSize) - return &b - }, -} - -func readDir(dirName string, fn func(dirName, entName string, de fs.DirEntry) error) error { - fd, err := syscall.Open(dirName, syscall.O_RDONLY, 0) - if err != nil { - return &os.PathError{Op: "open", Path: dirName, Err: err} - } - defer syscall.Close(fd) - - p := direntBufPool.Get().(*[]byte) - defer direntBufPool.Put(p) - dbuf := *p - - var skipFiles bool - var basep uintptr - for { - length, err := getdirentries(fd, dbuf, &basep) - if err != nil { - return &os.PathError{Op: "getdirentries64", Path: dirName, Err: err} - } - if length == 0 { - break - } - buf := dbuf[:length] - - for i := 0; len(buf) > 0; i++ { - reclen, ok := direntReclen(buf) - if !ok || reclen > uint64(len(buf)) { - break - } - rec := buf[:reclen] - buf = buf[reclen:] - typ := direntType(rec) - if skipFiles && typ.IsRegular() { - continue - } - const namoff = uint64(unsafe.Offsetof(syscall.Dirent{}.Name)) - namlen, ok := direntNamlen(rec) - if !ok || namoff+namlen > uint64(len(rec)) { - break - } - name := rec[namoff : namoff+namlen] - for i, c := range name { - if c == 0 { - name = name[:i] - break - } - } - if string(name) == "." || string(name) == ".." { - continue - } - nm := string(name) - if err := fn(dirName, nm, newUnixDirent(dirName, nm, typ)); err != nil { - if err != ErrSkipFiles { - return err - } - skipFiles = true - } - } - } - - return nil -} - -// readInt returns the size-bytes unsigned integer in native byte order at offset off. -func readInt(b []byte, off, size uintptr) (uint64, bool) { - if len(b) >= int(off+size) { - p := b[off:] - _ = p[1] // bounds check hint to compiler; see golang.org/issue/14808 - return uint64(p[0]) | uint64(p[1])<<8, true - } - return 0, false -} - -// Statically assert that the size of Reclen and Namlen is 2. -var _ = ([2]int{})[unsafe.Sizeof(syscall.Dirent{}.Reclen)-1] -var _ = ([2]int{})[unsafe.Sizeof(syscall.Dirent{}.Namlen)-1] - -func direntReclen(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Reclen), unsafe.Sizeof(syscall.Dirent{}.Reclen)) -} - -func direntNamlen(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Namlen), unsafe.Sizeof(syscall.Dirent{}.Namlen)) -} - -func direntType(buf []byte) os.FileMode { - off := unsafe.Offsetof(syscall.Dirent{}.Type) - if off >= uintptr(len(buf)) { - return ^os.FileMode(0) // unknown - } - typ := buf[off] - switch typ { - case syscall.DT_BLK: - return os.ModeDevice - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice - case syscall.DT_DIR: - return os.ModeDir - case syscall.DT_FIFO: - return os.ModeNamedPipe - case syscall.DT_LNK: - return os.ModeSymlink - case syscall.DT_REG: - return 0 - case syscall.DT_SOCK: - return os.ModeSocket - } - return ^os.FileMode(0) -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk_nogetdirentries_darwin.go new/vendor/github.com/charlievieth/fastwalk/fastwalk_nogetdirentries_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk_nogetdirentries_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk_nogetdirentries_darwin.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,84 +0,0 @@ -//go:build darwin && go1.13 && !appengine && nogetdirentries -// +build darwin,go1.13,!appengine,nogetdirentries - -package fastwalk - -import ( - "io/fs" - "os" - "syscall" - "unsafe" -) - -//sys closedir(dir uintptr) (err error) -//sys readdir_r(dir uintptr, entry *Dirent, result **Dirent) (res Errno) - -func readDir(dirName string, fn func(dirName, entName string, de fs.DirEntry) error) error { - fd, err := opendir(dirName) - if err != nil { - return &os.PathError{Op: "opendir", Path: dirName, Err: err} - } - defer closedir(fd) //nolint:errcheck - - skipFiles := false - var dirent syscall.Dirent - var entptr *syscall.Dirent - for { - if errno := readdir_r(fd, &dirent, &entptr); errno != 0 { - if errno == syscall.EINTR { - continue - } - return &os.PathError{Op: "readdir", Path: dirName, Err: errno} - } - if entptr == nil { // EOF - break - } - if dirent.Ino == 0 { - continue - } - typ := dtToType(dirent.Type) - if skipFiles && typ.IsRegular() { - continue - } - name := (*[len(syscall.Dirent{}.Name)]byte)(unsafe.Pointer(&dirent.Name))[:] - for i, c := range name { - if c == 0 { - name = name[:i] - break - } - } - // Check for useless names before allocating a string. - if string(name) == "." || string(name) == ".." { - continue - } - nm := string(name) - if err := fn(dirName, nm, newUnixDirent(dirName, nm, typ)); err != nil { - if err != ErrSkipFiles { - return err - } - skipFiles = true - } - } - - return nil -} - -func dtToType(typ uint8) os.FileMode { - switch typ { - case syscall.DT_BLK: - return os.ModeDevice - case syscall.DT_CHR: - return os.ModeDevice | os.ModeCharDevice - case syscall.DT_DIR: - return os.ModeDir - case syscall.DT_FIFO: - return os.ModeNamedPipe - case syscall.DT_LNK: - return os.ModeSymlink - case syscall.DT_REG: - return 0 - case syscall.DT_SOCK: - return os.ModeSocket - } - return ^os.FileMode(0) -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk_portable.go new/vendor/github.com/charlievieth/fastwalk/fastwalk_portable.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk_portable.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk_portable.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,5 +1,4 @@ -//go:build appengine || solaris || (!linux && !darwin && !freebsd && !openbsd && !netbsd) -// +build appengine solaris !linux,!darwin,!freebsd,!openbsd,!netbsd +//go:build !darwin && !(aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris) package fastwalk diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/fastwalk_unix.go new/vendor/github.com/charlievieth/fastwalk/fastwalk_unix.go --- old/vendor/github.com/charlievieth/fastwalk/fastwalk_unix.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/fastwalk_unix.go 2024-07-08 16:14:30.000000000 +0200 @@ -2,9 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build (linux || freebsd || openbsd || netbsd) && !appengine -// +build linux freebsd openbsd netbsd -// +build !appengine +//go:build aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris package fastwalk @@ -21,7 +19,7 @@ // unknownFileMode is a sentinel (and bogus) os.FileMode // value used to represent a syscall.DT_UNKNOWN Dirent.Type. -const unknownFileMode os.FileMode = os.ModeNamedPipe | os.ModeSocket | os.ModeDevice +const unknownFileMode os.FileMode = ^os.FileMode(0) func readDir(dirName string, fn func(dirName, entName string, de fs.DirEntry) error) error { fd, err := open(dirName, 0, 0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent.go new/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent.go --- old/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,4 +1,4 @@ -//go:build aix || dragonfly || freebsd || (js && wasm) || wasip1 || linux || netbsd || openbsd || solaris +//go:build aix || dragonfly || freebsd || (js && wasm) || linux || netbsd || openbsd || solaris package dirent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_wasip1.go new/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_wasip1.go --- old/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_wasip1.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/internal/dirent/dirent_wasip1.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,53 +0,0 @@ -// Copyright 2023 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -//go:build wasip1 - -package dirent - -import ( - "os" - "syscall" - "unsafe" -) - -// https://github.com/WebAssembly/WASI/blob/main/legacy/preview1/docs.md#-dirent-record -const sizeOfDirent = 24 - -func direntIno(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Ino), unsafe.Sizeof(syscall.Dirent{}.Ino)) -} - -func direntReclen(buf []byte) (uint64, bool) { - namelen, ok := direntNamlen(buf) - return sizeOfDirent + namelen, ok -} - -func direntNamlen(buf []byte) (uint64, bool) { - return readInt(buf, unsafe.Offsetof(syscall.Dirent{}.Namlen), unsafe.Sizeof(syscall.Dirent{}.Namlen)) -} - -func direntType(buf []byte) os.FileMode { - off := unsafe.Offsetof(syscall.Dirent{}.Type) - if off >= uintptr(len(buf)) { - return ^os.FileMode(0) // unknown - } - switch syscall.Filetype(buf[off]) { - case syscall.FILETYPE_BLOCK_DEVICE: - return os.ModeDevice - case syscall.FILETYPE_CHARACTER_DEVICE: - return os.ModeDevice | os.ModeCharDevice - case syscall.FILETYPE_DIRECTORY: - return os.ModeDir - case syscall.FILETYPE_REGULAR_FILE: - return 0 - case syscall.FILETYPE_SOCKET_DGRAM: - return os.ModeSocket - case syscall.FILETYPE_SOCKET_STREAM: - return os.ModeSocket - case syscall.FILETYPE_SYMBOLIC_LINK: - return os.ModeSymlink - } - return ^os.FileMode(0) // unknown -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/path_portable.go new/vendor/github.com/charlievieth/fastwalk/path_portable.go --- old/vendor/github.com/charlievieth/fastwalk/path_portable.go 1970-01-01 01:00:00.000000000 +0100 +++ new/vendor/github.com/charlievieth/fastwalk/path_portable.go 2024-07-08 16:14:30.000000000 +0200 @@ -0,0 +1,7 @@ +//go:build !windows + +package fastwalk + +func useForwardSlash() bool { + return false +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/path_windows.go new/vendor/github.com/charlievieth/fastwalk/path_windows.go --- old/vendor/github.com/charlievieth/fastwalk/path_windows.go 1970-01-01 01:00:00.000000000 +0100 +++ new/vendor/github.com/charlievieth/fastwalk/path_windows.go 2024-07-08 16:14:30.000000000 +0200 @@ -0,0 +1,62 @@ +//go:build windows + +package fastwalk + +import ( + "bytes" + "os" + "runtime" + "sync" +) + +func useForwardSlash() bool { + // Use a forward slash as the path separator if this a Windows executable + // running in either MSYS/MSYS2 or WSL. + return runningUnderMSYS() || runningUnderWSL() +} + +// runningUnderMSYS reports if we're running in a MSYS/MSYS2 enviroment. +// +// See: https://github.com/sharkdp/fd/pull/730 +func runningUnderMSYS() bool { + switch os.Getenv("MSYSTEM") { + case "MINGW64", "MINGW32", "MSYS": + return true + } + return false +} + +var underWSL struct { + once sync.Once + wsl bool +} + +// runningUnderWSL returns if we're a Widows executable running in WSL. +// See [DefaultToSlash] for an explanation of the heuristics used here. +func runningUnderWSL() bool { + if runtime.GOOS != "windows" { + return false + } + w := &underWSL + w.once.Do(func() { + w.wsl = func() bool { + // Best check (but not super fast) + if _, err := os.Lstat("/proc/sys/fs/binfmt_misc/WSLInterop"); err == nil { + return true + } + // Fast check, but could provide a false positive if the user sets + // this on the Windows side. + if os.Getenv("WSL_DISTRO_NAME") != "" { + return true + } + // If the binary is compiled for Windows and we're running under Linux + // then honestly just the presence of "/proc/version" should be enough + // to determine that we're running under WSL, but check the version + // string just to be pedantic. + data, _ := os.ReadFile("/proc/version") + return bytes.Contains(data, []byte("microsoft")) || + bytes.Contains(data, []byte("Microsoft")) + }() + }) + return w.wsl +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin.go new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin.go 2024-07-08 16:14:30.000000000 +0200 @@ -1,9 +1,68 @@ -//go:build darwin && go1.12 -// +build darwin,go1.12 +//go:build darwin && go1.13 +// +build darwin,go1.13 package fastwalk -import "syscall" +import ( + "strings" + "syscall" + "unsafe" +) + +// TODO: consider using "go linkname" for everything but "opendir" which is not +// implemented in the stdlib + +// Implemented in the runtime package (runtime/sys_darwin.go) +func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) +func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) + +//go:linkname syscall_syscall syscall.syscall +//go:linkname syscall_syscallPtr syscall.syscallPtr + +func closedir(dir uintptr) (err error) { + _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, dir, 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_closedir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" + +func readdir_r(dir uintptr, entry *syscall.Dirent, result **syscall.Dirent) syscall.Errno { + res, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, dir, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) + return syscall.Errno(res) +} + +var libc_readdir_r_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" + +func opendir(path string) (dir uintptr, err error) { + // We implent opendir so that we don't have to open a file, duplicate + // it's FD, then call fdopendir with it. + + var buf [1024]byte // Tested by TestFastWalk_LongPath + if len(path) >= len(buf) { + return 0, errEINVAL + } + if strings.IndexByte(path, 0) != -1 { + return 0, errEINVAL + } + copy(buf[:], path) + buf[len(path)] = 0 + r0, _, e1 := syscall_syscallPtr(libc_opendir_trampoline_addr, uintptr(unsafe.Pointer(&buf[0])), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return r0, err +} + +var libc_opendir_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_opendir opendir "/usr/lib/libSystem.B.dylib" // Copied from syscall/syscall_unix.go diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_amd64.1_13.s new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_amd64.1_13.s --- old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_amd64.1_13.s 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_amd64.1_13.s 2024-07-08 16:14:30.000000000 +0200 @@ -20,9 +20,3 @@ GLOBL ·libc_opendir_trampoline_addr(SB), RODATA, $8 DATA ·libc_opendir_trampoline_addr(SB)/8, $libc_opendir_trampoline<>(SB) - -TEXT libc___getdirentries64_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) - -GLOBL ·libc___getdirentries64_trampoline_addr(SB), RODATA, $8 -DATA ·libc___getdirentries64_trampoline_addr(SB)/8, $libc___getdirentries64_trampoline<>(SB) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_arm64.1_13.s new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_arm64.1_13.s --- old/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_arm64.1_13.s 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/zsyscall_darwin_arm64.1_13.s 2024-07-08 16:14:30.000000000 +0200 @@ -20,9 +20,3 @@ GLOBL ·libc_opendir_trampoline_addr(SB), RODATA, $8 DATA ·libc_opendir_trampoline_addr(SB)/8, $libc_opendir_trampoline<>(SB) - -TEXT libc___getdirentries64_trampoline<>(SB),NOSPLIT,$0-0 - JMP libc___getdirentries64(SB) - -GLOBL ·libc___getdirentries64_trampoline_addr(SB), RODATA, $8 -DATA ·libc___getdirentries64_trampoline_addr(SB)/8, $libc___getdirentries64_trampoline<>(SB) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/zsyscall_getdirentries_darwin.go new/vendor/github.com/charlievieth/fastwalk/zsyscall_getdirentries_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/zsyscall_getdirentries_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/zsyscall_getdirentries_darwin.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,40 +0,0 @@ -//go:build !nogetdirentries && darwin && go1.12 -// +build !nogetdirentries,darwin,go1.12 - -package fastwalk - -import ( - "syscall" - "unsafe" -) - -// Implemented in the runtime package (runtime/sys_darwin.go) -func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err syscall.Errno) - -//go:linkname syscall_syscall6 syscall.syscall6 - -// Single-word zero for use when we need a valid pointer to 0 bytes. -var _zero uintptr - -func getdirentries(fd int, buf []byte, basep *uintptr) (n int, err error) { - var _p0 unsafe.Pointer - if len(buf) > 0 { - _p0 = unsafe.Pointer(&buf[0]) - } else { - _p0 = unsafe.Pointer(&_zero) - } - r0, _, e1 := syscall_syscall6(libc___getdirentries64_trampoline_addr, - uintptr(fd), uintptr(_p0), uintptr(len(buf)), uintptr(unsafe.Pointer(basep)), - 0, 0) - n = int(r0) - if e1 != 0 { - err = errnoErr(e1) - } else if n < 0 { - err = errnoErr(syscall.EINVAL) - } - return -} - -var libc___getdirentries64_trampoline_addr uintptr - -//go:cgo_import_dynamic libc___getdirentries64 __getdirentries64 "/usr/lib/libSystem.B.dylib" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/github.com/charlievieth/fastwalk/zsyscall_nogetdirentries_darwin.go new/vendor/github.com/charlievieth/fastwalk/zsyscall_nogetdirentries_darwin.go --- old/vendor/github.com/charlievieth/fastwalk/zsyscall_nogetdirentries_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/github.com/charlievieth/fastwalk/zsyscall_nogetdirentries_darwin.go 1970-01-01 01:00:00.000000000 +0100 @@ -1,55 +0,0 @@ -//go:build nogetdirentries && darwin && go1.12 -// +build nogetdirentries,darwin,go1.12 - -package fastwalk - -import ( - "syscall" - "unsafe" -) - -// Implemented in the runtime package (runtime/sys_darwin.go) -func syscall_syscall(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) -func syscall_syscallPtr(fn, a1, a2, a3 uintptr) (r1, r2 uintptr, err syscall.Errno) - -//go:linkname syscall_syscall syscall.syscall -//go:linkname syscall_syscallPtr syscall.syscallPtr - -func closedir(dir uintptr) (err error) { - _, _, e1 := syscall_syscall(libc_closedir_trampoline_addr, dir, 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return -} - -var libc_closedir_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_closedir closedir "/usr/lib/libSystem.B.dylib" - -func readdir_r(dir uintptr, entry *syscall.Dirent, result **syscall.Dirent) syscall.Errno { - res, _, _ := syscall_syscall(libc_readdir_r_trampoline_addr, dir, uintptr(unsafe.Pointer(entry)), uintptr(unsafe.Pointer(result))) - return syscall.Errno(res) -} - -var libc_readdir_r_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_readdir_r readdir_r "/usr/lib/libSystem.B.dylib" - -func opendir(path string) (dir uintptr, err error) { - // We implent opendir so that we don't have to open a file, duplicate - // it's FD, then call fdopendir with it. - p, err := syscall.BytePtrFromString(path) - if err != nil { - return 0, err - } - r0, _, e1 := syscall_syscallPtr(libc_opendir_trampoline_addr, uintptr(unsafe.Pointer(p)), 0, 0) - if e1 != 0 { - err = errnoErr(e1) - } - return r0, err -} - -var libc_opendir_trampoline_addr uintptr - -//go:cgo_import_dynamic libc_opendir opendir "/usr/lib/libSystem.B.dylib" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/mkerrors.sh new/vendor/golang.org/x/sys/unix/mkerrors.sh --- old/vendor/golang.org/x/sys/unix/mkerrors.sh 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/mkerrors.sh 2024-07-08 16:14:30.000000000 +0200 @@ -263,6 +263,7 @@ #include <linux/sched.h> #include <linux/seccomp.h> #include <linux/serial.h> +#include <linux/sock_diag.h> #include <linux/sockios.h> #include <linux/taskstats.h> #include <linux/tipc.h> @@ -549,6 +550,7 @@ $2 !~ "NLA_TYPE_MASK" && $2 !~ /^RTC_VL_(ACCURACY|BACKUP|DATA)/ && $2 ~ /^(NETLINK|NLM|NLMSG|NLA|IFA|IFAN|RT|RTC|RTCF|RTN|RTPROT|RTNH|ARPHRD|ETH_P|NETNSA)_/ || + $2 ~ /^SOCK_|SK_DIAG_|SKNLGRP_$/ || $2 ~ /^FIORDCHK$/ || $2 ~ /^SIOC/ || $2 ~ /^TIOC/ || diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/mremap.go new/vendor/golang.org/x/sys/unix/mremap.go --- old/vendor/golang.org/x/sys/unix/mremap.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/mremap.go 2024-07-08 16:14:30.000000000 +0200 @@ -50,3 +50,8 @@ func Mremap(oldData []byte, newLength int, flags int) (data []byte, err error) { return mapper.Mremap(oldData, newLength, flags) } + +func MremapPtr(oldAddr unsafe.Pointer, oldSize uintptr, newAddr unsafe.Pointer, newSize uintptr, flags int) (ret unsafe.Pointer, err error) { + xaddr, err := mapper.mremap(uintptr(oldAddr), oldSize, newSize, flags, uintptr(newAddr)) + return unsafe.Pointer(xaddr), err +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/syscall_darwin.go new/vendor/golang.org/x/sys/unix/syscall_darwin.go --- old/vendor/golang.org/x/sys/unix/syscall_darwin.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/syscall_darwin.go 2024-07-08 16:14:30.000000000 +0200 @@ -542,6 +542,18 @@ } } +//sys pthread_chdir_np(path string) (err error) + +func PthreadChdir(path string) (err error) { + return pthread_chdir_np(path) +} + +//sys pthread_fchdir_np(fd int) (err error) + +func PthreadFchdir(fd int) (err error) { + return pthread_fchdir_np(fd) +} + //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/syscall_unix.go new/vendor/golang.org/x/sys/unix/syscall_unix.go --- old/vendor/golang.org/x/sys/unix/syscall_unix.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/syscall_unix.go 2024-07-08 16:14:30.000000000 +0200 @@ -154,6 +154,15 @@ return mapper.Munmap(b) } +func MmapPtr(fd int, offset int64, addr unsafe.Pointer, length uintptr, prot int, flags int) (ret unsafe.Pointer, err error) { + xaddr, err := mapper.mmap(uintptr(addr), length, prot, flags, fd, offset) + return unsafe.Pointer(xaddr), err +} + +func MunmapPtr(addr unsafe.Pointer, length uintptr) (err error) { + return mapper.munmap(uintptr(addr), length) +} + func Read(fd int, p []byte) (n int, err error) { n, err = read(fd, p) if raceenabled { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zerrors_linux.go new/vendor/golang.org/x/sys/unix/zerrors_linux.go --- old/vendor/golang.org/x/sys/unix/zerrors_linux.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zerrors_linux.go 2024-07-08 16:14:30.000000000 +0200 @@ -502,6 +502,7 @@ BPF_IMM = 0x0 BPF_IND = 0x40 BPF_JA = 0x0 + BPF_JCOND = 0xe0 BPF_JEQ = 0x10 BPF_JGE = 0x30 BPF_JGT = 0x20 @@ -657,6 +658,9 @@ CAN_NPROTO = 0x8 CAN_RAW = 0x1 CAN_RAW_FILTER_MAX = 0x200 + CAN_RAW_XL_VCID_RX_FILTER = 0x4 + CAN_RAW_XL_VCID_TX_PASS = 0x2 + CAN_RAW_XL_VCID_TX_SET = 0x1 CAN_RTR_FLAG = 0x40000000 CAN_SFF_ID_BITS = 0xb CAN_SFF_MASK = 0x7ff @@ -1339,6 +1343,7 @@ F_OFD_SETLK = 0x25 F_OFD_SETLKW = 0x26 F_OK = 0x0 + F_SEAL_EXEC = 0x20 F_SEAL_FUTURE_WRITE = 0x10 F_SEAL_GROW = 0x4 F_SEAL_SEAL = 0x1 @@ -1627,6 +1632,7 @@ IP_FREEBIND = 0xf IP_HDRINCL = 0x3 IP_IPSEC_POLICY = 0x10 + IP_LOCAL_PORT_RANGE = 0x33 IP_MAXPACKET = 0xffff IP_MAX_MEMBERSHIPS = 0x14 IP_MF = 0x2000 @@ -1653,6 +1659,7 @@ IP_PMTUDISC_OMIT = 0x5 IP_PMTUDISC_PROBE = 0x3 IP_PMTUDISC_WANT = 0x1 + IP_PROTOCOL = 0x34 IP_RECVERR = 0xb IP_RECVERR_RFC4884 = 0x1a IP_RECVFRAGSIZE = 0x19 @@ -2169,7 +2176,7 @@ NFT_SECMARK_CTX_MAXLEN = 0x100 NFT_SET_MAXNAMELEN = 0x100 NFT_SOCKET_MAX = 0x3 - NFT_TABLE_F_MASK = 0x3 + NFT_TABLE_F_MASK = 0x7 NFT_TABLE_MAXNAMELEN = 0x100 NFT_TRACETYPE_MAX = 0x3 NFT_TUNNEL_F_MASK = 0x7 @@ -2403,6 +2410,7 @@ PERF_RECORD_MISC_USER = 0x2 PERF_SAMPLE_BRANCH_PLM_ALL = 0x7 PERF_SAMPLE_WEIGHT_TYPE = 0x1004000 + PID_FS_MAGIC = 0x50494446 PIPEFS_MAGIC = 0x50495045 PPPIOCGNPMODE = 0xc008744c PPPIOCNEWUNIT = 0xc004743e @@ -2896,8 +2904,9 @@ RWF_APPEND = 0x10 RWF_DSYNC = 0x2 RWF_HIPRI = 0x1 + RWF_NOAPPEND = 0x20 RWF_NOWAIT = 0x8 - RWF_SUPPORTED = 0x1f + RWF_SUPPORTED = 0x3f RWF_SYNC = 0x4 RWF_WRITE_LIFE_NOT_SET = 0x0 SCHED_BATCH = 0x3 @@ -2918,7 +2927,9 @@ SCHED_RESET_ON_FORK = 0x40000000 SCHED_RR = 0x2 SCM_CREDENTIALS = 0x2 + SCM_PIDFD = 0x4 SCM_RIGHTS = 0x1 + SCM_SECURITY = 0x3 SCM_TIMESTAMP = 0x1d SC_LOG_FLUSH = 0x100000 SECCOMP_ADDFD_FLAG_SEND = 0x2 @@ -3051,6 +3062,8 @@ SIOCSMIIREG = 0x8949 SIOCSRARP = 0x8962 SIOCWANDEV = 0x894a + SK_DIAG_BPF_STORAGE_MAX = 0x3 + SK_DIAG_BPF_STORAGE_REQ_MAX = 0x1 SMACK_MAGIC = 0x43415d53 SMART_AUTOSAVE = 0xd2 SMART_AUTO_OFFLINE = 0xdb @@ -3071,6 +3084,8 @@ SOCKFS_MAGIC = 0x534f434b SOCK_BUF_LOCK_MASK = 0x3 SOCK_DCCP = 0x6 + SOCK_DESTROY = 0x15 + SOCK_DIAG_BY_FAMILY = 0x14 SOCK_IOC_TYPE = 0x89 SOCK_PACKET = 0xa SOCK_RAW = 0x3 @@ -3260,6 +3275,7 @@ TCP_MAX_WINSHIFT = 0xe TCP_MD5SIG = 0xe TCP_MD5SIG_EXT = 0x20 + TCP_MD5SIG_FLAG_IFINDEX = 0x2 TCP_MD5SIG_FLAG_PREFIX = 0x1 TCP_MD5SIG_MAXKEYLEN = 0x50 TCP_MSS = 0x200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zerrors_linux_386.go new/vendor/golang.org/x/sys/unix/zerrors_linux_386.go --- old/vendor/golang.org/x/sys/unix/zerrors_linux_386.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zerrors_linux_386.go 2024-07-08 16:14:30.000000000 +0200 @@ -118,6 +118,7 @@ IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go new/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go --- old/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go 2024-07-08 16:14:30.000000000 +0200 @@ -118,6 +118,7 @@ IXOFF = 0x1000 IXON = 0x400 MAP_32BIT = 0x40 + MAP_ABOVE4G = 0x80 MAP_ANON = 0x20 MAP_ANONYMOUS = 0x20 MAP_DENYWRITE = 0x800 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go new/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go --- old/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go 2024-07-08 16:14:30.000000000 +0200 @@ -87,6 +87,7 @@ FICLONE = 0x40049409 FICLONERANGE = 0x4020940d FLUSHO = 0x1000 + FPMR_MAGIC = 0x46504d52 FPSIMD_MAGIC = 0x46508001 FS_IOC_ENABLE_VERITY = 0x40806685 FS_IOC_GETFLAGS = 0x80086601 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go new/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go --- old/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go 2024-07-08 16:14:30.000000000 +0200 @@ -760,6 +760,39 @@ // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pthread_chdir_np(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_chdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pthread_fchdir_np(fd int) (err error) { + _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_fchdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s new/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s --- old/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.s 2024-07-08 16:14:30.000000000 +0200 @@ -228,6 +228,16 @@ GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_chdir_np(SB) +GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) + +TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_fchdir_np(SB) +GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go new/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go --- old/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.go 2024-07-08 16:14:30.000000000 +0200 @@ -760,6 +760,39 @@ // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT +func pthread_chdir_np(path string) (err error) { + var _p0 *byte + _p0, err = BytePtrFromString(path) + if err != nil { + return + } + _, _, e1 := syscall_syscall(libc_pthread_chdir_np_trampoline_addr, uintptr(unsafe.Pointer(_p0)), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_chdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_chdir_np pthread_chdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + +func pthread_fchdir_np(fd int) (err error) { + _, _, e1 := syscall_syscall(libc_pthread_fchdir_np_trampoline_addr, uintptr(fd), 0, 0) + if e1 != 0 { + err = errnoErr(e1) + } + return +} + +var libc_pthread_fchdir_np_trampoline_addr uintptr + +//go:cgo_import_dynamic libc_pthread_fchdir_np pthread_fchdir_np "/usr/lib/libSystem.B.dylib" + +// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT + func sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) { _, _, e1 := syscall_syscall6(libc_sendfile_trampoline_addr, uintptr(infd), uintptr(outfd), uintptr(offset), uintptr(unsafe.Pointer(len)), uintptr(hdtr), uintptr(flags)) if e1 != 0 { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s new/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s --- old/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/zsyscall_darwin_arm64.s 2024-07-08 16:14:30.000000000 +0200 @@ -228,6 +228,16 @@ GLOBL ·libc_sysctl_trampoline_addr(SB), RODATA, $8 DATA ·libc_sysctl_trampoline_addr(SB)/8, $libc_sysctl_trampoline<>(SB) +TEXT libc_pthread_chdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_chdir_np(SB) +GLOBL ·libc_pthread_chdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_chdir_np_trampoline_addr(SB)/8, $libc_pthread_chdir_np_trampoline<>(SB) + +TEXT libc_pthread_fchdir_np_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_pthread_fchdir_np(SB) +GLOBL ·libc_pthread_fchdir_np_trampoline_addr(SB), RODATA, $8 +DATA ·libc_pthread_fchdir_np_trampoline_addr(SB)/8, $libc_pthread_fchdir_np_trampoline<>(SB) + TEXT libc_sendfile_trampoline<>(SB),NOSPLIT,$0-0 JMP libc_sendfile(SB) GLOBL ·libc_sendfile_trampoline_addr(SB), RODATA, $8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/unix/ztypes_linux.go new/vendor/golang.org/x/sys/unix/ztypes_linux.go --- old/vendor/golang.org/x/sys/unix/ztypes_linux.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/unix/ztypes_linux.go 2024-07-08 16:14:30.000000000 +0200 @@ -4605,7 +4605,7 @@ NL80211_ATTR_MAC_HINT = 0xc8 NL80211_ATTR_MAC_MASK = 0xd7 NL80211_ATTR_MAX_AP_ASSOC_STA = 0xca - NL80211_ATTR_MAX = 0x149 + NL80211_ATTR_MAX = 0x14a NL80211_ATTR_MAX_CRIT_PROT_DURATION = 0xb4 NL80211_ATTR_MAX_CSA_COUNTERS = 0xce NL80211_ATTR_MAX_MATCH_SETS = 0x85 @@ -5209,7 +5209,7 @@ NL80211_FREQUENCY_ATTR_GO_CONCURRENT = 0xf NL80211_FREQUENCY_ATTR_INDOOR_ONLY = 0xe NL80211_FREQUENCY_ATTR_IR_CONCURRENT = 0xf - NL80211_FREQUENCY_ATTR_MAX = 0x1f + NL80211_FREQUENCY_ATTR_MAX = 0x20 NL80211_FREQUENCY_ATTR_MAX_TX_POWER = 0x6 NL80211_FREQUENCY_ATTR_NO_10MHZ = 0x11 NL80211_FREQUENCY_ATTR_NO_160MHZ = 0xc @@ -5703,7 +5703,7 @@ NL80211_STA_FLAG_ASSOCIATED = 0x7 NL80211_STA_FLAG_AUTHENTICATED = 0x5 NL80211_STA_FLAG_AUTHORIZED = 0x1 - NL80211_STA_FLAG_MAX = 0x7 + NL80211_STA_FLAG_MAX = 0x8 NL80211_STA_FLAG_MAX_OLD_API = 0x6 NL80211_STA_FLAG_MFP = 0x4 NL80211_STA_FLAG_SHORT_PREAMBLE = 0x2 @@ -6001,3 +6001,34 @@ Off uint64 Len uint64 } + +const ( + SK_MEMINFO_RMEM_ALLOC = 0x0 + SK_MEMINFO_RCVBUF = 0x1 + SK_MEMINFO_WMEM_ALLOC = 0x2 + SK_MEMINFO_SNDBUF = 0x3 + SK_MEMINFO_FWD_ALLOC = 0x4 + SK_MEMINFO_WMEM_QUEUED = 0x5 + SK_MEMINFO_OPTMEM = 0x6 + SK_MEMINFO_BACKLOG = 0x7 + SK_MEMINFO_DROPS = 0x8 + SK_MEMINFO_VARS = 0x9 + SKNLGRP_NONE = 0x0 + SKNLGRP_INET_TCP_DESTROY = 0x1 + SKNLGRP_INET_UDP_DESTROY = 0x2 + SKNLGRP_INET6_TCP_DESTROY = 0x3 + SKNLGRP_INET6_UDP_DESTROY = 0x4 + SK_DIAG_BPF_STORAGE_REQ_NONE = 0x0 + SK_DIAG_BPF_STORAGE_REQ_MAP_FD = 0x1 + SK_DIAG_BPF_STORAGE_REP_NONE = 0x0 + SK_DIAG_BPF_STORAGE = 0x1 + SK_DIAG_BPF_STORAGE_NONE = 0x0 + SK_DIAG_BPF_STORAGE_PAD = 0x1 + SK_DIAG_BPF_STORAGE_MAP_ID = 0x2 + SK_DIAG_BPF_STORAGE_MAP_VALUE = 0x3 +) + +type SockDiagReq struct { + Family uint8 + Protocol uint8 +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/windows/security_windows.go new/vendor/golang.org/x/sys/windows/security_windows.go --- old/vendor/golang.org/x/sys/windows/security_windows.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/windows/security_windows.go 2024-07-08 16:14:31.000000000 +0200 @@ -68,6 +68,7 @@ //sys NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo //sys NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error) = netapi32.NetGetJoinInformation //sys NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree +//sys NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) = netapi32.NetUserEnum const ( // do not reorder @@ -893,7 +894,7 @@ aclRevision byte sbz1 byte aclSize uint16 - aceCount uint16 + AceCount uint16 sbz2 uint16 } @@ -1086,6 +1087,27 @@ Trustee TRUSTEE } +// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header +type ACE_HEADER struct { + AceType uint8 + AceFlags uint8 + AceSize uint16 +} + +// https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-access_allowed_ace +type ACCESS_ALLOWED_ACE struct { + Header ACE_HEADER + Mask ACCESS_MASK + SidStart uint32 +} + +const ( + // Constants for AceType + // https://learn.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-ace_header + ACCESS_ALLOWED_ACE_TYPE = 0 + ACCESS_DENIED_ACE_TYPE = 1 +) + // This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions. type TrusteeValue uintptr @@ -1157,6 +1179,7 @@ //sys makeSelfRelativeSD(absoluteSD *SECURITY_DESCRIPTOR, selfRelativeSD *SECURITY_DESCRIPTOR, selfRelativeSDSize *uint32) (err error) = advapi32.MakeSelfRelativeSD //sys setEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) = advapi32.SetEntriesInAclW +//sys GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) = advapi32.GetAce // Control returns the security descriptor control bits. func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/golang.org/x/sys/windows/zsyscall_windows.go new/vendor/golang.org/x/sys/windows/zsyscall_windows.go --- old/vendor/golang.org/x/sys/windows/zsyscall_windows.go 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/golang.org/x/sys/windows/zsyscall_windows.go 2024-07-08 16:14:31.000000000 +0200 @@ -91,6 +91,7 @@ procEnumServicesStatusExW = modadvapi32.NewProc("EnumServicesStatusExW") procEqualSid = modadvapi32.NewProc("EqualSid") procFreeSid = modadvapi32.NewProc("FreeSid") + procGetAce = modadvapi32.NewProc("GetAce") procGetLengthSid = modadvapi32.NewProc("GetLengthSid") procGetNamedSecurityInfoW = modadvapi32.NewProc("GetNamedSecurityInfoW") procGetSecurityDescriptorControl = modadvapi32.NewProc("GetSecurityDescriptorControl") @@ -401,6 +402,7 @@ procTransmitFile = modmswsock.NewProc("TransmitFile") procNetApiBufferFree = modnetapi32.NewProc("NetApiBufferFree") procNetGetJoinInformation = modnetapi32.NewProc("NetGetJoinInformation") + procNetUserEnum = modnetapi32.NewProc("NetUserEnum") procNetUserGetInfo = modnetapi32.NewProc("NetUserGetInfo") procNtCreateFile = modntdll.NewProc("NtCreateFile") procNtCreateNamedPipeFile = modntdll.NewProc("NtCreateNamedPipeFile") @@ -1223,6 +1225,14 @@ return } +func GetAce(acl *ACL, aceIndex uint32, pAce **ACCESS_ALLOWED_ACE) (ret error) { + r0, _, _ := syscall.Syscall(procGetAce.Addr(), 3, uintptr(unsafe.Pointer(acl)), uintptr(aceIndex), uintptr(unsafe.Pointer(pAce))) + if r0 == 0 { + ret = GetLastError() + } + return +} + func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error) { r1, _, e1 := syscall.Syscall(procSetKernelObjectSecurity.Addr(), 3, uintptr(handle), uintptr(securityInformation), uintptr(unsafe.Pointer(securityDescriptor))) if r1 == 0 { @@ -3483,6 +3493,14 @@ if r0 != 0 { neterr = syscall.Errno(r0) } + return +} + +func NetUserEnum(serverName *uint16, level uint32, filter uint32, buf **byte, prefMaxLen uint32, entriesRead *uint32, totalEntries *uint32, resumeHandle *uint32) (neterr error) { + r0, _, _ := syscall.Syscall9(procNetUserEnum.Addr(), 8, uintptr(unsafe.Pointer(serverName)), uintptr(level), uintptr(filter), uintptr(unsafe.Pointer(buf)), uintptr(prefMaxLen), uintptr(unsafe.Pointer(entriesRead)), uintptr(unsafe.Pointer(totalEntries)), uintptr(unsafe.Pointer(resumeHandle)), 0) + if r0 != 0 { + neterr = syscall.Errno(r0) + } return } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt --- old/vendor/modules.txt 2024-06-06 15:47:28.000000000 +0200 +++ new/vendor/modules.txt 2024-07-08 16:14:31.000000000 +0200 @@ -1,5 +1,5 @@ -# github.com/charlievieth/fastwalk v1.0.3 -## explicit; go 1.18 +# github.com/charlievieth/fastwalk v1.0.7-0.20240703190418-87029d931815 +## explicit; go 1.20 github.com/charlievieth/fastwalk github.com/charlievieth/fastwalk/internal/dirent # github.com/gdamore/encoding v1.0.0 @@ -59,12 +59,12 @@ # github.com/rivo/uniseg v0.4.7 ## explicit; go 1.18 github.com/rivo/uniseg -# golang.org/x/sys v0.20.0 +# golang.org/x/sys v0.22.0 ## explicit; go 1.18 golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows -# golang.org/x/term v0.20.0 +# golang.org/x/term v0.22.0 ## explicit; go 1.18 golang.org/x/term # golang.org/x/text v0.14.0