agents: chown work/ recursively only on owner mismatch
This commit is contained in:
parent
89a5d65119
commit
8e0597d41d
2 changed files with 8 additions and 2 deletions
|
|
@ -209,8 +209,12 @@ in
|
|||
if [ -d "/agents/$userName/harness" ]; then
|
||||
chown -hR "$userName:$userName" "/agents/$userName/harness" 2>/dev/null || true
|
||||
fi
|
||||
# work/ holds large build trees and the agent creates everything in
|
||||
# it, so only an ownership mismatch on the top dir needs a full walk.
|
||||
if [ -d "/agents/$userName/work" ]; then
|
||||
chown -hR "$userName:$userName" "/agents/$userName/work" 2>/dev/null || true
|
||||
if [ "$(stat -c %U "/agents/$userName/work")" != "$userName" ]; then
|
||||
chown -hR "$userName:$userName" "/agents/$userName/work" 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
# The socket dir is bind-mounted from the host, where hive-priv creates
|
||||
# it `0751 root`. The harness binds its sockets here as this user; the
|
||||
|
|
|
|||
Loading…
Reference in a new issue