summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2023-09-21 04:49:08 +0000
committerLars Wirzenius <liw@liw.fi>2023-09-21 04:49:08 +0000
commit977c5ba9351ba14fce6e04117d939b50b5deb73f (patch)
treea8c75f9fc4e0f5122b13d812abbf04ecc395a79f
parentbb830960fedcc58a47141406ef7707f4892fb2db (diff)
parente3364a68f77a0af164be19b4b802033cc778911d (diff)
downloadsshca-977c5ba9351ba14fce6e04117d939b50b5deb73f.tar.gz
Merge branch 'liw/fix-add-principals' into 'main'
fix: add principals to host See merge request larswirzenius/sshca!67
-rw-r--r--src/cmd/host.rs2
-rw-r--r--sshca.md7
2 files changed, 7 insertions, 2 deletions
diff --git a/src/cmd/host.rs b/src/cmd/host.rs
index d3a85b4..830a5f4 100644
--- a/src/cmd/host.rs
+++ b/src/cmd/host.rs
@@ -466,7 +466,7 @@ pub struct AddPrincipals {
impl Runnable for AddPrincipals {
fn run(&mut self, _config: &Config, store: &mut KeyStore) -> Result<(), CAError> {
if let Some(host) = store.get_host_mut(&self.hostname) {
- host.set_principals(&self.principals);
+ host.add_principals(&self.principals);
assert!(store.is_dirty());
Ok(())
} else {
diff --git a/sshca.md b/sshca.md
index d9afeb9..4e3cbc9 100644
--- a/sshca.md
+++ b/sshca.md
@@ -468,7 +468,12 @@ when I run sshca host principals list myhost
then stdout doesn't contain "alfred.lan"
then stdout doesn't contain "alfred.example.com"
-when I run sshca host principals add --host myhost alfred.lan alfred.example.com
+when I run sshca host principals add --host myhost alfred.lan
+when I run sshca host principals list myhost
+then stdout contains "alfred.lan"
+then stdout doesn't contain "alfred.example.com"
+
+when I run sshca host principals add --host myhost alfred.example.com
when I run sshca host principals list myhost
then stdout contains "alfred.lan"
then stdout contains "alfred.example.com"