head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.54 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.52 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.50 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.48 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.46 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.44 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.42 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.40 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.5.0.38 pkgsrc-2008Q2-base:1.5 pkgsrc-2008Q1:1.5.0.36 pkgsrc-2008Q1-base:1.5 pkgsrc-2007Q4:1.5.0.34 pkgsrc-2007Q4-base:1.5 pkgsrc-2007Q3:1.5.0.32 pkgsrc-2007Q3-base:1.5 pkgsrc-2007Q2:1.5.0.30 pkgsrc-2007Q2-base:1.5 pkgsrc-2007Q1:1.5.0.28 pkgsrc-2007Q1-base:1.5 pkgsrc-2006Q4:1.5.0.26 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.24 pkgsrc-2006Q3-base:1.5 pkgsrc-2006Q2:1.5.0.22 pkgsrc-2006Q2-base:1.5 pkgsrc-2006Q1:1.5.0.20 pkgsrc-2006Q1-base:1.5 pkgsrc-2005Q4:1.5.0.18 pkgsrc-2005Q4-base:1.5 pkgsrc-2005Q3:1.5.0.16 pkgsrc-2005Q3-base:1.5 pkgsrc-2005Q2:1.5.0.14 pkgsrc-2005Q2-base:1.5 pkgsrc-2005Q1:1.5.0.12 pkgsrc-2005Q1-base:1.5 pkgsrc-2004Q4:1.5.0.10 pkgsrc-2004Q4-base:1.5 pkgsrc-2004Q3:1.5.0.8 pkgsrc-2004Q3-base:1.5 pkgsrc-2004Q2:1.5.0.6 pkgsrc-2004Q2-base:1.5 pkgsrc-2004Q1:1.5.0.4 pkgsrc-2004Q1-base:1.5 pkgsrc-2003Q4:1.5.0.2 pkgsrc-2003Q4-base:1.5 buildlink2-base:1.5 netbsd-1-4-PATCH002:1.4 comdex-fall-1999:1.4 netbsd-1-4-PATCH001:1.4 netbsd-1-4-RELEASE:1.4 netbsd-1-3-PATCH003:1.2; locks; strict; comment @# @; 1.5 date 2000.09.19.20.00.04; author agc; state dead; branches; next 1.4; 1.4 date 98.10.11.21.07.11; author kim; state Exp; branches; next 1.3; 1.3 date 98.10.11.20.27.04; author kim; state Exp; branches; next 1.2; 1.2 date 98.08.08.21.30.25; author kim; state Exp; branches; next 1.1; 1.1 date 98.08.08.21.28.32; author kim; state Exp; branches; next ; desc @@ 1.5 log @Install the binary for this package as mode 550, and disable the -w option, to avoid any compromises due to reported buffer overflow exploits, reported in ntop<=1.0 remote-root-shell http://www.securityfocus.com/advisories/2520 Also, upgrade to 1.1 on the distribution site, as the old distfile is no longer there, and 1.1 incorporates all the old patches in the pkgsrc version bar one minor one (passing CPPFLAGS into Makefile.in for the build environment). @ text @$NetBSD: patch-af,v 1.4 1998/10/11 21:07:11 kim Exp $ *** pbuf.c.orig Tue Oct 6 03:49:59 1998 --- pbuf.c Sun Oct 11 15:45:15 1998 *************** *** 265,270 **** --- 265,271 ---- void init_counters() { char *p; struct servent *svnt; + struct hostent *hent; (void)setsignal(SIGWINCH, windowSizeChanged); *************** *** 272,287 **** * The name of the local domain is now calculated properly * Kimmo Suominen */ ! if((getdomainname(domainName, MAXHOSTNAMELEN) != 0) ! || (domainName[0] == '\0')) ! { ! if ((gethostname(domainName, MAXHOSTNAMELEN) == 0) ! && ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL)) { domainName[MAXHOSTNAMELEN - 1] = '\0'; ! memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); ! } else ! domainName[0] = '\0'; ! } init_curses(); resetStats(); --- 273,290 ---- * The name of the local domain is now calculated properly * Kimmo Suominen */ ! if (gethostname(domainName, MAXHOSTNAMELEN) == 0) { ! if ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL) { ! domainName[MAXHOSTNAMELEN - 1] = '\0'; ! memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); ! } else ! if (((hent = gethostbyname(domainName)) != NULL) ! && ((p = strchr(hent->h_name, '.')) != NULL)) { ! strncpy(domainName, ++p, MAXHOSTNAMELEN); domainName[MAXHOSTNAMELEN - 1] = '\0'; ! } ! } else ! domainName[0] = '\0'; init_curses(); resetStats(); @ 1.4 log @Missing tag (only for one file this time!) @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Updated ntop to 1.0 @ text @d1 2 @ 1.2 log @Forgot that tag... (diff should output it for me?) @ text @d1 49 a49 53 $NetBSD$ --- pbuf.c.orig Mon Aug 3 08:50:07 1998 +++ pbuf.c Sat Aug 8 17:22:28 1998 @@@@ -100,7 +100,7 @@@@ /* Static */ static clock_t lastTime; static int lastNumLines, lastNumCols; -static char domainName[64]; +static char domainName[MAXHOSTNAMELEN]; static short sortSendMode=0; static char hex[] = "0123456789ABCDEF"; static short screenNumber=0; @@@@ -289,6 +289,8 @@@@ void init_curses () { + char *p; + if(webMode) return; initscr (); @@@@ -305,7 +307,12 @@@@ lastNumLines = LINES; lastNumCols = COLS; - domainName[0] = '\0'; + if ((gethostname(domainName, MAXHOSTNAMELEN) == 0) + && ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL)) { + domainName[MAXHOSTNAMELEN - 1] = '\0'; + memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p); + } else + domainName[0] = '\0'; printHeader(); } @@@@ -418,16 +425,6 @@@@ if (hp && (hp->h_name)) { char *dotp = (char*)hp->h_name; - if((domainName[0] == '\0') - && ((hostIpAddress.s_addr & netmask) == localnet)) { - int i; - - for(i=0; dotp[i] != '\0' && dotp[i] != '.'; i++); - - if((dotp[i] == '.') && (isalpha(dotp[strlen(dotp)-1]))) - strcpy(domainName, &dotp[i+1]); - } - if(domainName[0] != '\0') { int len = strlen(dotp)-strlen(domainName); @ 1.1 log @The logic for determining the local domain was wrong. Using gethostname(3) instead (could use gethostbyname(3) on top of that, I guess...). @ text @d1 2 @