$97 GRAYBYTE WORDPRESS FILE MANAGER $69

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib/golang/src/os/

HOME
Current File : /lib/golang/src/os//root_js.go
// Copyright 2024 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 js && wasm

package os

import (
	"errors"
	"slices"
	"syscall"
)

// checkPathEscapes reports whether name escapes the root.
//
// Due to the lack of openat, checkPathEscapes is subject to TOCTOU races
// when symlinks change during the resolution process.
func checkPathEscapes(r *Root, name string) error {
	return checkPathEscapesInternal(r, name, false)
}

// checkPathEscapesLstat reports whether name escapes the root.
// It does not resolve symlinks in the final path component.
//
// Due to the lack of openat, checkPathEscapes is subject to TOCTOU races
// when symlinks change during the resolution process.
func checkPathEscapesLstat(r *Root, name string) error {
	return checkPathEscapesInternal(r, name, true)
}

func checkPathEscapesInternal(r *Root, name string, lstat bool) error {
	if r.root.closed.Load() {
		return ErrClosed
	}
	parts, suffixSep, err := splitPathInRoot(name, nil, nil)
	if err != nil {
		return err
	}

	i := 0
	symlinks := 0
	base := r.root.name
	for i < len(parts) {
		if parts[i] == ".." {
			// Resolve one or more parent ("..") path components.
			end := i + 1
			for end < len(parts) && parts[end] == ".." {
				end++
			}
			count := end - i
			if count > i {
				return errPathEscapes
			}
			parts = slices.Delete(parts, i-count, end)
			i -= count
			base = r.root.name
			for j := range i {
				base = joinPath(base, parts[j])
			}
			continue
		}

		part := parts[i]
		if i == len(parts)-1 {
			if lstat {
				break
			}
			part += suffixSep
		}

		next := joinPath(base, part)
		fi, err := Lstat(next)
		if err != nil {
			if IsNotExist(err) {
				return nil
			}
			return underlyingError(err)
		}
		if fi.Mode()&ModeSymlink != 0 {
			link, err := Readlink(next)
			if err != nil {
				return errPathEscapes
			}
			symlinks++
			if symlinks > rootMaxSymlinks {
				return errors.New("too many symlinks")
			}
			newparts, newSuffixSep, err := splitPathInRoot(link, parts[:i], parts[i+1:])
			if err != nil {
				return err
			}
			if i == len(parts) {
				// suffixSep contains any trailing path separator characters
				// in the link target.
				// If we are replacing the remainder of the path, retain these.
				// If we're replacing some intermediate component of the path,
				// ignore them, since intermediate components must always be
				// directories.
				suffixSep = newSuffixSep
			}
			parts = newparts
			continue
		}
		if !fi.IsDir() && i < len(parts)-1 {
			return syscall.ENOTDIR
		}

		base = next
		i++
	}
	return nil
}

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
16 Dec 2025 9.30 PM
root / root
0755
exec
--
16 Dec 2025 9.30 PM
root / root
0755
signal
--
16 Dec 2025 9.30 PM
root / root
0755
user
--
16 Dec 2025 9.30 PM
root / root
0755
dir.go
5.935 KB
4 Dec 2025 6.06 PM
root / root
0644
dir_darwin.go
3.498 KB
4 Dec 2025 6.06 PM
root / root
0644
dir_plan9.go
2.189 KB
4 Dec 2025 6.06 PM
root / root
0644
dir_unix.go
4.846 KB
4 Dec 2025 6.06 PM
root / root
0644
dir_windows.go
7.684 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_aix.go
0.741 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_dragonfly.go
1.279 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_freebsd.go
1.159 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_js.go
0.662 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_linux.go
1.184 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_netbsd.go
1.159 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_openbsd.go
1.159 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_solaris.go
0.741 KB
4 Dec 2025 6.06 PM
root / root
0644
dirent_wasip1.go
1.355 KB
4 Dec 2025 6.06 PM
root / root
0644
eloop_netbsd.go
0.496 KB
4 Dec 2025 6.06 PM
root / root
0644
eloop_other.go
0.646 KB
4 Dec 2025 6.06 PM
root / root
0644
env.go
3.854 KB
4 Dec 2025 6.06 PM
root / root
0644
error.go
4.796 KB
4 Dec 2025 6.06 PM
root / root
0644
error_errno.go
0.334 KB
4 Dec 2025 6.06 PM
root / root
0644
error_plan9.go
0.395 KB
4 Dec 2025 6.06 PM
root / root
0644
exec.go
11.473 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_linux.go
0.263 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_nohandle.go
0.296 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_plan9.go
3.231 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_posix.go
3.71 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_unix.go
3.323 KB
4 Dec 2025 6.06 PM
root / root
0644
exec_windows.go
4.677 KB
4 Dec 2025 6.06 PM
root / root
0644
executable.go
0.758 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_darwin.go
0.659 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_dragonfly.go
0.362 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_freebsd.go
0.361 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_netbsd.go
0.364 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_path.go
2.309 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_plan9.go
0.417 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_procfs.go
0.643 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_solaris.go
0.739 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_sysctl.go
0.835 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_wasm.go
0.325 KB
4 Dec 2025 6.06 PM
root / root
0644
executable_windows.go
0.626 KB
4 Dec 2025 6.06 PM
root / root
0644
file.go
29.511 KB
4 Dec 2025 6.06 PM
root / root
0644
file_mutex_plan9.go
1.809 KB
4 Dec 2025 6.06 PM
root / root
0644
file_open_unix.go
0.388 KB
4 Dec 2025 6.06 PM
root / root
0644
file_open_wasip1.go
0.799 KB
4 Dec 2025 6.06 PM
root / root
0644
file_plan9.go
15.686 KB
4 Dec 2025 6.06 PM
root / root
0644
file_posix.go
7.47 KB
4 Dec 2025 6.06 PM
root / root
0644
file_unix.go
13.718 KB
4 Dec 2025 6.06 PM
root / root
0644
file_wasip1.go
0.618 KB
4 Dec 2025 6.06 PM
root / root
0644
file_windows.go
13.51 KB
4 Dec 2025 6.06 PM
root / root
0644
getwd.go
3.71 KB
4 Dec 2025 6.06 PM
root / root
0644
path.go
2.307 KB
4 Dec 2025 6.06 PM
root / root
0644
path_plan9.go
0.433 KB
4 Dec 2025 6.06 PM
root / root
0644
path_unix.go
1.155 KB
4 Dec 2025 6.06 PM
root / root
0644
path_windows.go
5.943 KB
4 Dec 2025 6.06 PM
root / root
0644
pidfd_linux.go
5.879 KB
4 Dec 2025 6.06 PM
root / root
0644
pidfd_other.go
0.662 KB
4 Dec 2025 6.06 PM
root / root
0644
pipe2_unix.go
0.639 KB
4 Dec 2025 6.06 PM
root / root
0644
pipe_unix.go
0.756 KB
4 Dec 2025 6.06 PM
root / root
0644
pipe_wasm.go
0.477 KB
4 Dec 2025 6.06 PM
root / root
0644
proc.go
2.272 KB
4 Dec 2025 6.06 PM
root / root
0644
rawconn.go
0.97 KB
4 Dec 2025 6.06 PM
root / root
0644
removeall_at.go
4.783 KB
4 Dec 2025 6.06 PM
root / root
0644
removeall_noat.go
3.145 KB
4 Dec 2025 6.06 PM
root / root
0644
removeall_unix.go
0.469 KB
4 Dec 2025 6.06 PM
root / root
0644
removeall_windows.go
0.383 KB
4 Dec 2025 6.06 PM
root / root
0644
root.go
13.48 KB
4 Dec 2025 6.06 PM
root / root
0644
root_js.go
2.602 KB
4 Dec 2025 6.06 PM
root / root
0644
root_nonwindows.go
0.275 KB
4 Dec 2025 6.06 PM
root / root
0644
root_noopenat.go
7.861 KB
4 Dec 2025 6.06 PM
root / root
0644
root_openat.go
11.419 KB
4 Dec 2025 6.06 PM
root / root
0644
root_plan9.go
0.485 KB
4 Dec 2025 6.06 PM
root / root
0644
root_unix.go
8.497 KB
4 Dec 2025 6.06 PM
root / root
0644
root_windows.go
12.229 KB
4 Dec 2025 6.06 PM
root / root
0644
stat.go
0.95 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_aix.go
1.211 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_darwin.go
1.122 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_dragonfly.go
1.096 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_freebsd.go
1.105 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_js.go
1.147 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_linux.go
1.096 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_netbsd.go
1.105 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_openbsd.go
1.096 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_plan9.go
2.375 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_solaris.go
1.337 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_unix.go
1.215 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_wasip1.go
1.241 KB
4 Dec 2025 6.06 PM
root / root
0644
stat_windows.go
5.356 KB
4 Dec 2025 6.06 PM
root / root
0644
sticky_bsd.go
0.415 KB
4 Dec 2025 6.06 PM
root / root
0644
sticky_notbsd.go
0.313 KB
4 Dec 2025 6.06 PM
root / root
0644
sys.go
0.287 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_aix.go
0.666 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_bsd.go
0.455 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_js.go
0.306 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_linux.go
1.045 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_plan9.go
0.442 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_solaris.go
0.259 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_unix.go
0.481 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_wasip1.go
0.302 KB
4 Dec 2025 6.06 PM
root / root
0644
sys_windows.go
0.854 KB
4 Dec 2025 6.06 PM
root / root
0644
tempfile.go
3.921 KB
4 Dec 2025 6.06 PM
root / root
0644
types.go
2.858 KB
4 Dec 2025 6.06 PM
root / root
0644
types_plan9.go
0.778 KB
4 Dec 2025 6.06 PM
root / root
0644
types_unix.go
0.758 KB
4 Dec 2025 6.06 PM
root / root
0644
types_windows.go
11.714 KB
4 Dec 2025 6.06 PM
root / root
0644
wait6_dragonfly.go
0.484 KB
4 Dec 2025 6.06 PM
root / root
0644
wait6_freebsd64.go
0.534 KB
4 Dec 2025 6.06 PM
root / root
0644
wait6_freebsd_386.go
0.531 KB
4 Dec 2025 6.06 PM
root / root
0644
wait6_freebsd_arm.go
0.536 KB
4 Dec 2025 6.06 PM
root / root
0644
wait6_netbsd.go
0.521 KB
4 Dec 2025 6.06 PM
root / root
0644
wait_unimp.go
0.812 KB
4 Dec 2025 6.06 PM
root / root
0644
wait_wait6.go
0.773 KB
4 Dec 2025 6.06 PM
root / root
0644
wait_waitid.go
1.033 KB
4 Dec 2025 6.06 PM
root / root
0644
zero_copy_freebsd.go
1.323 KB
4 Dec 2025 6.06 PM
root / root
0644
zero_copy_linux.go
3.755 KB
4 Dec 2025 6.06 PM
root / root
0644
zero_copy_posix.go
1.065 KB
4 Dec 2025 6.06 PM
root / root
0644
zero_copy_solaris.go
2.568 KB
4 Dec 2025 6.06 PM
root / root
0644
zero_copy_stub.go
0.42 KB
4 Dec 2025 6.06 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF