head 1.5; access; symbols pkgsrc-2013Q2:1.5.0.16 pkgsrc-2013Q2-base:1.5 pkgsrc-2012Q4:1.5.0.14 pkgsrc-2012Q4-base:1.5 pkgsrc-2011Q4:1.5.0.12 pkgsrc-2011Q4-base:1.5 pkgsrc-2011Q2:1.5.0.10 pkgsrc-2011Q2-base:1.5 pkgsrc-2009Q4:1.5.0.8 pkgsrc-2009Q4-base:1.5 pkgsrc-2008Q4:1.5.0.6 pkgsrc-2008Q4-base:1.5 pkgsrc-2008Q3:1.5.0.4 pkgsrc-2008Q3-base:1.5 cube-native-xorg:1.5.0.2 cube-native-xorg-base:1.5 pkgsrc-2008Q2:1.4.0.10 pkgsrc-2008Q2-base:1.4 cwrapper:1.4.0.8 pkgsrc-2008Q1:1.4.0.6 pkgsrc-2008Q1-base:1.4 pkgsrc-2007Q4:1.4.0.4 pkgsrc-2007Q4-base:1.4 pkgsrc-2007Q3:1.4.0.2 pkgsrc-2007Q3-base:1.4 pkgsrc-2007Q2:1.3.0.4 pkgsrc-2007Q2-base:1.3 pkgsrc-2007Q1:1.3.0.2 pkgsrc-2007Q1-base:1.3 pkgsrc-2006Q4:1.2.0.2 pkgsrc-2006Q4-base:1.2 pkgsrc-2006Q3:1.1.0.2 pkgsrc-2006Q3-base:1.1; locks; strict; comment @# @; 1.5 date 2008.09.08.12.58.10; author adam; state dead; branches; next 1.4; 1.4 date 2007.08.11.11.05.57; author adam; state Exp; branches; next 1.3; 1.3 date 2007.02.05.12.06.16; author adam; state Exp; branches; next 1.2; 1.2 date 2006.10.01.20.08.29; author seb; state Exp; branches; next 1.1; 1.1 date 2006.09.15.20.13.55; author christos; state Exp; branches; next ; desc @@ 1.5 log @Changes 5.4.2: snmplib: - [PATCH 1921861]: Avoid endless loop after truncating 64bit int - Better handling of CONTAINER_INSERT failures with multiple indices snmpd: - [PATCH 2023633]: add SCTP-MIB implementation (Linux only) - suppress annoying "registration != duplicate" warning for root oids build: - [BUG 2023803]: Compilation problems on HP-UX 11.31 - Update to libtool 1.5.26 AIX: - Add support for AIX 6.x. @ text @$NetBSD: patch-ea,v 1.4 2007/08/11 11:05:57 adam Exp $ --- snmplib/snmp_api.c.orig 2007-07-21 16:51:54.000000000 +0200 +++ snmplib/snmp_api.c @@@@ -6833,7 +6833,7 @@@@ snmp_add_var(netsnmp_pdu *pdu, } #endif /* NETSNMP_DISABLE_MIB_LOADING */ atmp = inet_addr(value); - if (atmp != (long) -1 || !strcmp(value, "255.255.255.255")) + if (atmp != (in_addr_t) -1 || !strcmp(value, "255.255.255.255")) snmp_pdu_add_variable(pdu, name, name_length, ASN_IPADDRESS, (u_char *) & atmp, sizeof(atmp)); else @ 1.4 log @Chagesn 5.4.1: snmplib: - [BUG 1619827]: link libraries against needed external libraries - [PATCH 1616912]: fix memory leak in UDP transport code - [PATCH 1592706]: fix memory leak when cloning varbinds - Change snmp_sess_add_ex to consistently close and delete the transport argument on failure, earlier the liveness of the transport argument was undecided. snmpd: - [BUG 1558823]: fix ipAddressTable memory leak - [BUG 1596638]: fix memory leak in ipCidrRouteTable, inetCidrRouteTable - [BUG 1611524]: fix tcp connection table file descriptor leak - handle row deletion issues in dataset tables - [BUG 1712988]: default and configurable maximum number of varbinds returnable to a GETBULK request. - [PATCH 1666737]: include ipv6 counts in udpInDatagrams, udpNoPorts, udpInErrors, udpOutDatagrams - [PATCH 1700157]: fixes ordering of exec tokens in the resulting mib tree - [PATCH 1719253]: fix skipNFSInHostResources so it does not break on the second walk of the table. perl: - link Perl modules against the exact set of libraries needed - [BUG 1619827]: properly link against libperl when configured with --enable-as-needed - [PATCH 1725049]: fix bulkwalk in cases of non-repeater python: - [PATCH 1716114]: Let python build in the Net-SNMP source tree MacOSX: - [PATCH 1600522]: CPU Hardware Abstraction Layer (HAL) implementation for mach/darwin - IF-MIB rewrite now enabled by default Win32: - fix AES support - [PATCH 1706344]: fix compilation with cygwin IRIX: - [PATCH 1709748]: Optimized IRIX cpu stats AIX: - Fix default shared library building instead of forcing static use FreeBSD: - [BUG 1633483]: Support CPU HAL on FreeBSD4.x @ text @d1 1 a1 1 $NetBSD$ @ 1.3 log @Changes 5.4: - The default configuration now enables embedded Perl and the Perl modules by default when possible unless explicitly disabled. You may use the --disable-embedded-perl and --without-perl-modules configure options, respectively, to revert to the former default configuration. @ text @d3 1 a3 1 --- snmplib/snmp_api.c.orig 2006-10-25 18:16:24.000000000 +0200 d5 1 a5 1 @@@@ -6818,7 +6818,7 @@@@ snmp_add_var(netsnmp_pdu *pdu, @ 1.2 log @Split LP64 related patch file (patch-ea) from christos@@ so that there is one patched file per patch file. @ text @d1 1 a1 1 $NetBSD: patch-ea,v 1.1 2006/09/15 20:13:55 christos Exp $ d3 1 a3 1 --- snmplib/snmp_api.c.orig 2006-03-09 22:01:14.000000000 +0000 d5 1 a5 1 @@@@ -6781,7 +6781,7 @@@@ snmp_add_var(netsnmp_pdu *pdu, d7 1 a7 1 #endif /* DISABLE_MIB_LOADING */ @ 1.1 log @Fix a crapload of 64 bit inconsistencies (int <-> ptr, int * <-> size_t *) This now has a chance to work on sparc64. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- snmplib/snmp_api.c.orig 2006-03-09 17:01:14.000000000 -0500 +++ snmplib/snmp_api.c 2006-09-15 11:59:02.723578061 -0400 @@@@ -6781,7 +6781,7 @@@@ a13 441 --- snmplib/md5.c.orig 2004-04-19 18:09:07.000000000 -0400 +++ snmplib/md5.c 2006-09-15 12:00:18.530062610 -0400 @@@@ -465,7 +465,7 @@@@ goto update_end; i = len; - if (((unsigned int) data) % sizeof(long) != 0) { + if (((unsigned long) data) % sizeof(int) != 0) { /* * this relies on the ability to use integer math and thus we * must rely on data that aligns on 32-bit-word-boundries --- snmplib/text_utils.c.orig 2006-03-09 15:57:35.000000000 -0500 +++ snmplib/text_utils.c 2006-09-15 12:03:41.664878785 -0400 @@@@ -461,7 +461,7 @@@@ /* * get value */ - switch((int)lpi->user_context) { + switch((int)(long)lpi->user_context) { case PMLP_TYPE_UNSIGNED: tvi->value.ul = strtoul(ptr, NULL, 0); @@@@ -497,7 +497,7 @@@@ default: snmp_log(LOG_ERR,"unsupported value type %d\n", - (int)lpi->user_context); + (int)(long)lpi->user_context); break; } --- snmplib/scapi.c.orig 2006-01-30 07:08:15.000000000 -0500 +++ snmplib/scapi.c 2006-09-15 12:05:52.357854147 -0400 @@@@ -272,7 +272,7 @@@@ u_char buf[SNMP_MAXBUF_SMALL]; #if defined(USE_OPENSSL) || defined(USE_PKCS) - size_t buf_len = sizeof(buf); + unsigned int buf_len = sizeof(buf); #endif DEBUGTRACE; --- snmplib/container_binary_array.c.orig 2005-12-11 14:13:15.000000000 -0500 +++ snmplib/container_binary_array.c 2006-09-15 12:06:45.271966359 -0400 @@@@ -405,7 +405,7 @@@@ /* * Insert the new entry into the data array */ - t->data[t->count++] = entry; + t->data[t->count++] = (void *)(unsigned long)entry; t->dirty = 1; return 0; } --- include/net-snmp/types.h.orig 2006-05-26 12:36:06.000000000 -0400 +++ include/net-snmp/types.h 2006-09-15 12:14:05.096058400 -0400 @@@@ -162,7 +162,7 @@@@ */ typedef struct netsnmp_index_s { - int len; + size_t len; oid *oids; } netsnmp_index; --- snmplib/snmp_logging.c.orig 2006-01-25 11:27:41.000000000 -0500 +++ snmplib/snmp_logging.c 2006-09-15 13:26:28.786672010 -0400 @@@@ -380,7 +380,7 @@@@ if (facility == -1) return -1; logh->pri_max = pri_max; logh->token = strdup(snmp_log_syslogname(0)); - logh->magic = (void *)facility; + logh->magic = (void *)(long)facility; snmp_enable_syslog_ident(snmp_log_syslogname(0), facility); } break; @@@@ -600,7 +600,7 @@@@ continue; if (logh->type == NETSNMP_LOGHANDLER_SYSLOG) { snmp_disable_syslog_entry(logh); - snmp_enable_syslog_ident(logh->token,(int)logh->magic); + snmp_enable_syslog_ident(logh->token,(int)(long)logh->magic); } else if (logh->type == NETSNMP_LOGHANDLER_FILE) { snmp_disable_filelog_entry(logh); @@@@ -1016,7 +1016,7 @@@@ */ if (!(logh->imagic)) { const char *ident = logh->token; - int facility = (int)logh->magic; + int facility = (int)(long)logh->magic; if (!ident) ident = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_APPTYPE); --- agent/helpers/row_merge.c.orig 2006-01-25 11:26:38.000000000 -0500 +++ agent/helpers/row_merge.c 2006-09-15 13:29:02.792124486 -0400 @@@@ -31,7 +31,7 @@@@ ret = netsnmp_create_handler("row_merge", netsnmp_row_merge_helper_handler); if (ret) { - ret->myvoid = (void *) prefix_len; + ret->myvoid = (void *)(long)prefix_len; } return ret; } @@@@ -165,7 +165,7 @@@@ * Use the prefix length as supplied during registration, rather * than trying to second-guess what the MIB implementer wanted. */ - int SKIP_OID = (int)handler->myvoid; + int SKIP_OID = (int)(long)handler->myvoid; DEBUGMSGTL(("helper:row_merge", "Got request (%d): ", SKIP_OID)); DEBUGMSGOID(("helper:row_merge", reginfo->rootoid, reginfo->rootoid_len)); --- agent/mibgroup/ucd-snmp/pass.c.orig 2006-09-15 13:32:02.702526885 -0400 +++ agent/mibgroup/ucd-snmp/pass.c 2006-09-15 13:31:29.416161961 -0400 @@@@ -163,6 +163,7 @@@@ { struct extensible **ppass = &passthrus, **etmp, *ptmp; char *tcptr, *endopt; + long priorl; int i, priority; /* @@@@ -180,10 +181,12 @@@@ config_perror("priority must be an integer"); return; } - priority = strtol((const char*) cptr, &endopt, 0); - if ((priority == LONG_MIN) || (priority == LONG_MAX)) { + priorl = strtol((const char*) cptr, &endopt, 0); + if ((priorl <= INT_MIN) || (priorl >= INT_MAX)) { config_perror("priority under/overflow"); return; + } else { + priority = (int)priorl; } cptr = endopt; cptr = skip_white(cptr); --- agent/mibgroup/ucd-snmp/pass_persist.c.orig 2005-10-03 07:52:44.000000000 -0400 +++ agent/mibgroup/ucd-snmp/pass_persist.c 2006-09-15 13:33:19.013118652 -0400 @@@@ -89,6 +89,7 @@@@ { struct extensible **ppass = &persistpassthrus, **etmp, *ptmp; char *tcptr, *endopt; + long priorl; int i, priority; /* @@@@ -106,10 +107,12 @@@@ config_perror("priority must be an integer"); return; } - priority = strtol((const char*) cptr, &endopt, 0); - if ((priority == LONG_MIN) || (priority == LONG_MAX)) { + priorl = strtol((const char*) cptr, &endopt, 0); + if ((priorl <= INT_MIN) || (priorl >= INT_MAX)) { config_perror("priority under/overflow"); return; + } else { + priority = (int)priorl; } cptr = endopt; cptr = skip_white(cptr); --- ./agent/mibgroup/agent/nsDebug.c.orig 2005-04-21 09:32:20.000000000 -0400 +++ ./agent/mibgroup/agent/nsDebug.c 2006-09-15 13:34:51.994897981 -0400 @@@@ -291,7 +291,7 @@@@ snmp_set_var_value(index, dbg_tokens[i].token_name, strlen(dbg_tokens[i].token_name)); - *loop_context = (void*)i; + *loop_context = (void*)(long)i; *data_context = (void*)&dbg_tokens[i]; return index; } @@@@ -301,7 +301,7 @@@@ netsnmp_variable_list *index, netsnmp_iterator_info *data) { - int i = (int)*loop_context; + int i = (int)(long)*loop_context; for (i++; idata); DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_setup_allocate", - "++refcount = %d\n",(int)dl->data)); + "++refcount = %d\n",(int)(long)dl->data)); } return rc; @@@@ -1487,9 +1487,9 @@@@ return; /* better to lead than double free */ --(*(int*)&dl->data); - snmp_log(LOG_ERR, "--refcount at %d\n", (int)dl->data); + snmp_log(LOG_ERR, "--refcount at %d\n", (int)(long)dl->data); - if (0 == (int)dl->data) { + if (0 == (int)(long)dl->data) { netsnmp_access_interface_entry_free(rowreq_ctx->undo->ifentry); ifTable_release_data(rowreq_ctx->undo); rowreq_ctx->undo = NULL; --- agent/agent_registry.c.orig 2006-06-13 08:50:36.000000000 -0400 +++ agent/agent_registry.c 2006-09-15 13:45:00.415231055 -0400 @@@@ -1458,7 +1458,7 @@@@ lookup_cache *lookup_cache = NULL; netsnmp_subtree *myptr = NULL, *previous = NULL; int cmp = 1; - int ll_off = 0; + size_t ll_off = 0; if (subtree) { myptr = subtree; --- ./agent/mibgroup/utilities/iquery.c.orig 2006-04-11 07:10:16.000000000 -0400 +++ ./agent/mibgroup/utilities/iquery.c 2006-09-15 13:46:09.604459976 -0400 @@@@ -153,7 +153,7 @@@@ memdup( &(ss->securityEngineID), engineID, engIDLen ); ss->securityEngineIDLen = engIDLen; if ( version == SNMP_VERSION_3 ) { - memdup(&(ss->securityName), secName, strlen(secName)); + memdup((u_char **)&(ss->securityName), secName, strlen(secName)); ss->securityNameLen = strlen(secName); } else { memdup( &(ss->community), secName, strlen(secName)); --- perl/OID/OID.xs.orig 2005-09-09 06:09:31.000000000 -0400 +++ perl/OID/OID.xs 2006-09-15 13:51:01.268231665 -0400 @@@@ -177,17 +177,21 @@@@ netsnmp_oid * nso_newptr(initstring) char *initstring + PREINIT: + STRLEN len; CODE: if (get_tree_head() == NULL) init_mib(); RETVAL = SNMP_MALLOC_TYPEDEF(netsnmp_oid); RETVAL->name = RETVAL->namebuf; - RETVAL->len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]); - if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &RETVAL->len)) { + len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]); + if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &len)) { snmp_log(LOG_ERR, "Can't parse: %s\n", initstring); RETVAL->len = 0; RETVAL = NULL; - } + } else { + RETVAL->len = len; + } OUTPUT: RETVAL --- ./perl/SNMP/SNMP.xs.orig 2006-05-26 12:59:15.000000000 -0400 +++ ./perl/SNMP/SNMP.xs 2006-09-15 14:11:11.883749613 -0400 @@@@ -117,15 +117,15 @@@@ netsnmp_variable_list*, struct tree *, int, int)); static int __sprint_num_objid _((char *, oid *, int)); -static int __scan_num_objid _((char *, oid *, int *)); +static int __scan_num_objid _((char *, oid *, size_t *)); static int __get_type_str _((int, char *)); static int __get_label_iid _((char *, char **, char **, int)); static int __oid_cmp _((oid *, int, oid *, int)); static int __tp_sprint_num_objid _((char*,SnmpMibNode *)); static SnmpMibNode * __get_next_mib_node _((SnmpMibNode *)); static struct tree * __oid2tp _((oid*, int, struct tree *, int*)); -static struct tree * __tag2oid _((char *, char *, oid *, int *, int *, int)); -static int __concat_oid_str _((oid *, int *, char *)); +static struct tree * __tag2oid _((char *, char *, oid *, size_t *, int *, int)); +static int __concat_oid_str _((oid *, size_t *, char *)); static int __add_var_val_str _((netsnmp_pdu *, oid *, int, char *, int, int)); static int __send_sync_pdu _((netsnmp_session *, netsnmp_pdu *, @@@@ -583,7 +583,7 @@@@ __scan_num_objid (buf, objid, len) char *buf; oid *objid; -int *len; +size_t *len; { char *cp; *len = 0; @@@@ -874,14 +874,14 @@@@ char * tag; char * iid; oid * oid_arr; -int * oid_arr_len; +size_t * oid_arr_len; int * type; int best_guess; { struct tree *tp = NULL; struct tree *rtp = NULL; oid newname[MAX_OID_LEN], *op; - int newname_len = 0; + size_t newname_len = 0; const char *cp = NULL; char *module = NULL; @@@@ -1022,7 +1022,7 @@@@ static int __concat_oid_str(doid_arr, doid_arr_len, soid_str) oid *doid_arr; -int *doid_arr_len; +size_t *doid_arr_len; char * soid_str; { char soid_buf[STR_BUF_SIZE]; @@@@ -1911,7 +1911,7 @@@@ ** we sent in this request. Note that this is not a valid SNMP PDU, ** but that's because a response has not yet been received. */ - return (netsnmp_pdu *)reqid; + return (netsnmp_pdu *)(long)reqid; } /* This code is for synchronous mode support. @@@@ -3006,7 +3006,7 @@@@ netsnmp_pdu *pdu, *response; struct tree *tp; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; char *tag_pv; snmp_xs_cb_data *xs_cb_data; SV **sess_ptr_sv; @@@@ -3207,7 +3207,7 @@@@ struct tree *tp; int len; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; SV *tmp_sv; int type; char tmp_type_str[MAX_TYPE_NAME_LEN]; @@@@ -3425,7 +3425,7 @@@@ struct tree *tp; int len; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; SV *tmp_sv; int type; char tmp_type_str[MAX_TYPE_NAME_LEN]; @@@@ -3669,7 +3669,7 @@@@ struct tree *tp; int len; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; SV *tmp_sv; int type; char tmp_type_str[MAX_TYPE_NAME_LEN]; @@@@ -3897,7 +3897,7 @@@@ netsnmp_session *ss; netsnmp_pdu *pdu = NULL; oid oid_arr[MAX_OID_LEN]; - int oid_arr_len; + size_t oid_arr_len; SV **sess_ptr_sv; SV **err_str_svp; SV **err_num_svp; @@@@ -4115,7 +4115,7 @@@@ /* Sent okay... Return the request ID in 'pdu' as an SvIV. */ DBPRT(1,(DBOUT "Okay, request id is %d\n", (intptr_t) pdu)); /* XSRETURN_IV((intptr_t)pdu); */ - XPUSHs(sv_2mortal(newSViv(pdu))); + XPUSHs(sv_2mortal(newSViv((intptr_t)pdu))); XSRETURN(1); } @@@@ -4208,7 +4208,7 @@@@ netsnmp_pdu *pdu = NULL; struct tree *tp; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; SV **sess_ptr_sv; SV **err_str_svp; SV **err_num_svp; @@@@ -4347,7 +4347,7 @@@@ netsnmp_pdu *pdu = NULL; struct tree *tp; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; SV **sess_ptr_sv; SV **err_str_svp; SV **err_num_svp; @@@@ -4484,7 +4484,7 @@@@ netsnmp_pdu *response; struct tree *tp; oid *oid_arr; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; snmp_xs_cb_data *xs_cb_data; SV **sess_ptr_sv; SV **err_str_svp; @@@@ -4715,7 +4715,7 @@@@ char str_buf[STR_BUF_SIZE]; char str_buf_temp[STR_BUF_SIZE]; oid oid_arr[MAX_OID_LEN]; - int oid_arr_len = MAX_OID_LEN; + size_t oid_arr_len = MAX_OID_LEN; char * label; char * iid; int status = FAILURE; @