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
|
|
@ -30,7 +30,9 @@ let
|
|||
# hive-c0re creates the host work dir as hive-core; this activation is
|
||||
# the only thing that lets the agent write to it.
|
||||
name = "the agent's activation hands its own work dir to the agent user";
|
||||
ok = lib.hasInfix ''chown -hR "$userName:$userName" "/agents/$userName/work"'' migrate;
|
||||
ok =
|
||||
lib.hasInfix ''if [ "$(stat -c %U "/agents/$userName/work")" != "$userName" ]; then'' migrate
|
||||
&& lib.hasInfix ''chown -hR "$userName:$userName" "/agents/$userName/work"'' migrate;
|
||||
}
|
||||
{
|
||||
# hive-priv creates the host socket dir `0751 root` and never chowns it,
|
||||
|
|
|
|||
Loading…
Reference in a new issue