From 7cdde423dec01f9807a245b5e1172e86e4555ec9 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 23 Oct 2019 04:58:37 -0400 Subject: set both real and effective uid and gid when dropping privs some things still read the real uid, and we don't want to be able to switch back anyway --- src/cmd/server.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cmd/server.rs b/src/cmd/server.rs index d10bb49..979bbd4 100644 --- a/src/cmd/server.rs +++ b/src/cmd/server.rs @@ -176,11 +176,11 @@ fn drop_privs( gid: Option, ) -> Result<()> { if let Some(gid) = gid { - users::switch::set_effective_gid(gid) + users::switch::set_both_gid(gid, gid) .context(crate::error::SwitchGid)?; } if let Some(uid) = uid { - users::switch::set_effective_uid(uid) + users::switch::set_both_uid(uid, uid) .context(crate::error::SwitchUid)?; } Ok(()) -- cgit v1.2.3-54-g00ecf