Skip to content

Commit

Permalink
changed the seteuid(0) errors to warning, and only print if debugging…
Browse files Browse the repository at this point in the history
… is enabled
  • Loading branch information
hedenface committed Jul 3, 2017
1 parent 5a51764 commit 005e20f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/nrpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -2221,8 +2221,8 @@ int my_system(char *command, int timeout, int *early_timeout, char **output)
if (pid == 0) {

/* get root back so the next call works correctly */
if (SETEUID(0) == -1)
logit(LOG_ERR, "ERROR: my_system() seteuid(0): %s", strerror(errno));
if (SETEUID(0) == -1 && debug)
logit(LOG_WARNING, "WARNING: my_system() seteuid(0): %s", strerror(errno));

drop_privileges(nrpe_user, nrpe_group, 1); /* drop privileges */
close(fd[0]); /* close pipe for reading */
Expand Down Expand Up @@ -2493,8 +2493,8 @@ int remove_pid_file(void)
return OK; /* pid file was not written */

/* get root back so we can delete the pid file */
if (SETEUID(0) == -1)
logit(LOG_ERR, "ERROR: remove_pid_file() seteuid(0): %s", strerror(errno));
if (SETEUID(0) == -1 && debug)
logit(LOG_WARNING, "WARNING: remove_pid_file() seteuid(0): %s", strerror(errno));

if (unlink(pid_file) == -1) {
logit(LOG_ERR, "Cannot remove pidfile '%s' - check your privileges.", pid_file);
Expand Down

0 comments on commit 005e20f

Please sign in to comment.