fix(cli): use picoclaw home dir for history file instead of temp dir
Security fix for issue #2234: - HistoryFile was hardcoded to os.TempDir() (/tmp on Linux) - /tmp is typically world-readable (mode 1777) exposing command history - An attacker could create symlinks to overwrite sensitive files - Now uses internal.GetPicoclawHome() which respects $PICOCLAW_HOME environment variable and falls back to ~/.picoclaw
This commit is contained in:
parent
15a70ac45c
commit
8843ed076d
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ func interactiveMode(agentLoop *agent.AgentLoop, sessionKey string) {
|
|||
|
||||
rl, err := readline.NewEx(&readline.Config{
|
||||
Prompt: prompt,
|
||||
HistoryFile: filepath.Join(os.TempDir(), ".picoclaw_history"),
|
||||
HistoryFile: filepath.Join(internal.GetPicoclawHome(), ".picoclaw_history"),
|
||||
HistoryLimit: 100,
|
||||
InterruptPrompt: "^C",
|
||||
EOFPrompt: "exit",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue