mirror of
https://github.com/sadoyan/aralez.git
synced 2026-06-10 17:24:21 +08:00
socker address #41
This commit is contained in:
@@ -274,7 +274,7 @@ pub fn drop_priv(user: String, group: String, http_addr: String, tls_addr: Optio
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn check_priv(addr: &str) {
|
pub fn check_priv(addr: &str) {
|
||||||
let port = SocketAddr::from_str(addr).map(|sa| sa.port()).unwrap();
|
let port = SocketAddr::from_str(addr).map(|sa| sa.port()).expect("Failed to parse address port ");
|
||||||
if port < 1024 {
|
if port < 1024 {
|
||||||
let meta = std::fs::metadata("/proc/self").map(|m| m.uid()).unwrap();
|
let meta = std::fs::metadata("/proc/self").map(|m| m.uid()).unwrap();
|
||||||
if meta != 0 {
|
if meta != 0 {
|
||||||
|
|||||||
Reference in New Issue
Block a user