Exploit databaseDownload repository ZIP
GH-8958357e96f9d8f8c98383150c404283
notkmhn/cve-2022-21449-tls-poc
Sources for CVE-2022-21449
14 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files16
notkmhn/cve-2022-21449-tls-pocRevision fa239eebae2b
- ↑..Parent directory
- build.go
- buildlist.go
- edit.go
- help.go
- import.go
- init.go
- list.go
- load.go
- modfile.go
- mvs.go
- query.go
- search.go
- stat_openfile.go
- stat_unix.go
- stat_windows.go
- vendor.go
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
go/src/cmd/go/internal/modload/stat_unix.go
Go · 963 bytes// Copyright 2019 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 unix
package modload
import (
"io/fs"
"os"
"syscall"
)
// hasWritePerm reports whether the current user has permission to write to the
// file with the given info.
//
// Although the root user on most Unix systems can write to files even without
// permission, hasWritePerm reports false if no appropriate permission bit is
// set even if the current user is root.
func hasWritePerm(path string, fi fs.FileInfo) bool {
if os.Getuid() == 0 {
// The root user can access any file, but we still want to default to
// read-only mode if the go.mod file is marked as globally non-writable.
// (If the user really intends not to be in readonly mode, they can
// pass -mod=mod explicitly.)
return fi.Mode()&0222 != 0
}
const W_OK = 0x2
return syscall.Access(path, W_OK) == nil
}