From 0837b8d2df3e2a4e82a50c9350a8a7c16198f2fc Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sun, 20 Dec 2020 10:48:26 +0100 Subject: [PATCH] Do not print user change information if there is no user change Signed-off-by: DL6ER --- src/dnsmasq_interface.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dnsmasq_interface.c b/src/dnsmasq_interface.c index 0a0e96f1..0801bd32 100644 --- a/src/dnsmasq_interface.c +++ b/src/dnsmasq_interface.c @@ -1774,7 +1774,9 @@ void FTL_fork_and_bind_sockets(struct passwd *ent_pw) // option states to run as a different user/group (e.g. "nobody") if(getuid() == 0) { - if(ent_pw != NULL) + // Only print this and change ownership of shmem objects when + // we're actually dropping root (user/group my be set to root) + if(ent_pw != NULL && ent_pw->pw_uid != 0) { logg("INFO: FTL is going to drop from root to user %s (UID %d)", ent_pw->pw_name, (int)ent_pw->pw_uid);