~kennylevinsen/greetd

27b598b42d34aa1a886966e3f9d96feda7ad1b33 — Kenny Levinsen 4 months ago 8857198
pam: Swap /etc/pam.d and /usr/lib/pam.d
1 files changed, 4 insertions(+), 5 deletions(-)

M greetd/src/server.rs
M greetd/src/server.rs => greetd/src/server.rs +4 -5
@@ 198,24 198,23 @@ impl Drop for Listener {
}

pub async fn main(config: Config) -> Result<(), Error> {
    let service = if Path::new(&format!("/usr/lib/pam.d/{}", config.file.general.service)).exists()
    {
    let service = if Path::new(&format!("/etc/pam.d/{}", config.file.general.service)).exists() {
        &config.file.general.service
    } else if Path::new(&format!("/etc/pam.d/{}", config.file.general.service)).exists() {
    } else if Path::new(&format!("/usr/lib/pam.d/{}", config.file.general.service)).exists() {
        &config.file.general.service
    } else {
        return Err(format!("PAM '{}' service missing", config.file.general.service).into());
    };

    let greeter_service = if Path::new(&format!(
        "/usr/lib/pam.d/{}",
        "/etc/pam.d/{}",
        config.file.default_session.service
    ))
    .exists()
    {
        &config.file.default_session.service
    } else if Path::new(&format!(
        "/etc/pam.d/{}",
        "/usr/lib/pam.d/{}",
        config.file.default_session.service
    ))
    .exists()