{
int flood = FALSE, graph = FALSE;
- setlinebuf(stderr);
-
if (geteuid() != 0) {
- fprintf(stderr, "must be root\n");
- exit(1);
+ fprintf(stderr, "map-mbone: must be root\n");
+ exit(1);
}
+ init_igmp();
+ setuid(getuid());
+
+ setlinebuf(stderr);
+
argv++, argc--;
while (argc > 0 && argv[0][0] == '-') {
switch (argv[0][1]) {
if (debug)
fprintf(stderr, "Debug level %u\n", debug);
- init_igmp();
-
{ /* Find a good local address for us. */
int udp;
struct sockaddr_in addr;
char *host;
int curaddr;
- setlinebuf(stderr);
-
if (geteuid() != 0) {
fprintf(stderr, "mrinfo: must be root\n");
exit(1);
}
+
+ init_igmp();
+ setuid(getuid());
+
+ setlinebuf(stderr);
+
argv++, argc--;
while (argc > 0 && argv[0][0] == '-') {
switch (argv[0][1]) {
if (debug)
fprintf(stderr, "Debug level %u\n", debug);
- init_igmp();
-
/* Check all addresses; mrouters often have unreachable interfaces */
for (curaddr = 0; hp->h_addr_list[curaddr] != NULL; curaddr++) {
memcpy(&target_addr, hp->h_addr_list[curaddr], hp->h_length);
#ifndef lint
static char rcsid[] =
- "@(#) $Id: main.c,v 1.3 1995/12/19 17:48:04 deraadt Exp $";
+ "@(#) $Id: main.c,v 1.4 1996/09/11 19:15:33 deraadt Exp $";
#endif
extern char *configfilename;
int index, block;
#endif
- setlinebuf(stderr);
-
if (geteuid() != 0) {
fprintf(stderr, "must be root\n");
exit(1);
}
+ setlinebuf(stderr);
argv++, argc--;
while (argc > 0 && *argv[0] == '-') {
#ifndef lint
static char rcsid[] =
- "@(#) $Id: mtrace.c,v 1.2 1995/12/14 01:46:22 deraadt Exp $";
+ "@(#) $Id: mtrace.c,v 1.3 1996/09/11 19:15:36 deraadt Exp $";
#endif
#include <netdb.h>
int waittime;
int seed;
- if (geteuid() != 0) {
- fprintf(stderr, "mtrace: must be root\n");
- exit(1);
- }
+ init_igmp();
+ setuid(getuid());
argv++, argc--;
if (argc == 0) goto usage;
exit(1);
}
- init_igmp();
-
/*
* Set useful defaults for as many parameters as possible.
*/