From 6bf63e62e09df40cc54a9259d9484151a943c278 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 26 Jul 2020 20:23:45 +0100 Subject: [PATCH] set perms --- src/cmdlistener.rs | 4 ++++ src/imports.rs | 1 + 2 files changed, 5 insertions(+) diff --git a/src/cmdlistener.rs b/src/cmdlistener.rs index 5a291d08..1c2f57c4 100644 --- a/src/cmdlistener.rs +++ b/src/cmdlistener.rs @@ -363,6 +363,10 @@ impl CommandListener { .with_context(|| format!("remove socket {:?} before we bind", &path))?; let listener = UnixListener::bind(path) .with_context(|| format!("bind command socket {:?}", &path))?; + + fs::set_permissions(path, unix::fs::PermissionsExt::from_mode(0666)) + .with_context(|| format!("chmod sommand socket {:?}", &path))?; + CommandListener { listener } } diff --git a/src/imports.rs b/src/imports.rs index bd47932b..4013313b 100644 --- a/src/imports.rs +++ b/src/imports.rs @@ -24,6 +24,7 @@ pub use std::ops::{Deref,DerefMut}; pub use std::fs; pub use std::fs::File; pub use std::mem; +pub use std::os::unix; pub use thiserror::Error; pub use anyhow::{Context,anyhow}; -- 2.30.2