Skip to content

Commit

Permalink
chore: fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
NOBLES5E committed Sep 20, 2024
1 parent 24d137b commit c3ce01c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cproxy"
version = "4.2.0"
version = "4.2.1"
authors = ["Xiangru Lian <[email protected]>"]
description = "Transparent proxy built on cgroup net_cls."
homepage = "https://github.com/NOBLES5E/cproxy"
Expand Down
12 changes: 5 additions & 7 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![allow(dyn_drop)]

use std::os::unix::prelude::CommandExt;
use crate::guards::TraceGuard;
use eyre::Result;
use guards::{CGroupGuard, RedirectGuard, TProxyGuard};
use std::os::unix::prelude::CommandExt;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use std::time::Duration;
Expand Down Expand Up @@ -177,12 +177,10 @@ fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
.init();
nix::unistd::seteuid(nix::unistd::Uid::from_raw(0)).expect(
"cproxy failed to seteuid, please `chown root:root` and `chmod +s` on cproxy binary",
);
nix::unistd::setegid(nix::unistd::Gid::from_raw(0)).expect(
"cproxy failed to seteuid, please `chown root:root` and `chmod +s` on cproxy binary",
);
nix::unistd::seteuid(nix::unistd::Uid::from_raw(0))
.expect("cproxy failed to seteuid, please run as root");
nix::unistd::setegid(nix::unistd::Gid::from_raw(0))
.expect("cproxy failed to seteuid, please run as root");
let args: Cli = Cli::from_args();

match args.pid {
Expand Down

0 comments on commit c3ce01c

Please sign in to comment.