From 33386a656d9bdd74f286b34f50d9592725ab1dc1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 2 Jun 2021 18:05:59 +0100 Subject: [PATCH] sshkeys: Tests restricted command branch sawing Signed-off-by: Ian Jackson --- apitest/at-otter.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apitest/at-otter.rs b/apitest/at-otter.rs index 6d826e85..a4f68041 100644 --- a/apitest/at-otter.rs +++ b/apitest/at-otter.rs @@ -266,6 +266,13 @@ impl Ctx { self.otter(&mk_restricted("ssh:other:", "list-accounts")?) .expect_err("unath"); self.otter(&mk_restricted("ssh:test:", "list-accounts")?)?; + + self.otter(&mk_restricted( + "ssh:test:", "set-ssh-keys /dev/null")?).expect_err("saw own branch"); + self.otter(&mk_restricted( + "ssh:test:", "set-ssh-keys --allow-remove-current /dev/null")?)?; + self.otter(&mk_restricted("ssh:test:sub", "list-accounts")?) + .expect_err("sawn off"); } } -- 2.30.2