Do not print user change information if there is no user change

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2020-12-20 10:48:26 +01:00
parent b52eb1f2a5
commit 0837b8d2df
+3 -1
View File
@@ -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);