aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Grunert <mail@saschagrunert.de>2017-02-27 15:28:50 +0100
committerSascha Grunert <mail@saschagrunert.de>2017-02-27 15:28:50 +0100
commit0bfe9952b1b9387f22a4afc89370b5f11dec773a (patch)
tree790572a5e15834cd65d9d42ab9d18bf8e8129395
parentImproved cli parsing, fixed memory leaks (diff)
downloadwireguard-rs-0bfe9952b1b9387f22a4afc89370b5f11dec773a.tar.xz
wireguard-rs-0bfe9952b1b9387f22a4afc89370b5f11dec773a.zip
Fixed wrong path issue
-rw-r--r--src/lib.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 9876092..54f3165 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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