diff options
author | Sascha Grunert <mail@saschagrunert.de> | 2017-02-27 15:28:50 +0100 |
---|---|---|
committer | Sascha Grunert <mail@saschagrunert.de> | 2017-02-27 15:28:50 +0100 |
commit | 0bfe9952b1b9387f22a4afc89370b5f11dec773a (patch) | |
tree | 790572a5e15834cd65d9d42ab9d18bf8e8129395 | |
parent | Improved cli parsing, fixed memory leaks (diff) | |
download | wireguard-rs-0bfe9952b1b9387f22a4afc89370b5f11dec773a.tar.xz wireguard-rs-0bfe9952b1b9387f22a4afc89370b5f11dec773a.zip |
Fixed wrong path issue
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -47,12 +47,13 @@ impl WireGuard { } else { PathBuf::from("/var").join("run") }; - socket_path.join("wireguard"); + socket_path = socket_path.join("wireguard"); + if !socket_path.exists() { debug!("Creating socket path: {}", socket_path.display()); create_dir(&socket_path)?; } - debug!("Setting chmod of socket path."); + debug!("Setting chmod 0700 of socket path: {}", socket_path.display()); Self::chmod(&socket_path, 0o700)?; // Finish the socket path |