Skip to content

Commit

Permalink
use extern crate path_ratchet (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAlgorythm authored Dec 5, 2023
1 parent db99429 commit e2e7c2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 44 deletions.
1 change: 1 addition & 0 deletions pam-direct-fallback/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ edition = "2021"
[dependencies]
pamsm = { version = "0.5", features = ["libpam"] }
pam-utils = { path = "../pam-utils" }
path_ratchet = "~0.1"
thiserror = "1"
error-stack = "0.4"
birdcage = { version = "0.3", optional = true }
Expand Down
5 changes: 2 additions & 3 deletions pam-direct-fallback/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
extern crate pamsm;

mod args;
mod path;

use args::Args;
use error_stack::{Report, ResultExt};
use pam_utils::do_call_handler;
use pamsm::{Pam, PamError, PamFlags, PamServiceModule};
use path::{PathComponent, PushPathComponent};
use path_ratchet::prelude::*;
use std::fs::{remove_file, File};
use std::path::PathBuf;

Expand Down Expand Up @@ -36,7 +35,7 @@ type Result<T> = error_stack::Result<T, Error>;

fn user_file(dir: PathBuf, username: String) -> Result<PathBuf> {
let mut user_data_file = dir;
let user_file_name = PathComponent::new(username).ok_or(Error::InvalidUsername)?;
let user_file_name = SinglePathComponent::new(username).ok_or(Error::InvalidUsername)?;
user_data_file.push_component(user_file_name);
Ok(user_data_file)
}
Expand Down
41 changes: 0 additions & 41 deletions pam-direct-fallback/src/path.rs

This file was deleted.

0 comments on commit e2e7c2b

Please sign in to comment.