Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use extern crate path_ratchet #41

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading