read privateUsers from the closure record at start, and move the data owner option under hive-controller
This commit is contained in:
parent
1fd591d28b
commit
f5a609911c
1 changed files with 208 additions and 97 deletions
|
|
@ -153,11 +153,14 @@ pub(crate) fn remove_legacy_tmpfiles() -> Result<()> {
|
|||
}
|
||||
|
||||
/// `EnsureAgentSocketDir` — create `/run/hive-agent/<name>` if missing.
|
||||
pub(crate) fn ensure_agent_socket_dir(name: &str) -> Result<(String, String)> {
|
||||
pub(crate) fn ensure_agent_socket_dir(
|
||||
name: &str,
|
||||
private_users: Option<bool>,
|
||||
) -> Result<(String, String)> {
|
||||
ensure_socket_dir_in(Path::new(SOCKET_DIR_ROOT), name)?;
|
||||
// A namespaced agent's activation cannot chown the dir through the id
|
||||
// mapping, so the data owner, which is the agent user inside, gets it here.
|
||||
if let Some(owner) = crate::userns::owner_for_agent(name)? {
|
||||
if let Some(owner) = crate::userns::owner_for_agent(name, private_users)? {
|
||||
let path = Path::new(SOCKET_DIR_ROOT).join(name);
|
||||
std::os::unix::fs::lchown(&path, Some(owner), Some(owner))
|
||||
.with_context(|| format!("chown {}", path.display()))?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue