mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
daemon: Warn against running as root without `--build-users-group'.
* nix/nix-daemon/guix-daemon.cc (main): Recommend using `--build-users-group' when running as root without a build users group.
This commit is contained in:
parent
72ce03739e
commit
e2332e8aa7
1 changed files with 6 additions and 0 deletions
|
@ -25,6 +25,8 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <argp.h>
|
#include <argp.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
/* Variables used by `nix-daemon.cc'. */
|
/* Variables used by `nix-daemon.cc'. */
|
||||||
volatile ::sig_atomic_t blockInt;
|
volatile ::sig_atomic_t blockInt;
|
||||||
|
@ -176,6 +178,10 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
argp_parse (&argp, argc, argv, 0, 0, 0);
|
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;
|
argvSaved = argv;
|
||||||
run (nothing);
|
run (nothing);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue