diff -cr squid-1.0.beta8/ChangeLog squid-1.0.beta9/ChangeLog *** squid-1.0.beta8/ChangeLog Tue May 21 21:18:58 1996 --- squid-1.0.beta9/ChangeLog Wed May 22 22:13:58 1996 *************** *** 193,195 **** --- 193,204 ---- is returned in the UDP packet if it will fit; saves a TCP connection. Not compiled in by default, add -DUDP_HIT_WITH_OBJ to src/Makefile DEFINES. + + + Changes to squid-1.0.beta9 (May 23, 1996): + + - Fixed storeToString() coredump bug on 'swap_buf' + - Added back the CIDR notation functionality to decoding IP + address ACLs. + - Fixed ftpget listing parsing coredump bug. + - Fixed neighborsUdpAck() coredump for late-arriving ICP replies. diff -cr squid-1.0.beta8/configure squid-1.0.beta9/configure *** squid-1.0.beta8/configure Mon May 20 15:13:00 1996 --- squid-1.0.beta9/configure Wed May 22 22:13:18 1996 *************** *** 517,523 **** ! # From configure.in Revision: 1.18.2.14 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then --- 517,523 ---- ! # From configure.in Revision: 1.18.2.15 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then *************** *** 2007,2012 **** --- 2007,2013 ---- for ac_func in \ getdtablesize \ getrusage \ + lrand48 \ mallinfo \ mallopt \ regcomp \ *************** *** 2017,2022 **** --- 2018,2024 ---- setresuid \ setrlimit \ setsid \ + srand48 \ strdup \ sysconf \ syslog \ *************** *** 2029,2035 **** echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&6 else cat > conftest.$ac_ext < conftest.$ac_ext < --- 2081,2087 ---- SQUID_FD_SETSIZE=256 else cat > conftest.$ac_ext < *************** *** 2146,2152 **** SQUID_UDP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < --- 2148,2154 ---- SQUID_UDP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < *************** *** 2182,2188 **** SQUID_UDP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < --- 2184,2190 ---- SQUID_UDP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < *************** *** 2218,2224 **** SQUID_TCP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < --- 2220,2226 ---- SQUID_TCP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < *************** *** 2254,2260 **** SQUID_TCP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < --- 2256,2262 ---- SQUID_TCP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < diff -cr squid-1.0.beta8/configure.in squid-1.0.beta9/configure.in *** squid-1.0.beta8/configure.in Mon May 20 15:13:00 1996 --- squid-1.0.beta9/configure.in Wed May 22 22:13:19 1996 *************** *** 3,15 **** dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl ! dnl $Id: configure.in,v 1.18.2.15 1996/05/20 22:13:00 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) ! AC_REVISION($Revision: 1.18.2.15 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(aux) --- 3,15 ---- dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl ! dnl $Id: configure.in,v 1.18.2.16 1996/05/23 05:13:19 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) ! AC_REVISION($Revision: 1.18.2.16 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(aux) *************** *** 238,243 **** --- 238,244 ---- AC_CHECK_FUNCS(\ getdtablesize \ getrusage \ + lrand48 \ mallinfo \ mallopt \ regcomp \ *************** *** 248,253 **** --- 249,255 ---- setresuid \ setrlimit \ setsid \ + srand48 \ strdup \ sysconf \ syslog \ diff -cr squid-1.0.beta8/include/autoconf.h.in squid-1.0.beta9/include/autoconf.h.in *** squid-1.0.beta8/include/autoconf.h.in Fri May 17 14:14:37 1996 --- squid-1.0.beta9/include/autoconf.h.in Wed May 22 22:13:19 1996 *************** *** 58,63 **** --- 58,66 ---- /* Define if you have the getrusage function. */ #undef HAVE_GETRUSAGE + /* Define if you have the lrand48 function. */ + #undef HAVE_LRAND48 + /* Define if you have the mallinfo function. */ #undef HAVE_MALLINFO *************** *** 87,92 **** --- 90,98 ---- /* Define if you have the setsid function. */ #undef HAVE_SETSID + + /* Define if you have the srand48 function. */ + #undef HAVE_SRAND48 /* Define if you have the strdup function. */ #undef HAVE_STRDUP diff -cr squid-1.0.beta8/src/acl.c squid-1.0.beta9/src/acl.c *** squid-1.0.beta8/src/acl.c Tue May 21 10:53:04 1996 --- squid-1.0.beta9/src/acl.c Wed May 22 22:55:23 1996 *************** *** 1,4 **** ! /* "$Id: acl.c,v 1.12.2.11 1996/05/21 17:53:04 wessels Exp $" */ /* * DEBUG: Section 28 acl --- 1,4 ---- ! /* "$Id: acl.c,v 1.12.2.13 1996/05/23 05:55:23 wessels Exp $" */ /* * DEBUG: Section 28 acl *************** *** 49,55 **** return ACL_URL_PORT; if (!strcmp(s, "user")) return ACL_USER; ! if (!strcmp(s, "proto")) return ACL_PROTO; if (!strcmp(s, "method")) return ACL_METHOD; --- 49,55 ---- return ACL_URL_PORT; if (!strcmp(s, "user")) return ACL_USER; ! if (!strncmp(s, "proto", 5)) return ACL_PROTO; if (!strcmp(s, "method")) return ACL_METHOD; *************** *** 119,138 **** char *asc; struct in_addr *addr, *mask; { ! struct hostent *hp; ! long a; ! if ((a = inet_addr(asc)) != SQUID_INADDR_NONE || !strcmp(asc, "255.255.255.255")) { ! addr->s_addr = a; /* inet_addr() outputs in network byte order */ ! } else if ((hp = gethostbyname(asc)) != NULL) { ! /* We got a host name */ ! memcpy(addr, hp->h_addr, hp->h_length); ! } else { ! /* XXX: Here we could use getnetbyname */ ! return 0; /* This is not valid address */ } ! if (mask != NULL) { /* Guess netmask */ a = ntohl(addr->s_addr); if (!a & 0xFFFFFFFF) --- 119,155 ---- char *asc; struct in_addr *addr, *mask; { ! struct hostent *hp = NULL; ! u_num32 a; ! int a1, a2, a3, a4; ! switch (sscanf(asc, "%d.%d.%d.%d", &a1, &a2, &a3, &a4)) { ! case 4: /* a dotted quad */ ! if ((a = inet_addr(asc)) != SQUID_INADDR_NONE || ! !strcmp(asc, "255.255.255.255")) { ! addr->s_addr = a; ! /* inet_addr() outputs in network byte order */ ! } ! break; ! case 1: /* a significant bits value for a mask */ ! if (a1 >= 0 && a1 < 33) { ! addr->s_addr = htonl(0xffffffff << (32 - a1)); ! break; ! } ! default: ! if ((hp = gethostbyname(asc)) != NULL) { ! /* We got a host name */ ! memcpy(addr, hp->h_addr, hp->h_length); ! } else { ! /* XXX: Here we could use getnetbyname */ ! debug(28, 0, "decode_addr: Invalid IP address or hostname '%s'\n", asc); ! return 0; /* This is not valid address */ ! } ! break; } ! if (mask != NULL) { /* mask == NULL if called to decode a netmask */ ! /* Guess netmask */ a = ntohl(addr->s_addr); if (!a & 0xFFFFFFFF) *************** *** 186,192 **** if (!decode_addr(addr1, &q->addr1, &q->mask)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry '%s', unknown first address '%s'\n", addr1); safe_free(q); continue; } --- 203,209 ---- if (!decode_addr(addr1, &q->addr1, &q->mask)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry: unknown first address '%s'\n", addr1); safe_free(q); continue; } *************** *** 194,200 **** if (*addr2 && !decode_addr(addr2, &q->addr2, &q->mask)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry '%s', unknown second address '%s'\n", addr1); safe_free(q); continue; } --- 211,217 ---- if (*addr2 && !decode_addr(addr2, &q->addr2, &q->mask)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry: unknown second address '%s'\n", addr1); safe_free(q); continue; } *************** *** 202,208 **** if (*mask && !decode_addr(mask, &q->mask, NULL)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry '%s', unknown netmask '%s'\n", mask); safe_free(q); continue; } --- 219,225 ---- if (*mask && !decode_addr(mask, &q->mask, NULL)) { debug(28, 0, "%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); ! debug(28, 0, "aclParseIpList: Ignoring invalid IP acl entry: unknown netmask '%s'\n", mask); safe_free(q); continue; } diff -cr squid-1.0.beta8/src/ftpget.c squid-1.0.beta9/src/ftpget.c *** squid-1.0.beta8/src/ftpget.c Tue May 21 15:52:56 1996 --- squid-1.0.beta9/src/ftpget.c Wed May 22 22:14:44 1996 *************** *** 1,4 **** ! /* $Id: ftpget.c,v 1.23.2.35 1996/05/21 22:52:56 wessels Exp $ */ /* * NOTES --- 1,4 ---- ! /* $Id: ftpget.c,v 1.23.2.36 1996/05/23 05:14:44 wessels Exp $ */ /* * NOTES *************** *** 456,462 **** static char buf[SMALLBUFSIZ]; if (socket_pathname) ! unlink(socket_pathname); sprintf(buf, "Received signal %d, exiting.\n", sig); errorlog(buf); if (MainRequest == NULL) --- 456,462 ---- static char buf[SMALLBUFSIZ]; if (socket_pathname) ! unlink(socket_pathname); sprintf(buf, "Received signal %d, exiting.\n", sig); errorlog(buf); if (MainRequest == NULL) *************** *** 824,829 **** --- 824,831 ---- char *t = NULL; int i = 0; + if (name == NULL) + return xstrdup("unknown"); if (!(t = strrchr(name, '.'))) return xstrdup("unknown"); ext = xstrdup(t + 1); *************** *** 1302,1308 **** if (!init) { init = 1; ! #if defined(HAVE_SRAND48) srand48(time(NULL)); #else srand(time(NULL)); --- 1304,1310 ---- if (!init) { init = 1; ! #if HAVE_SRAND48 srand48(time(NULL)); #else srand(time(NULL)); *************** *** 1309,1315 **** #endif } for (;;) { ! #if defined(HAVE_LRAND48) port = (lrand48() % (o_conn_max - o_conn_min)) + o_conn_min; #else port = (rand() % (o_conn_max - o_conn_min)) + o_conn_min; --- 1311,1317 ---- #endif } for (;;) { ! #if HAVE_LRAND48 port = (lrand48() % (o_conn_max - o_conn_min)) + o_conn_min; #else port = (rand() % (o_conn_max - o_conn_min)) + o_conn_min; *************** *** 2263,2270 **** } if (listen(sock, 50) < 0) { log_errno2(__FILE__, __LINE__, "listen"); ! if (socket_pathname) ! unlink(socket_pathname); exit(1); } for (;;) { --- 2265,2272 ---- } if (listen(sock, 50) < 0) { log_errno2(__FILE__, __LINE__, "listen"); ! if (socket_pathname) ! unlink(socket_pathname); exit(1); } for (;;) { *************** *** 2285,2291 **** /* exit server mode if any activity on stdin */ close(sock); if (socket_pathname) ! unlink(socket_pathname); return 0; } if (!FD_ISSET(sock, &R)) --- 2287,2293 ---- /* exit server mode if any activity on stdin */ close(sock); if (socket_pathname) ! unlink(socket_pathname); return 0; } if (!FD_ISSET(sock, &R)) *************** *** 2293,2299 **** if ((c = accept(sock, NULL, 0)) < 0) { log_errno2(__FILE__, __LINE__, "accept"); if (socket_pathname) ! unlink(socket_pathname); exit(1); } if (fork()) { --- 2295,2301 ---- if ((c = accept(sock, NULL, 0)) < 0) { log_errno2(__FILE__, __LINE__, "accept"); if (socket_pathname) ! unlink(socket_pathname); exit(1); } if (fork()) { diff -cr squid-1.0.beta8/src/icp.c squid-1.0.beta9/src/icp.c *** squid-1.0.beta8/src/icp.c Tue May 21 20:08:54 1996 --- squid-1.0.beta9/src/icp.c Wed May 22 22:15:28 1996 *************** *** 1,7 **** ! /* $Id: icp.c,v 1.61.2.47 1996/05/22 03:08:54 wessels Exp $ */ /* * DEBUG: Section 12 icp: --- 1,7 ---- ! /* $Id: icp.c,v 1.61.2.48 1996/05/23 05:15:28 wessels Exp $ */ /* * DEBUG: Section 12 icp: *************** *** 1195,1203 **** if ((entry = storeGet(key)) == NULL) { debug(12, 3, "icpHandleUdp: Ignoring %s for NULL Entry.\n", IcpOpcodeStr[header.opcode]); ! break; } - neighborsUdpAck(sock, url, &header, &from, entry, data, (int) data_sz); break; default: --- 1195,1206 ---- if ((entry = storeGet(key)) == NULL) { debug(12, 3, "icpHandleUdp: Ignoring %s for NULL Entry.\n", IcpOpcodeStr[header.opcode]); ! } else if (entry->lock_count == 0) { ! debug(12, 3, "icpHandleUdp: Ignoring %s for Entry without locks.\n", ! IcpOpcodeStr[header.opcode]); ! } else { ! neighborsUdpAck(sock, url, &header, &from, entry, data, (int) data_sz); } break; default: diff -cr squid-1.0.beta8/src/storetoString.c squid-1.0.beta9/src/storetoString.c *** squid-1.0.beta8/src/storetoString.c Sat Apr 20 13:11:13 1996 --- squid-1.0.beta9/src/storetoString.c Wed May 22 22:15:03 1996 *************** *** 1,4 **** ! /* $Id: storetoString.c,v 1.8.2.1 1996/04/20 20:11:13 wessels Exp $ */ #include "squid.h" --- 1,4 ---- ! /* $Id: storetoString.c,v 1.8.2.2 1996/05/23 05:15:03 wessels Exp $ */ #include "squid.h" *************** *** 200,206 **** } ! sprintf(tmpbuf, "E_swap_buf: %s\n", e->mem_obj->e_swap_buf); strcat(stsbuf, tmpbuf); sprintf(tmpbuf, "First_miss: 0x%p\n", e->mem_obj->e_pings_first_miss); strcat(stsbuf, tmpbuf); --- 200,209 ---- } ! if (!e->mem_obj->e_swap_buf) ! sprintf(tmpbuf, "E_swap_buf: NOT SET\n"); ! else ! sprintf(tmpbuf, "E_swap_buf: %s\n", e->mem_obj->e_swap_buf); strcat(stsbuf, tmpbuf); sprintf(tmpbuf, "First_miss: 0x%p\n", e->mem_obj->e_pings_first_miss); strcat(stsbuf, tmpbuf);