1
0

003-change-user-and-foreground.patch 415 B

1234567891011121314151617
  1. --- a/src/libs/zbxnix/daemon.c
  2. +++ b/src/libs/zbxnix/daemon.c
  3. @@ -300,11 +300,14 @@ int daemon_start(int allow_root, const c
  4. if (0 == allow_root && 0 == getuid()) /* running as root? */
  5. {
  6. +#if 0
  7. +/* allow changing user and foreground */
  8. if (0 != (flags & ZBX_TASK_FLAG_FOREGROUND))
  9. {
  10. zbx_error("cannot run as root!");
  11. exit(EXIT_FAILURE);
  12. }
  13. +#endif
  14. if (NULL == user)
  15. user = "zabbix";