Watch
1
0
Fork
You've already forked souveraine
0

admit: give an agent her own uid through one writer

souveraine-admit creates or adopts one account via systemd-sysusers, writes
the root-owned mapping health reads, and reports what NSS says afterwards
instead of what it asked for. An account belongs to one agent: handing
annie's to souvie is refused in both directions, as is adopting a uid >=1000.
Binding is by SeedID, not the UUID filename — a mismatch is identity-drift.
This commit is contained in:
Fimeg 2026-08-17 15:16:30 -04:00
commit 0f8fe22ab6
10 changed files with 745 additions and 170 deletions

View file

@ -99,25 +99,8 @@ impl AgentPrincipalConfig {
let account = self
.account
.as_deref()
.filter(|value| !value.is_empty())
.ok_or_else(|| anyhow::anyhow!("dedicated principal requires an account"))?;
let valid = account.len() <= 31
&& account
.bytes()
.enumerate()
.all(|(index, byte)| match (index, byte) {
(0, b'a'..=b'z' | b'_') => true,
(_, b'a'..=b'z' | b'0'..=b'9' | b'_' | b'-') => true,
_ => false,
});
if !valid {
anyhow::bail!(
"invalid dedicated account `{account}`; use a lowercase Unix account name"
);
}
if matches!(account, "root" | "souveraine" | "souveraine-session") {
anyhow::bail!("account `{account}` is reserved and cannot be an agent principal");
}
crate::core::principal_map::validate_account_name(account)?;
}
}
Ok(())