MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / ParsePasswdSafe

Function ParsePasswdSafe

pkg/util/pamparse/pamparse.go:106–112  ·  view source on GitHub ↗

* Gets the home directory and shell from /etc/passwd for the current user and returns a map of environment variables from /etc/security/pam_env.conf or ~/.pam_environment. Returns nil if an error occurs. */

()

Source from the content-addressed store, hash-verified

104Returns nil if an error occurs.
105*/
106func ParsePasswdSafe() *PamParseOpts {
107 opts, err := ParsePasswd()
108 if err != nil {
109 return nil
110 }
111 return opts
112}
113
114// Replaces @{HOME} and @{SHELL} placeholders in a string with the provided values. Follows guidance from https://wiki.archlinux.org/title/Environment_variables#Using_pam_env
115func replaceHomeAndShell(val string, home string, shell string) string {

Callers 1

shellexec.goFile · 0.92

Calls 1

ParsePasswdFunction · 0.85

Tested by

no test coverage detected