chiark / gitweb /
Revert "for revert: invent ServerOperatorPrivilege"
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2020 18:35:50 +0000 (19:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 21 Aug 2020 18:35:50 +0000 (19:35 +0100)
This reverts commit 85da91f69fdb5107d0e61800576b06de406c82f3.

src/cmdlistener.rs

index e9bb38d6822ca6b9053d70c2c5703fb49efdd9f3..9db49c2bec78ceaa95b548799cb17a2217997012 100644 (file)
@@ -109,29 +109,22 @@ fn authorise_scope(cs: &CommandStream, wanted: &ManagementScope)
     .map_err(|e| cs.map_auth_err(e))?
 }
 
-struct ServerOperatorPrivilege;
-#[throws(AuthorisationError)]
-fn do_authorise_server(cs: &CommandStream)
-                       -> AuthorisedSatisfactory<ServerOperatorPrivilege {
-  type AS<T> = (T, ManagementScope);
-  let y : AS<
-      Authorised<(Passwd,uid_t)>,
-    > = {
-    let ok = cs.authorised_uid(None,None)?;
-    (ok, ServerOperatorPrivilege)
-    )
-  };
-  return y.into()
-}
-
 #[throws(AuthorisationError)]
 fn do_authorise_scope(cs: &CommandStream, wanted: &ManagementScope)
                    -> AuthorisedSatisfactory {
   type AS<T> = (T, ManagementScope);
 
   match &wanted {
+
     ManagementScope::Server => {
-      do_authorise_server(cs,wanted) ManagementScope::Server
+      let y : AS<
+        Authorised<(Passwd,uid_t)>,
+      > = {
+        let ok = cs.authorised_uid(None,None)?;
+        (ok,
+         ManagementScope::Server)
+      };
+      return y.into()
     },
 
     ManagementScope::Unix { user: wanted } => {