const USERLIST : &str = "/etc/userlist";
+struct Authorized<T>;
+
fn authorize_scope(cs: &CommandStream, wanted: &ManagementScope) {
type AS = AuthorizedScope;
let our_euid = unsafe { libc::getuid() };
let ok = cs.authorized_uid(our_euid)?;
AS((ok,),
- ManagementScope:::XXX)
+ ManagementScope::XXX)
};
y.into()
},
Authorized<(Passwd,uid_t)>, // caller_has
Authorized<File>, // in_userlist:
)> = {
- let pwent = Passwd::from_name(user)?:
+ let pwent = Passwd::from_name(user)?;
let caller_has = cs.authorized_uid(pwent.uid)?;
let found = (||{
let allowed = File::open(USERLIST)?;
#[throws(ME)]
fn execute(cs: &mut CommandStream, cmd: MgmtCommand) -> MgmtResponse {
- use MgmgError::*;
+ use MgmtError::*;
match cmd {
Noop { } => Fine { },
Scope(wanted_scope) => {
- let (_: AuthorizedConclusion, authorized: ManagementScope) =
+ let (_, authorized) : (AuthorizedConclusion, ManagementScope) =
authorize_scope(cs, &wanted_scope)?;
cs.scope = authorized;
Fine { }