From: Ian Jackson Date: Sun, 26 Jul 2020 19:23:45 +0000 (+0100) Subject: set perms X-Git-Tag: otter-0.2.0~1242 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=6bf63e62e09df40cc54a9259d9484151a943c278;p=otter.git set perms --- 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};