From 08221ccc776fbc98ddd2f100db5b8d9d227c75d8 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 11 Mar 2021 17:53:59 +0000 Subject: [PATCH] fake rng: SetFakeRng mgmt command Signed-off-by: Ian Jackson --- daemon/cmdlistener.rs | 7 +++++++ src/commands.rs | 2 ++ 2 files changed, 9 insertions(+) diff --git a/daemon/cmdlistener.rs b/daemon/cmdlistener.rs index a39bc993..d02d6cb9 100644 --- a/daemon/cmdlistener.rs +++ b/daemon/cmdlistener.rs @@ -214,6 +214,13 @@ fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse { let results = lib.list_glob(&spec.item)?; MR::LibraryItems(results) } + + MC::SetFakeRng { ents } => { + let superuser = cs.superuser + .ok_or(ME::SuperuserAuthorisationRequired)?; + config().fake_rng.set(ents, superuser)?; + Fine + } } } diff --git a/src/commands.rs b/src/commands.rs index feb40d61..5578ca25 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -42,6 +42,8 @@ pub enum MgmtCommand { LibraryListByGlob { glob: shapelib::ItemSpec, }, + + SetFakeRng { ents: Vec }, } //---------- Accounts file ---------- -- 2.30.2