From 2cd6c3713e3259658e264874c00a6b83855ad690 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 1 Nov 2020 23:17:33 +0000 Subject: [PATCH] wip errors from introducing accounts Signed-off-by: Ian Jackson --- src/cmdlistener.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/cmdlistener.rs b/src/cmdlistener.rs index 895533cf..36866f59 100644 --- a/src/cmdlistener.rs +++ b/src/cmdlistener.rs @@ -154,12 +154,13 @@ fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse { let acl = default(); let gref = Instance::new(game, gs, acl, auth)?; let ig = gref.lock()?; - let mut igu = Unauthorised::of(ig); + let mut ig = Unauthorised::of(ig); let resp = - execute_for_game(cs, &ag, &mut igu, + execute_for_game(cs, &ag, &mut ig, insns, MgmtGameUpdateMode::Bulk) .map_err(|e|{ + let ig = ig.by(Authorisation::authorise_any()); let name = ig.name.clone(); let InstanceGuard { c, .. } = ig; Instance::destroy_game(c, auth) @@ -1007,8 +1008,12 @@ mod authproofs { #[error("internal AuthorisationError {0}")] pub struct AuthorisationError(pub String); - #[derive(Debug,Copy,Clone)] + #[derive(Debug)] pub struct Authorisation (PhantomData<*const A>); + impl Clone for Authorisation { fn clone(&self) -> Self { + Self(PhantomData) + } } + impl Copy for Authorisation { } impl Authorisation { pub const fn authorised(_v: &T) -> Authorisation { @@ -1058,3 +1063,5 @@ mod authproofs { type Output = (A, B, C); } } + + -- 2.30.2