Skip to content

Commit

Permalink
daemon: enable chroot jail
Browse files Browse the repository at this point in the history
The chroot jail can be enabled now that the protocol instances don't
need to connect to the zebra AF_UNIX socket anymore.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
  • Loading branch information
rwestphal committed Dec 21, 2023
1 parent 191d48b commit 6490c38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions holo-daemon/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ fn privdrop(user: &str) -> nix::Result<()> {

// Drop to unprivileged user and group.
if let Some(user) = User::from_name(user)? {
//nix::unistd::chroot(&user.dir)?;
//nix::unistd::chdir("/")?;
nix::unistd::chroot(&user.dir)?;
nix::unistd::chdir("/")?;
nix::unistd::setgroups(&[user.gid])?;
nix::unistd::setresgid(user.gid, user.gid, user.gid)?;
nix::unistd::setresuid(user.uid, user.uid, user.uid)?;
Expand Down

0 comments on commit 6490c38

Please sign in to comment.