diff --git a/src/monitor/process_monitor_main.cpp b/src/monitor/process_monitor_main.cpp index 06cdd337..90542004 100644 --- a/src/monitor/process_monitor_main.cpp +++ b/src/monitor/process_monitor_main.cpp @@ -58,6 +58,12 @@ namespace monitor static void drop_privileges() { auto orig_user = getpwnam(config().user.c_str()); + if (orig_user == nullptr) + { + Log::error() << "No user found with specified username."; + throw_errno(); + } + gid_t original_uid = orig_user->pw_uid; uid_t original_gid = orig_user->pw_gid;