1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-02-07 00:37:55 +00:00

Changed the check for superuser from error to warning.

The check is done so early that we can't reasonably know yet if we really
need to be root. For VDE, root is unneeded, but for the other interface
methods it is.
This commit is contained in:
Olaf Seibert
2016-01-25 22:43:45 +01:00
parent 3830fca3f9
commit 162cf21aca
3 changed files with 10 additions and 7 deletions

View File

@@ -434,7 +434,7 @@ main(int argc, char **argv)
** we can, since a slow response will cause the 10 monitor to declare
** the interface dead.
*/
#if CENV_SYS_SOLARIS || CENV_SYS_DECOSF || CENV_SYS_XBSD || CENV_SYS_LINUX
#if HAVE_SETPRIORITY
if (setpriority(PRIO_PROCESS, 0, -20) < 0)
syserr(errno, "Warning - cannot set high priority");
#elif CENV_SYS_UNIX /* Try old generic Unix call */
@@ -455,8 +455,9 @@ main(int argc, char **argv)
dbprint("Started");
/* General initialization */
if (geteuid() != 0)
efatal(1, "Must be superuser!");
if (geteuid() != 0) {
error("*** Must usually run as superuser; networking may fail! ***");
}
if (!dp_main(&dp, argc, argv)) {
efatal(1, "DP init failed!");

View File

@@ -320,7 +320,7 @@ main(int argc, char **argv)
#if 0 /* was CENV_SYS_SOLARIS */
if (nice(-20) == -1)
syserr(errno, "Warning - cannot set high priority");
#elif CENV_SYS_SOLARIS || CENV_SYS_DECOSF || CENV_SYS_XBSD || CENV_SYS_LINUX
#elif HAVE_SETPRIORITY
if (setpriority(PRIO_PROCESS, 0, -20) < 0)
syserr(errno, "Warning - cannot set high priority");
#endif
@@ -336,8 +336,9 @@ main(int argc, char **argv)
dbprint("Started");
/* General initialization */
if (geteuid() != 0)
efatal(1, "Must be superuser!");
if (geteuid() != 0) {
error("*** Must usually run as superuser; networking may fail! ***");
}
if (!dp_main(&dp, argc, argv)) {
efatal(1, "DP init failed!");