chiark / gitweb /
set perms
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2020 19:23:45 +0000 (20:23 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 26 Jul 2020 19:23:45 +0000 (20:23 +0100)
src/cmdlistener.rs
src/imports.rs

index 5a291d0852b38e94cc5dcdca89483da133e1f83a..1c2f57c46d45f97ba17e7ff8fb37c9812957e434 100644 (file)
@@ -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 }
   }
 
index bd47932b04aaf7d1e7e35b8bb05d88354b3ad070..4013313b9b191561f6c71ed1c3285a93eafa77e3 100644 (file)
@@ -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};