mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Fix permissions on creating lock file
This commit is contained in:
parent
ed07a4666b
commit
2deb98a4c1
@ -4,7 +4,8 @@ use nix::libc::{mode_t, getpid};
|
||||
use sysinfo::{System, SystemExt, Pid, ProcessExt};
|
||||
|
||||
const LOCK_PATH: &str = "/run/lqos/lqosd.lock";
|
||||
const LOCK_DIR: &str = "/run/lqos/.";
|
||||
const LOCK_DIR: &str = "/run/lqos";
|
||||
const LOCK_DIR_PERMS: &str = "/run/lqos/.";
|
||||
|
||||
pub struct FileLock {}
|
||||
|
||||
@ -56,7 +57,7 @@ impl FileLock {
|
||||
Ok(())
|
||||
} else {
|
||||
std::fs::create_dir(dir_path)?;
|
||||
let unix_path = CString::new(LOCK_DIR)?;
|
||||
let unix_path = CString::new(LOCK_DIR_PERMS)?;
|
||||
unsafe {
|
||||
nix::libc::chmod(unix_path.as_ptr(), mode_t::from_le(666));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user