* 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. */
()
| 104 | Returns nil if an error occurs. |
| 105 | */ |
| 106 | func 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 |
| 115 | func replaceHomeAndShell(val string, home string, shell string) string { |
no test coverage detected