mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-24 23:56:13 -05:00
Release 3.6.0
This commit is contained in:
58 files changed
+2191
-642
No files matched your search
@@ -0,0 +1,24 @@
|
||||
use std::{
|
||||
fs, io,
|
||||
os::unix::fs::PermissionsExt,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
pub(super) fn default_path() -> Option<PathBuf> {
|
||||
let home = std::env::var("HOME").unwrap_or_else(|_| "/root".to_string());
|
||||
Some(PathBuf::from(home).join(".config/gpclient/cookie.json"))
|
||||
}
|
||||
|
||||
pub(super) fn encode(bytes: Vec<u8>) -> io::Result<Vec<u8>> {
|
||||
Ok(bytes)
|
||||
}
|
||||
|
||||
pub(super) use encode as decode;
|
||||
|
||||
pub(super) fn prepare_directory(path: &Path) -> io::Result<()> {
|
||||
fs::set_permissions(path, fs::Permissions::from_mode(0o700))
|
||||
}
|
||||
|
||||
pub(super) fn prepare_file(path: &Path) -> io::Result<()> {
|
||||
fs::set_permissions(path, fs::Permissions::from_mode(0o600))
|
||||
}
|
||||
Reference in new issue
Block a user