diff options
-rw-r--r-- | nix/nix-daemon/guix-daemon.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nix/nix-daemon/guix-daemon.cc b/nix/nix-daemon/guix-daemon.cc index 0e72b1d219..459c794f5d 100644 --- a/nix/nix-daemon/guix-daemon.cc +++ b/nix/nix-daemon/guix-daemon.cc @@ -25,6 +25,8 @@ #include <stdlib.h> #include <argp.h> +#include <unistd.h> +#include <sys/types.h> /* Variables used by `nix-daemon.cc'. */ volatile ::sig_atomic_t blockInt; @@ -176,6 +178,10 @@ main (int argc, char *argv[]) argp_parse (&argp, argc, argv, 0, 0, 0); + if (geteuid () == 0 && settings.buildUsersGroup.empty ()) + fprintf (stderr, "warning: running as root is highly recommended, " + "unless `--build-users-group' is used\n"); + argvSaved = argv; run (nothing); } |