mirror of
https://github.com/github/codeql.git
synced 2026-04-20 14:34:04 +02:00
syscall environment variables
This commit is contained in:
@@ -20,3 +20,10 @@ extensions:
|
||||
- ["syscall", "Conn", True, "SyscallConn", "", "", "Argument[receiver]", "ReturnValue[0]", "taint", "manual"]
|
||||
- ["syscall", "RawConn", True, "Read", "", "", "Argument[receiver]", "Argument[0]", "taint", "manual"]
|
||||
- ["syscall", "RawConn", True, "Write", "", "", "Argument[0]", "Argument[receiver]", "taint", "manual"]
|
||||
- addsTo:
|
||||
pack: codeql/go-all
|
||||
extensible: sourceModel
|
||||
data:
|
||||
- ["syscall", "", False, "Environ", "", "", "ReturnValue", "environment", "manual"]
|
||||
- ["syscall", "", False, "Getenv", "", "", "ReturnValue[0]", "environment", "manual"]
|
||||
- ["syscall", "ProcAttr", True, "Env", "", "", "", "environment", "manual"]
|
||||
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/joho/godotenv"
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
func osEnvironmentVariables() {
|
||||
@@ -97,3 +98,15 @@ func envyEnvironmentVariables() {
|
||||
|
||||
fmt.Printf("HOME: %s\n", homeDir)
|
||||
}
|
||||
|
||||
func syscallEnvironmentVariables() {
|
||||
for _, envVar := range syscall.Environ() { // $ source
|
||||
fmt.Println("%s", envVar)
|
||||
}
|
||||
|
||||
home, err := syscall.Getenv("HOME") // $ source
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fmt.Println("HOME: %s", home)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user