Skip to content

Commit

Permalink
Remove "users" crate, call libc directly
Browse files Browse the repository at this point in the history
This is all I actually needed anyways
  • Loading branch information
DeCarabas committed Aug 13, 2024
1 parent 35dcf93 commit df0ca4c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
12 changes: 1 addition & 11 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ tempdir = "0.3"
procfs = "0.14.1"

[target.'cfg(target_family="unix")'.dependencies]
users = "0.11"
libc = "0.2.155"
3 changes: 2 additions & 1 deletion src/reverse/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ fn socket_directory() -> Result<std::path::PathBuf> {
Ok(path) => Ok(path),
Err(_) => {
let mut path = std::env::temp_dir();
path.push(format!("fwd{}", users::get_current_uid()));
let uid = unsafe { libc::getuid() };
path.push(format!("fwd{}", uid));
Ok(path)
}
}
Expand Down

0 comments on commit df0ca4c

Please sign in to comment.