Paquet : golang-github-cli-safeexec-dev (1.0.0-2)
Liens pour golang-github-cli-safeexec-dev
Ressources Debian :
- Rapports de bogues
- Developer Information
- Journal des modifications Debian
- Fichier de licence
- Suivis des correctifs pour Debian
Télécharger le paquet source golang-github-cli-safeexec :
- [golang-github-cli-safeexec_1.0.0-2.dsc]
- [golang-github-cli-safeexec_1.0.0.orig.tar.gz]
- [golang-github-cli-safeexec_1.0.0-2.debian.tar.xz]
Responsables :
Ressources externes :
- Page d'accueil [github.com]
Paquets similaires :
- libcommons-exec-java
- elpa-inheritenv
- golang-github-bmatsuo-lmdb-go-dev
- ruby-tty-which
- libfile-searchpath-perl
- golang-github-wellington-go-libsass-dev
- golang-github-smallstep-assert-dev
- golang-github-radovskyb-watcher-dev
- golang-github-joshuarubin-lifecycle-dev
- librust-search-path-dev
- golang-github-mostynb-go-grpc-compression-dev
safer version of exec.LookPath on Windows
safeexec is a Go module that provides a safer alternative to exec.LookPath() on Windows.
The following, relatively common approach to running external commands has a subtle vulnerability on Windows:
import "os/exec"
func gitStatus() error { // On Windows, this will result in .\git.exe or .\git.bat being executed // if either were found in the current working directory. cmd := exec.Command("git", "status") return cmd.Run() }
Searching the current directory (surprising behavior) before searching folders listed in the PATH environment variable (expected behavior) seems to be intended in Go and unlikely to be changed: https://github.com/golang/go/issues/38736
Since Go does not provide a version of exec.LookPath() that only searches PATH and does not search the current working directory, this module provides a LookPath function that works consistently across platforms.
Example use:
import ( "os/exec" "github.com/cli/safeexec" )
func gitStatus() error { gitBin, err := safeexec.LookPath("git") if err != nil { return err } cmd := exec.Command(gitBin, "status") return cmd.Run() }
Télécharger golang-github-cli-safeexec-dev
Architecture | Taille du paquet | Espace occupé une fois installé | Fichiers |
---|---|---|---|
all | 5,1 ko | 31,0 ko | [liste des fichiers] |