fix windows build
This commit is contained in:
parent
cf6a3feb44
commit
b4dbca4be3
@ -216,12 +216,17 @@ pub async fn run_args(pool: &Pool<Sqlite>) -> Result<(), i32> {
|
||||
let mut error_code = -1;
|
||||
|
||||
if args.init {
|
||||
let uid = nix::unistd::Uid::current();
|
||||
let current_user = nix::unistd::User::from_uid(uid).unwrap_or_default();
|
||||
#[cfg(target_family = "unix")]
|
||||
let process_user = nix::unistd::User::from_name("ffpu").unwrap_or_default();
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
let mut fix_permission = false;
|
||||
|
||||
#[cfg(target_family = "unix")]
|
||||
{
|
||||
let uid = nix::unistd::Uid::current();
|
||||
let current_user = nix::unistd::User::from_uid(uid).unwrap_or_default();
|
||||
|
||||
if current_user != process_user {
|
||||
let user_name = current_user.unwrap().name;
|
||||
let mut fix_perm = String::new();
|
||||
@ -246,6 +251,7 @@ pub async fn run_args(pool: &Pool<Sqlite>) -> Result<(), i32> {
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let check_user = handles::select_users(pool).await;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user