~goorzhel/radm

d1c1a9803da1394d729503da1063f3495dd25854 — Antonio Gurgel 3 months ago b4ca8d0
Replace macro_use with uses

This is a great use of my time
7 files changed, 7 insertions(+), 4 deletions(-)

M src/auth.rs
M src/cli.rs
M src/main.rs
M src/pam.rs
M src/session.rs
M src/system.rs
M src/user.rs
M src/auth.rs => src/auth.rs +1 -0
@@ 1,6 1,7 @@
//! Authentication methods.

use anyhow::{anyhow, Context, Result};
use log::{error, info};
use nix::unistd::gethostname;

use crate::{

M src/cli.rs => src/cli.rs +1 -1
@@ 7,7 7,7 @@ use std::{

use anyhow::{anyhow, Context, Result};
use clap::Parser;
use log::LevelFilter;
use log::{debug, trace, LevelFilter};
use simplelog::WriteLogger;
use syslog::{BasicLogger, Facility, Formatter3164};
use xdg::BaseDirectories;

M src/main.rs => src/main.rs +1 -3
@@ 2,13 2,11 @@

#![warn(missing_docs)]

#[macro_use]
extern crate log;

use std::str::FromStr;

use anyhow::{anyhow, Context, Result};
use chvt::chvt;
use log::{error, info};

mod auth;
mod cli;

M src/pam.rs => src/pam.rs +1 -0
@@ 1,6 1,7 @@
//! PAM support.

use anyhow::{Context, Result};
use log::trace;
use pam::{Client, PasswordConv};

use crate::{

M src/session.rs => src/session.rs +1 -0
@@ 8,6 8,7 @@ use std::{

use anyhow::{anyhow, Error, Result};
use configparser::ini::Ini;
use log::{error, trace};

fn log_if_err<T, E: Display>(result: Result<T, E>, msg: String) -> Option<T> {
    match result {

M src/system.rs => src/system.rs +1 -0
@@ 13,6 13,7 @@ use std::{
};

use anyhow::{Context, Result};
use log::{debug, warn};
use nix::unistd::{chdir, chown, getgrouplist, setgid, setgroups, setuid};

use crate::user::User;

M src/user.rs => src/user.rs +1 -0
@@ 10,6 10,7 @@ use std::{
};

use anyhow::{anyhow, Context, Error, Result};
use log::{error, trace};
use nix::unistd::{Gid, Uid};
use pwd::Passwd;
use xdg::BaseDirectories;