head 1.2; access; symbols pkgsrc-2013Q2:1.2.0.6 pkgsrc-2013Q2-base:1.2 pkgsrc-2012Q4:1.2.0.4 pkgsrc-2012Q4-base:1.2 pkgsrc-2011Q4:1.2.0.2 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q2:1.1.1.1.0.56 pkgsrc-2011Q2-base:1.1.1.1 pkgsrc-2011Q1:1.1.1.1.0.54 pkgsrc-2011Q1-base:1.1.1.1 pkgsrc-2010Q4:1.1.1.1.0.52 pkgsrc-2010Q4-base:1.1.1.1 pkgsrc-2010Q3:1.1.1.1.0.50 pkgsrc-2010Q3-base:1.1.1.1 pkgsrc-2010Q2:1.1.1.1.0.48 pkgsrc-2010Q2-base:1.1.1.1 pkgsrc-2010Q1:1.1.1.1.0.46 pkgsrc-2010Q1-base:1.1.1.1 pkgsrc-2009Q4:1.1.1.1.0.44 pkgsrc-2009Q4-base:1.1.1.1 pkgsrc-2009Q3:1.1.1.1.0.42 pkgsrc-2009Q3-base:1.1.1.1 pkgsrc-2009Q2:1.1.1.1.0.40 pkgsrc-2009Q2-base:1.1.1.1 pkgsrc-2009Q1:1.1.1.1.0.38 pkgsrc-2009Q1-base:1.1.1.1 pkgsrc-2008Q4:1.1.1.1.0.36 pkgsrc-2008Q4-base:1.1.1.1 pkgsrc-2008Q3:1.1.1.1.0.34 pkgsrc-2008Q3-base:1.1.1.1 cube-native-xorg:1.1.1.1.0.32 cube-native-xorg-base:1.1.1.1 pkgsrc-2008Q2:1.1.1.1.0.30 pkgsrc-2008Q2-base:1.1.1.1 cwrapper:1.1.1.1.0.28 pkgsrc-2008Q1:1.1.1.1.0.26 pkgsrc-2008Q1-base:1.1.1.1 pkgsrc-2007Q4:1.1.1.1.0.24 pkgsrc-2007Q4-base:1.1.1.1 pkgsrc-2007Q3:1.1.1.1.0.22 pkgsrc-2007Q3-base:1.1.1.1 pkgsrc-2007Q2:1.1.1.1.0.20 pkgsrc-2007Q2-base:1.1.1.1 pkgsrc-2007Q1:1.1.1.1.0.18 pkgsrc-2007Q1-base:1.1.1.1 pkgsrc-2006Q4:1.1.1.1.0.16 pkgsrc-2006Q4-base:1.1.1.1 pkgsrc-2006Q3:1.1.1.1.0.14 pkgsrc-2006Q3-base:1.1.1.1 pkgsrc-2006Q2:1.1.1.1.0.12 pkgsrc-2006Q2-base:1.1.1.1 pkgsrc-2006Q1:1.1.1.1.0.10 pkgsrc-2006Q1-base:1.1.1.1 pkgsrc-2005Q4:1.1.1.1.0.8 pkgsrc-2005Q4-base:1.1.1.1 pkgsrc-2005Q3:1.1.1.1.0.6 pkgsrc-2005Q3-base:1.1.1.1 pkgsrc-2005Q2:1.1.1.1.0.4 pkgsrc-2005Q2-base:1.1.1.1 pkgsrc-2005Q1:1.1.1.1.0.2 pkgsrc-2005Q1-base:1.1.1.1 pkgsrc-base:1.1.1.1 TNF:1.1.1; locks; strict; comment @# @; 1.2 date 2011.10.02.14.11.59; author wiz; state dead; branches; next 1.1; 1.1 date 2005.01.06.11.44.16; author adam; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.01.06.11.44.16; author adam; state Exp; branches; next ; desc @@ 1.2 log @Remove packages scheduled to be deleted according to the pkgsrc-2011Q2 release notes. @ text @$NetBSD: patch-ab,v 1.1 2005/01/06 11:44:16 adam Exp $ --- ntop.c.orig Wed Apr 28 19:49:00 1999 +++ ntop.c @@@@ -254,7 +254,7 @@@@ initIPServices(); #ifndef WIN32 - while ((op = getopt(argc, argv, "df:F:hr:i:p:l:nw:m:")) != EOF) + while ((op = getopt(argc, argv, "df:F:hr:i:p:l:nm:")) != EOF) switch (op) { #ifndef WIN32 @@@@ -324,6 +324,7 @@@@ numericFlag++; break; +#if 0 case 'w': if(!isdigit(optarg[0])) { printf("FATAL ERROR: flag -w expects a numeric argument.\n"); @@@@ -332,6 +333,7 @@@@ webMode++; webPort = atoi(optarg); break; +#endif default: usage(0); @@@@ -348,11 +350,6 @@@@ #endif #ifndef WIN32 - if((rFileName == NULL) && (getuid () && geteuid ()) || setuid (0)) { - printf("Sorry, you must be superuser in order to run ntop.\n"); - return(-1); - } - if(daemonMode && (!webMode)) { printf("WARNING: -d is incompatible with interactive mode.\n"); } else if(daemonMode) @@@@ -392,13 +389,30 @@@@ #ifndef WIN32 /* Determine the device name if not specified */ if (device == NULL && (device = pcap_lookupdev(ebuf)) == NULL) { - printf(ebuf); + printf("%s\n", ebuf); return(-1); } getLocalHostAddress(&localHostAddress, device); if(rFileName == NULL) { + /* Fire up libpcap */ + pcapPtr = pcap_open_live(device, DEFAULT_SNAPLEN, !pflag, 1000, ebuf); + } else { + pcapPtr = pcap_open_offline(rFileName, ebuf); + } + + if (pcapPtr == NULL) { + printf("%s\n", ebuf); + return(-1); + } + + if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) { + printf("%s\n", ebuf); + return(-1); + } + + if(rFileName == NULL) { if(webMode) { (void)fprintf(stderr, "ntop v.%s %s [%s]" #ifndef WIN32 @@@@ -418,21 +432,6 @@@@ init_curses(); } #endif - - /* Fire up libpcap */ - pcapPtr = pcap_open_live(device, DEFAULT_SNAPLEN, !pflag, 1000, ebuf); - } else { - pcapPtr = pcap_open_offline(rFileName, ebuf); - } - - if (pcapPtr == NULL) { - printf(ebuf); - return(-1); - } - - if (pcap_lookupnet(device, &localnet, &netmask, ebuf) < 0) { - printf(ebuf); - return(-1); } #else /* WIN32 */ printf("ntop v.%s %s [%s]" @@@@ -458,12 +457,6 @@@@ free(localAddresses); localAddresses = NULL; } - -#ifndef WIN32 - /* Now that the socket is open, throw away potential setuid/setgid */ - (void)setgid(getgid()); - (void)setuid(getuid()); -#endif #ifndef WIN32 /* get datalink type */ @ 1.1 log @Initial revision @ text @d1 1 a1 1 $NetBSD: patch-ab,v 1.9 2001/03/10 18:00:51 wiz Exp $ @ 1.1.1.1 log @net/ntop renamed to net/ntop1 @ text @@