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.31
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 /
cmd /
go /
internal /
lockedfile /
[ HOME SHELL ]
Name
Size
Permission
Action
internal
[ DIR ]
drwxr-xr-x
lockedfile.go
5.07
KB
-rw-r--r--
lockedfile_filelock.go
1.72
KB
-rw-r--r--
lockedfile_plan9.go
2.49
KB
-rw-r--r--
lockedfile_test.go
3.15
KB
-rw-r--r--
mutex.go
2.34
KB
-rw-r--r--
transform_test.go
2.24
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : lockedfile_plan9.go
// Copyright 2018 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 plan9 package lockedfile import ( "math/rand" "os" "strings" "time" ) // Opening an exclusive-use file returns an error. // The expected error strings are: // // - "open/create -- file is locked" (cwfs, kfs) // - "exclusive lock" (fossil) // - "exclusive use file already open" (ramfs) var lockedErrStrings = [...]string{ "file is locked", "exclusive lock", "exclusive use file already open", } // Even though plan9 doesn't support the Lock/RLock/Unlock functions to // manipulate already-open files, IsLocked is still meaningful: os.OpenFile // itself may return errors that indicate that a file with the ModeExclusive bit // set is already open. func isLocked(err error) bool { s := err.Error() for _, frag := range lockedErrStrings { if strings.Contains(s, frag) { return true } } return false } func openFile(name string, flag int, perm os.FileMode) (*os.File, error) { // Plan 9 uses a mode bit instead of explicit lock/unlock syscalls. // // Per http://man.cat-v.org/plan_9/5/stat: “Exclusive use files may be open // for I/O by only one fid at a time across all clients of the server. If a // second open is attempted, it draws an error.” // // So we can try to open a locked file, but if it fails we're on our own to // figure out when it becomes available. We'll use exponential backoff with // some jitter and an arbitrary limit of 500ms. // If the file was unpacked or created by some other program, it might not // have the ModeExclusive bit set. Set it before we call OpenFile, so that we // can be confident that a successful OpenFile implies exclusive use. if fi, err := os.Stat(name); err == nil { if fi.Mode()&os.ModeExclusive == 0 { if err := os.Chmod(name, fi.Mode()|os.ModeExclusive); err != nil { return nil, err } } } else if !os.IsNotExist(err) { return nil, err } nextSleep := 1 * time.Millisecond const maxSleep = 500 * time.Millisecond for { f, err := os.OpenFile(name, flag, perm|os.ModeExclusive) if err == nil { return f, nil } if !isLocked(err) { return nil, err } time.Sleep(nextSleep) nextSleep += nextSleep if nextSleep > maxSleep { nextSleep = maxSleep } // Apply 10% jitter to avoid synchronizing collisions. nextSleep += time.Duration((0.1*rand.Float64() - 0.05) * float64(nextSleep)) } } func closeFile(f *os.File) error { return f.Close() }
Close