Skip to content

Commit 2065194

Browse files
committed
Simplify logging for pam parse
1 parent 9ff430b commit 2065194

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/shellexec/shellexec.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,19 +461,18 @@ func StartShellProc(termSize waveobj.TermSize, cmdStr string, cmdOpts CommandOpt
461461
RC file, it will be overridden when the shell initializes.
462462
*/
463463
if os.Getenv("SNAP") != "" {
464+
log.Printf("Detected Snap installation, correcting XDG environment variables")
464465
varsToReplace := map[string]string{"XDG_CONFIG_HOME": "", "XDG_DATA_HOME": "", "XDG_CACHE_HOME": "", "XDG_RUNTIME_DIR": "", "XDG_CONFIG_DIRS": "", "XDG_DATA_DIRS": ""}
465466
pamEnvs := tryGetPamEnvVars()
466-
log.Printf("PAM environment: %v", pamEnvs)
467467
if len(pamEnvs) > 0 {
468468
// We only want to set the XDG variables from the PAM environment, all others should already be correct or may have been overridden by something else out of our control
469469
for k := range pamEnvs {
470470
if _, ok := varsToReplace[k]; ok {
471-
log.Printf("Setting %s to %s", k, pamEnvs[k])
472471
varsToReplace[k] = pamEnvs[k]
473472
}
474473
}
475474
}
476-
log.Printf("Replacing XDG environment variables: %v", varsToReplace)
475+
log.Printf("Setting XDG environment variables to: %v", varsToReplace)
477476
shellutil.UpdateCmdEnv(ecmd, varsToReplace)
478477
}
479478

0 commit comments

Comments
 (0)