fix: chmod .claude dir 0755 in hive-agent-user-migrate activation script
ensure_claude_dir creates the dir as 0755 but cannot re-chmod after hive-agent-user-migrate chowns it to the agent user (EPERM — non-owner). The activation script runs as root and can always chmod it. Add an explicit 'chmod 755 $homeDir/.claude' after the existing chown so existing 0700 dirs from pre-fix containers are corrected on the next container boot. Without this, all agents with pre-existing .claude dirs show 'needs login' in the dashboard even with working sessions, because hive-core cannot list the 0700 dir owned by a different user.
This commit is contained in:
parent
f0271f95e4
commit
60adb5aac9
1 changed files with 7 additions and 0 deletions
|
|
@ -724,6 +724,13 @@ in
|
|||
done
|
||||
if [ -d "$homeDir/.claude" ]; then
|
||||
chown -hR "$userName:$userName" "$homeDir/.claude" 2>/dev/null || true
|
||||
# 0755 so hive-core (a different unix user) can list the dir and
|
||||
# detect a valid claude session. Credential files inside are 0600
|
||||
# so secrets stay private regardless of the directory mode.
|
||||
# ensure_claude_dir sets 0755 on creation but cannot re-chmod after
|
||||
# hive-agent-user-migrate chowns the dir to the agent user; this
|
||||
# activation script runs as root and handles the correction.
|
||||
chmod 755 "$homeDir/.claude" 2>/dev/null || true
|
||||
fi
|
||||
'';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue