*/
#ifndef lint
-static char rcsid[] = "$Id: main.c,v 1.38 1996/10/08 04:35:03 paulus Exp $";
+static char rcsid[] = "$Id: main.c,v 1.39 1996/10/08 06:43:49 paulus Exp $";
#endif
#include <stdio.h>
#endif
if (gethostname(hostname, MAXNAMELEN) < 0 ) {
- syslog(LOG_ERR, "couldn't get hostname: %m");
+ option_error("Couldn't get hostname: %m");
die(1);
}
hostname[MAXNAMELEN-1] = 0;
exit(1);
}
+ /*
+ * Check that we are running as root.
+ */
+ if (geteuid() != 0) {
+ option_error("must be root to run %s, since it is not setuid-root",
+ argv[0]);
+ die(1);
+ }
+
/*
* Check that the options given are valid and consistent.
*/