Skip to content

Commit c3ce01c

Browse files
committed
chore: fix error message
1 parent 24d137b commit c3ce01c

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cproxy"
3-
version = "4.2.0"
3+
version = "4.2.1"
44
authors = ["Xiangru Lian <[email protected]>"]
55
description = "Transparent proxy built on cgroup net_cls."
66
homepage = "https://github.com/NOBLES5E/cproxy"

src/main.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
#![allow(dyn_drop)]
22

3-
use std::os::unix::prelude::CommandExt;
43
use crate::guards::TraceGuard;
54
use eyre::Result;
65
use guards::{CGroupGuard, RedirectGuard, TProxyGuard};
6+
use std::os::unix::prelude::CommandExt;
77
use std::sync::atomic::{AtomicBool, Ordering};
88
use std::sync::Arc;
99
use std::time::Duration;
@@ -177,12 +177,10 @@ fn main() -> Result<()> {
177177
tracing_subscriber::fmt()
178178
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
179179
.init();
180-
nix::unistd::seteuid(nix::unistd::Uid::from_raw(0)).expect(
181-
"cproxy failed to seteuid, please `chown root:root` and `chmod +s` on cproxy binary",
182-
);
183-
nix::unistd::setegid(nix::unistd::Gid::from_raw(0)).expect(
184-
"cproxy failed to seteuid, please `chown root:root` and `chmod +s` on cproxy binary",
185-
);
180+
nix::unistd::seteuid(nix::unistd::Uid::from_raw(0))
181+
.expect("cproxy failed to seteuid, please run as root");
182+
nix::unistd::setegid(nix::unistd::Gid::from_raw(0))
183+
.expect("cproxy failed to seteuid, please run as root");
186184
let args: Cli = Cli::from_args();
187185

188186
match args.pid {

0 commit comments

Comments
 (0)