diff --git a/.net-snmp.metadata b/.net-snmp.metadata new file mode 100644 index 0000000..572f057 --- /dev/null +++ b/.net-snmp.metadata @@ -0,0 +1 @@ +998980f9e92031e6c78e1b0fed88b440138fdef8 SOURCES/net-snmp-5.7.2-noapsl.tar.gz diff --git a/README.md b/README.md deleted file mode 100644 index 0e7897f..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 - -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/net-snmp-5.5-ber-int-size.patch b/SOURCES/net-snmp-5.5-ber-int-size.patch new file mode 100644 index 0000000..5adac1c --- /dev/null +++ b/SOURCES/net-snmp-5.5-ber-int-size.patch @@ -0,0 +1,155 @@ +953926 - snmptrapd crash "buffer overflow detected" at fortify_fail.c + +commit 40938a62619590b4ea071ae85baa2f42a0b7fcb2 +Author: Jan Safranek +Date: Mon Apr 22 15:00:00 2013 +0200 + + Check if 'asn_parse_* ' actually succeeded. + + If not, discard the packet instead of using wrong data. + +diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c +index e5c45d9..0842842 100644 +--- a/snmplib/snmp_api.c ++++ b/snmplib/snmp_api.c +@@ -4709,9 +4709,11 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_INTEGER: + vp->val.integer = (long *) vp->buf; + vp->val_len = sizeof(long); +- asn_parse_int(var_val, &len, &vp->type, ++ data = asn_parse_int(var_val, &len, &vp->type, + (long *) vp->val.integer, + sizeof(*vp->val.integer)); ++ if (!data) ++ return -1; + break; + case ASN_COUNTER: + case ASN_GAUGE: +@@ -4719,9 +4721,11 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_UINTEGER: + vp->val.integer = (long *) vp->buf; + vp->val_len = sizeof(u_long); +- asn_parse_unsigned_int(var_val, &len, &vp->type, ++ data = asn_parse_unsigned_int(var_val, &len, &vp->type, + (u_long *) vp->val.integer, + vp->val_len); ++ if (!data) ++ return -1; + break; + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES + case ASN_OPAQUE_COUNTER64: +@@ -4730,34 +4734,45 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_COUNTER64: + vp->val.counter64 = (struct counter64 *) vp->buf; + vp->val_len = sizeof(struct counter64); +- asn_parse_unsigned_int64(var_val, &len, &vp->type, ++ data = asn_parse_unsigned_int64(var_val, &len, &vp->type, + (struct counter64 *) vp->val. + counter64, vp->val_len); ++ if (!data) ++ return -1; + break; + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES + case ASN_OPAQUE_FLOAT: + vp->val.floatVal = (float *) vp->buf; + vp->val_len = sizeof(float); +- asn_parse_float(var_val, &len, &vp->type, ++ data = asn_parse_float(var_val, &len, &vp->type, + vp->val.floatVal, vp->val_len); ++ if (!data) ++ return -1; + break; + case ASN_OPAQUE_DOUBLE: + vp->val.doubleVal = (double *) vp->buf; + vp->val_len = sizeof(double); +- asn_parse_double(var_val, &len, &vp->type, ++ data = asn_parse_double(var_val, &len, &vp->type, + vp->val.doubleVal, vp->val_len); ++ if (!data) ++ return -1; + break; + case ASN_OPAQUE_I64: + vp->val.counter64 = (struct counter64 *) vp->buf; + vp->val_len = sizeof(struct counter64); +- asn_parse_signed_int64(var_val, &len, &vp->type, ++ data = asn_parse_signed_int64(var_val, &len, &vp->type, + (struct counter64 *) vp->val.counter64, + sizeof(*vp->val.counter64)); + ++ if (!data) ++ return -1; + break; + #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ +- case ASN_OCTET_STR: + case ASN_IPADDRESS: ++ if (vp->val_len != 4) ++ return -1; ++ /* fallthrough */ ++ case ASN_OCTET_STR: + case ASN_OPAQUE: + case ASN_NSAP: + if (vp->val_len < sizeof(vp->buf)) { +@@ -4768,12 +4783,16 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + if (vp->val.string == NULL) { + return -1; + } +- asn_parse_string(var_val, &len, &vp->type, vp->val.string, ++ data = asn_parse_string(var_val, &len, &vp->type, vp->val.string, + &vp->val_len); ++ if (!data) ++ return -1; + break; + case ASN_OBJECT_ID: + vp->val_len = MAX_OID_LEN; +- asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len); ++ data = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len); ++ if (!data) ++ return -1; + vp->val_len *= sizeof(oid); + vp->val.objid = (oid *) malloc(vp->val_len); + if (vp->val.objid == NULL) { +@@ -4791,8 +4810,10 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + if (vp->val.bitstring == NULL) { + return -1; + } +- asn_parse_bitstring(var_val, &len, &vp->type, ++ data = asn_parse_bitstring(var_val, &len, &vp->type, + vp->val.bitstring, &vp->val_len); ++ if (!data) ++ return -1; + break; + default: + snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type); + +commit aa4fb949012d7c022a436992ac203c065fd7420a +Author: Jan Safranek +Date: Mon Apr 22 14:58:41 2013 +0200 + + Integer values encoded in BER must have at least one character. + + If asn_length == 0, we would read the first byte of the next varbind on next line: + if (*bufp & 0x80) + -> reading past the buffer if there is no such variable -> sigsegv. + +diff --git a/snmplib/asn1.c b/snmplib/asn1.c +index 1af7787..5de6b75 100644 +--- a/snmplib/asn1.c ++++ b/snmplib/asn1.c +@@ -510,7 +510,7 @@ asn_parse_int(u_char * data, + (errpre, bufp, data, asn_length, *datalength)) + return NULL; + +- if ((size_t) asn_length > intsize) { ++ if ((size_t) asn_length > intsize || (int) asn_length == 0) { + _asn_length_err(errpre, (size_t) asn_length, intsize); + return NULL; + } +@@ -582,7 +582,7 @@ asn_parse_unsigned_int(u_char * data, + (errpre, bufp, data, asn_length, *datalength)) + return NULL; + +- if ((asn_length > (intsize + 1)) || ++ if (((int) asn_length > (intsize + 1)) || ((int) asn_length == 0) || + ((asn_length == intsize + 1) && *bufp != 0x00)) { + _asn_length_err(errpre, (size_t) asn_length, intsize); + return NULL; diff --git a/SOURCES/net-snmp-5.5-ber-int-size2.patch b/SOURCES/net-snmp-5.5-ber-int-size2.patch new file mode 100644 index 0000000..c50330b --- /dev/null +++ b/SOURCES/net-snmp-5.5-ber-int-size2.patch @@ -0,0 +1,127 @@ +983116: net-snmp query fails after update to 1:5.5-44.el6_4.2 + + +commit e41c2f574c25d8dd273f2406eeeac19bc2ae16db +Author: Jan Safranek +Date: Mon Aug 12 14:30:51 2013 +0200 + + CHANGES: snmplib: Fixed parsing of sequences. + + Don't overwrite 'data' variable, it's used when parsing bulk responses. + +diff --git a/snmplib/snmp_api.c b/snmplib/snmp_api.c +index 403ea2b..e67945f 100644 +--- a/snmplib/snmp_api.c ++++ b/snmplib/snmp_api.c +@@ -4537,6 +4537,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + size_t four; + netsnmp_variable_list *vp = NULL; + oid objid[MAX_OID_LEN]; ++ u_char *p; + + /* + * Get the PDU type +@@ -4709,10 +4710,10 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_INTEGER: + vp->val.integer = (long *) vp->buf; + vp->val_len = sizeof(long); +- data = asn_parse_int(var_val, &len, &vp->type, ++ p = asn_parse_int(var_val, &len, &vp->type, + (long *) vp->val.integer, + sizeof(*vp->val.integer)); +- if (!data) ++ if (!p) + return -1; + break; + case ASN_COUNTER: +@@ -4721,10 +4722,10 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_UINTEGER: + vp->val.integer = (long *) vp->buf; + vp->val_len = sizeof(u_long); +- data = asn_parse_unsigned_int(var_val, &len, &vp->type, ++ p = asn_parse_unsigned_int(var_val, &len, &vp->type, + (u_long *) vp->val.integer, + vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES +@@ -4734,37 +4735,37 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + case ASN_COUNTER64: + vp->val.counter64 = (struct counter64 *) vp->buf; + vp->val_len = sizeof(struct counter64); +- data = asn_parse_unsigned_int64(var_val, &len, &vp->type, ++ p = asn_parse_unsigned_int64(var_val, &len, &vp->type, + (struct counter64 *) vp->val. + counter64, vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES + case ASN_OPAQUE_FLOAT: + vp->val.floatVal = (float *) vp->buf; + vp->val_len = sizeof(float); +- data = asn_parse_float(var_val, &len, &vp->type, ++ p = asn_parse_float(var_val, &len, &vp->type, + vp->val.floatVal, vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + case ASN_OPAQUE_DOUBLE: + vp->val.doubleVal = (double *) vp->buf; + vp->val_len = sizeof(double); +- data = asn_parse_double(var_val, &len, &vp->type, ++ p = asn_parse_double(var_val, &len, &vp->type, + vp->val.doubleVal, vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + case ASN_OPAQUE_I64: + vp->val.counter64 = (struct counter64 *) vp->buf; + vp->val_len = sizeof(struct counter64); +- data = asn_parse_signed_int64(var_val, &len, &vp->type, ++ p = asn_parse_signed_int64(var_val, &len, &vp->type, + (struct counter64 *) vp->val.counter64, + sizeof(*vp->val.counter64)); + +- if (!data) ++ if (!p) + return -1; + break; + #endif /* NETSNMP_WITH_OPAQUE_SPECIAL_TYPES */ +@@ -4783,15 +4784,15 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + if (vp->val.string == NULL) { + return -1; + } +- data = asn_parse_string(var_val, &len, &vp->type, vp->val.string, ++ p = asn_parse_string(var_val, &len, &vp->type, vp->val.string, + &vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + case ASN_OBJECT_ID: + vp->val_len = MAX_OID_LEN; +- data = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len); +- if (!data) ++ p = asn_parse_objid(var_val, &len, &vp->type, objid, &vp->val_len); ++ if (!p) + return -1; + vp->val_len *= sizeof(oid); + vp->val.objid = (oid *) malloc(vp->val_len); +@@ -4810,9 +4811,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char * data, size_t * length) + if (vp->val.bitstring == NULL) { + return -1; + } +- data = asn_parse_bitstring(var_val, &len, &vp->type, ++ p = asn_parse_bitstring(var_val, &len, &vp->type, + vp->val.bitstring, &vp->val_len); +- if (!data) ++ if (!p) + return -1; + break; + default: diff --git a/SOURCES/net-snmp-5.5-dir-fix.patch b/SOURCES/net-snmp-5.5-dir-fix.patch new file mode 100644 index 0000000..b726c47 --- /dev/null +++ b/SOURCES/net-snmp-5.5-dir-fix.patch @@ -0,0 +1,14 @@ +Let net-snmp-create-v3-user save settings into /etc/ instead of /usr/ + +diff -up net-snmp-5.5/net-snmp-create-v3-user.in.orig net-snmp-5.5/net-snmp-create-v3-user.in +--- net-snmp-5.5/net-snmp-create-v3-user.in.orig 2008-07-22 16:33:25.000000000 +0200 ++++ net-snmp-5.5/net-snmp-create-v3-user.in 2009-09-29 16:30:36.000000000 +0200 +@@ -158,7 +158,7 @@ if test ! -d $outfile ; then + touch $outfile + fi + echo $line >> $outfile +-outfile="@datadir@/snmp/snmpd.conf" ++outfile="/etc/snmp/snmpd.conf" + line="$token $user" + echo "adding the following line to $outfile:" + echo " " $line diff --git a/SOURCES/net-snmp-5.5-extTable-crash.patch b/SOURCES/net-snmp-5.5-extTable-crash.patch new file mode 100644 index 0000000..5b7ae65 --- /dev/null +++ b/SOURCES/net-snmp-5.5-extTable-crash.patch @@ -0,0 +1,14 @@ +diff -up net-snmp-5.7.2/agent/mibgroup/agent/extend.c.orig net-snmp-5.7.2/agent/mibgroup/agent/extend.c +--- net-snmp-5.7.2/agent/mibgroup/agent/extend.c.orig 2013-07-09 17:12:14.169821974 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/agent/extend.c 2013-07-09 17:12:39.885729685 +0200 +@@ -1463,8 +1463,8 @@ char * _get_cmdline(netsnmp_extend *exte + if (args == NULL) + /* Use empty string for processes without arguments. */ + args = ""; +- +- size = strlen(extend->command) + strlen(extend->args) + 2; ++ ++ size = strlen(extend->command) + strlen(args) + 2; + if (size > cmdlinesize) { + newbuf = realloc(cmdlinebuf, size); + if (!newbuf) { diff --git a/SOURCES/net-snmp-5.5-extend-realloc-leak.patch b/SOURCES/net-snmp-5.5-extend-realloc-leak.patch new file mode 100644 index 0000000..3dd006c --- /dev/null +++ b/SOURCES/net-snmp-5.5-extend-realloc-leak.patch @@ -0,0 +1,43 @@ +978384 - possible memory leak while realocking extend.c:1364 + +commit 55605ee3452aef5aabe4ed15a83374a97728e64a +Author: Jan Safranek +Date: Wed Jan 9 09:26:56 2013 +0100 + + Fixed memory leak on failed realloc. + +diff -up net-snmp-5.7.2/agent/mibgroup/agent/extend.c.orig net-snmp-5.7.2/agent/mibgroup/agent/extend.c +--- net-snmp-5.7.2/agent/mibgroup/agent/extend.c.orig 2013-06-26 15:50:15.000000000 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/agent/extend.c 2013-06-26 15:55:09.839899740 +0200 +@@ -1457,17 +1457,26 @@ handle_nsExtendOutput2Table(netsnmp_mib_ + char * _get_cmdline(netsnmp_extend *extend) + { + size_t size; ++ char *args = extend->args; ++ char *newbuf; ++ ++ if (args == NULL) ++ /* Use empty string for processes without arguments. */ ++ args = ""; + + size = strlen(extend->command) + strlen(extend->args) + 2; + if (size > cmdlinesize) { +- cmdlinebuf = realloc(cmdlinebuf, size); +- if (!cmdlinebuf) { ++ newbuf = realloc(cmdlinebuf, size); ++ if (!newbuf) { ++ free(cmdlinebuf); ++ cmdlinebuf = NULL; + cmdlinesize = 0; + return NULL; +- } +- cmdlinesize = size; ++ } ++ cmdlinesize = size; ++ cmdlinebuf = newbuf; + } +- sprintf(cmdlinebuf, "%s %s", extend->command, extend->args); ++ sprintf(cmdlinebuf, "%s %s", extend->command, args); + return cmdlinebuf; + } + diff --git a/SOURCES/net-snmp-5.5-getnext-loop.patch b/SOURCES/net-snmp-5.5-getnext-loop.patch new file mode 100644 index 0000000..82fb4fe --- /dev/null +++ b/SOURCES/net-snmp-5.5-getnext-loop.patch @@ -0,0 +1,29 @@ +851637 - snmpd loops inifinitely after receiving SIGTERM + +commit 9b15aa36d0fc40b46fe9461d56cf584bbf040691 +Author: Jan Safranek +Date: Thu Sep 13 15:25:52 2012 +0200 + + CHANGES: snmpd: fixed infinite loop when SIGTEM arrives in middle of internal query processing. + + When snmpd starts internal query, e.g. for 'monitor' config options, it calls + netsnmp_query_walk(). This function loops until either error occurs or the + internal request is processed. And if SIGTERM comes to this loop, the request + is not marked as failed. + + Patch originally from Masahiro Matsuya, mmatsuya [at] redhat.com + +diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c +index 1c00a4c..b7761b0 100644 +--- a/agent/snmp_agent.c ++++ b/agent/snmp_agent.c +@@ -3057,6 +3057,9 @@ handle_getnext_loop(netsnmp_agent_session *asp) + return status; /* should never really happen */ + } + } ++ if (!netsnmp_running) { ++ return SNMP_ERR_GENERR; ++ } + return SNMP_ERR_NOERROR; + } + diff --git a/SOURCES/net-snmp-5.5-man-config-path.patch b/SOURCES/net-snmp-5.5-man-config-path.patch new file mode 100644 index 0000000..f0a1afd --- /dev/null +++ b/SOURCES/net-snmp-5.5-man-config-path.patch @@ -0,0 +1,27 @@ +978398 - net-snmp does not honor configuration file look-ups as specified in man + +commit 9bd0413bfbdcd845413c135bbff8771fa7130809 +Author: Jan Safranek +Date: Mon Feb 11 11:57:01 2013 +0100 + + Explicitly enumerate configuration files. + + The generic conf and local.conf extensions were interpreted as my.snmp.conf and my.other.snmp.local.conf by some customers. + +diff -up net-snmp-5.7.2/man/snmp_config.5.defptch net-snmp-5.7.2/man/snmp_config.5.def +--- net-snmp-5.7.2/man/snmp_config.5.defptch 2013-06-26 16:14:33.039284390 +0200 ++++ net-snmp-5.7.2/man/snmp_config.5.def 2013-06-26 16:14:49.616233272 +0200 +@@ -11,9 +11,10 @@ found and read from. By default, the ap + configuration files in the following 4 directories, in order: + SYSCONFDIR/snmp, + DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these +-directories, it looks for files with the extension of both +-.IR conf " and " local.conf +-(reading the second ones last). In this manner, there are ++directories, it looks for files snmp.conf, snmpd.conf and/or ++snmptrapd.conf, as well as snmp.local.conf, snmpd.local.conf ++and/or snmptrapd.local.conf. *.local.conf are always ++read last. In this manner, there are + 8 default places a configuration file can exist for any given + configuration file type. + .PP diff --git a/SOURCES/net-snmp-5.6-multilib.patch b/SOURCES/net-snmp-5.6-multilib.patch new file mode 100644 index 0000000..a50f5a8 --- /dev/null +++ b/SOURCES/net-snmp-5.6-multilib.patch @@ -0,0 +1,47 @@ +Make the man pages multilib safe. + +diff -up net-snmp-5.6/man/netsnmp_config_api.3.def.multilib net-snmp-5.6/man/netsnmp_config_api.3.def +--- net-snmp-5.6/man/netsnmp_config_api.3.def.multilib 2010-09-08 17:41:37.000000000 +0200 ++++ net-snmp-5.6/man/netsnmp_config_api.3.def 2010-10-25 17:40:43.433726423 +0200 +@@ -295,7 +295,7 @@ for one particular machine. + .PP + The default list of directories to search is \fC SYSCONFDIR/snmp\fP, + followed by \fC DATADIR/snmp\fP, +-followed by \fC LIBDIR/snmp\fP, ++followed by \fC /usr/lib(64)/snmp\fP, + followed by \fC $HOME/.snmp\fP. + This list can be changed by setting the environmental variable + .I SNMPCONFPATH +@@ -365,7 +365,7 @@ function that it should abort the operat + SNMPCONFPATH + A colon separated list of directories to search for configuration + files in. +-Default: SYSCONFDIR/snmp:DATADIR/snmp:LIBDIR/snmp:$HOME/.snmp ++Default: SYSCONFDIR/snmp:DATADIR/snmp:/usr/lib(64)/snmp:$HOME/.snmp + .SH "SEE ALSO" + .BR mib_api "(3), " snmp_api (3) + .\" Local Variables: +diff -up net-snmp-5.6/man/snmp_config.5.def.multilib net-snmp-5.6/man/snmp_config.5.def +--- net-snmp-5.6/man/snmp_config.5.def.multilib 2010-09-17 11:51:52.000000000 +0200 ++++ net-snmp-5.6/man/snmp_config.5.def 2010-10-25 17:40:12.681976439 +0200 +@@ -10,7 +10,7 @@ First off, there are numerous places tha + found and read from. By default, the applications look for + configuration files in the following 4 directories, in order: + SYSCONFDIR/snmp, +-DATADIR/snmp, LIBDIR/snmp, and $HOME/.snmp. In each of these ++DATADIR/snmp, /usr/lib(64)/snmp, and $HOME/.snmp. In each of these + directories, it looks for files with the extension of both + .IR conf " and " local.conf + (reading the second ones last). In this manner, there are +diff -up net-snmp-5.6/man/snmpd.conf.5.def.multilib net-snmp-5.6/man/snmpd.conf.5.def +--- net-snmp-5.6/man/snmpd.conf.5.def.multilib 2010-09-17 11:51:52.000000000 +0200 ++++ net-snmp-5.6/man/snmpd.conf.5.def 2010-10-25 17:40:12.682976925 +0200 +@@ -1387,7 +1387,7 @@ filename), and call the initialisation r + .RS + .IP "Note:" + If the specified PATH is not a fully qualified filename, it will +-be interpreted relative to LIBDIR/snmp/dlmod, and \fC.so\fR ++be interpreted relative to /usr/lib(64)/snmp/dlmod, and \fC.so\fR + will be appended to the filename. + .RE + .PP diff --git a/SOURCES/net-snmp-5.6-test-debug.patch b/SOURCES/net-snmp-5.6-test-debug.patch new file mode 100644 index 0000000..4ae97fb --- /dev/null +++ b/SOURCES/net-snmp-5.6-test-debug.patch @@ -0,0 +1,29 @@ +Don't check tests which depend on DNS - it's disabled in Koji + +diff -up net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple.debug net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple +--- net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple.debug 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/testing/fulltests/default/T070com2sec_simple 2012-10-18 10:16:39.276416510 +0200 +@@ -134,6 +134,10 @@ SAVECHECKAGENT '<"c406a", 255.255.255.25 + SAVECHECKAGENT 'line 30: Error:' # msg from h_strerror so it varies + SAVECHECKAGENT 'line 31: Error:' # msg from h_strerror so it varies + ++FINISHED ++ ++# don't test the later, it depends on DNS, which is not available in Koji ++ + CHECKAGENT '<"c408a"' + if [ "$snmp_last_test_result" -eq 0 ] ; then + CHECKAGENT 'line 32: Error:' +diff -up net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple.debug net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple +--- net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple.debug 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/testing/fulltests/default/T071com2sec6_simple 2012-10-18 10:16:39.276416510 +0200 +@@ -132,6 +132,9 @@ SAVECHECKAGENT '<"c606a", ffff:ffff:ffff + SAVECHECKAGENT 'line 27: Error:' + SAVECHECKAGENT 'line 28: Error:' + ++FINISHED ++ ++# don't test the later, it depends on DNS, which is not available in Koji + # 608 + CHECKAGENT '<"c608a"' + if [ "$snmp_last_test_result" -eq 0 ] ; then diff --git a/SOURCES/net-snmp-5.7-agentx-crash.patch b/SOURCES/net-snmp-5.7-agentx-crash.patch new file mode 100644 index 0000000..0b717ba --- /dev/null +++ b/SOURCES/net-snmp-5.7-agentx-crash.patch @@ -0,0 +1,56 @@ +729738 - net-snmp dumps core in netsnmp_oid_find_prefix + +commit f9304c83f76202db0e684269ca1af32e43cd9db4 +Author: Jan Safranek +Date: Tue Feb 7 14:53:44 2012 +0100 + + CHANGES: PATCH 1633670: fixed snmpd crashing when an AgentX subagent disconnect in the middle of processing of a request. + + I fixed also the memory leak reported in the tracker comments. + +diff --git a/agent/mibgroup/agentx/master.c b/agent/mibgroup/agentx/master.c +index c42a42a..baeebaf 100644 +--- a/agent/mibgroup/agentx/master.c ++++ b/agent/mibgroup/agentx/master.c +@@ -219,6 +219,9 @@ agentx_got_response(int operation, + if (!cache) { + DEBUGMSGTL(("agentx/master", "response too late on session %8p\n", + session)); ++ /* response is too late, free the cache */ ++ if (magic) ++ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic); + return 0; + } + requests = cache->requests; +@@ -606,6 +609,8 @@ agentx_master_handler(netsnmp_mib_handler *handler, + result = snmp_async_send(ax_session, pdu, agentx_got_response, cb_data); + if (result == 0) { + snmp_free_pdu(pdu); ++ if (cb_data) ++ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) cb_data); + } + + return SNMP_ERR_NOERROR; +diff --git a/agent/mibgroup/agentx/master_admin.c b/agent/mibgroup/agentx/master_admin.c +index f16f392..b84b85e 100644 +--- a/agent/mibgroup/agentx/master_admin.c ++++ b/agent/mibgroup/agentx/master_admin.c +@@ -133,11 +133,16 @@ close_agentx_session(netsnmp_session * session, int sessid) + * requests, so that the delegated request will be completed and + * further requests can be processed + */ +- netsnmp_remove_delegated_requests_for_session(session); ++ while (netsnmp_remove_delegated_requests_for_session(session)) { ++ DEBUGMSGTL(("agentx/master", "Continue removing delegated reqests\n")); ++ } ++ + if (session->subsession != NULL) { + netsnmp_session *subsession = session->subsession; + for(; subsession; subsession = subsession->next) { +- netsnmp_remove_delegated_requests_for_session(subsession); ++ while (netsnmp_remove_delegated_requests_for_session(subsession)) { ++ DEBUGMSGTL(("agentx/master", "Continue removing delegated subsession reqests\n")); ++ } + } + } + diff --git a/SOURCES/net-snmp-5.7-dsktable-cache.patch b/SOURCES/net-snmp-5.7-dsktable-cache.patch new file mode 100644 index 0000000..82015e4 --- /dev/null +++ b/SOURCES/net-snmp-5.7-dsktable-cache.patch @@ -0,0 +1,28 @@ +877326 - dskEntry should be cached + +commit ca7b17a41d4d16bd27aacf92116bea3562eeea36 +Author: Jan Safranek +Date: Mon Dec 17 12:40:32 2012 +0100 + + CHANGES: snmpd: use cache for dskTable to speed it up. + + UCD-SNMP::dskTable was slow on NFS mounts. Now it uses fsys cache + to reload mounts every 5 seconds. + +diff --git a/agent/mibgroup/ucd-snmp/disk_hw.c b/agent/mibgroup/ucd-snmp/disk_hw.c +index 93ecde3..ea37610 100644 +--- a/agent/mibgroup/ucd-snmp/disk_hw.c ++++ b/agent/mibgroup/ucd-snmp/disk_hw.c +@@ -305,8 +305,11 @@ var_extensible_disk(struct variable *vp, + unsigned long long val; + static long long_ret; + static char errmsg[300]; ++ netsnmp_cache *cache; + +- netsnmp_fsys_load( NULL, NULL ); /* Update the fsys H/W module */ ++ /* Update the fsys H/W module */ ++ cache = netsnmp_fsys_get_cache(); ++ netsnmp_cache_check_and_reload(cache); + + tryAgain: + if (header_simple_table diff --git a/SOURCES/net-snmp-5.7-relro.patch b/SOURCES/net-snmp-5.7-relro.patch new file mode 100644 index 0000000..ff91ef6 --- /dev/null +++ b/SOURCES/net-snmp-5.7-relro.patch @@ -0,0 +1,62 @@ +725657: net-snmp should be compiled with relro + +This patch probably won't get ever upstream. It ensures that relro options [1] +are propagated where appropriate. + +[1]: configure --with-ldflags="-Wl,-z,relro -Wl,-z,now" + +diff -up net-snmp-5.7.2.pre2/apps/Makefile.in.rhel net-snmp-5.7.2.pre2/apps/Makefile.in +--- net-snmp-5.7.2.pre2/apps/Makefile.in.rhel 2012-07-31 14:00:04.051915227 +0200 ++++ net-snmp-5.7.2.pre2/apps/Makefile.in 2012-07-31 14:00:05.506909768 +0200 +@@ -204,7 +204,7 @@ snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $( + $(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) ${LDFLAGS} ${LIBS} + + libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS) +- $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) ++ $(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) ${LDFLAGS} + $(RANLIB) $@ + + snmpinforminstall: +diff -up net-snmp-5.7.2.pre2/perl/agent/default_store/Makefile.PL.rhel net-snmp-5.7.2.pre2/perl/agent/default_store/Makefile.PL +--- net-snmp-5.7.2.pre2/perl/agent/default_store/Makefile.PL.rhel 2012-07-12 04:23:25.000000000 +0200 ++++ net-snmp-5.7.2.pre2/perl/agent/default_store/Makefile.PL 2012-07-31 14:00:08.835898341 +0200 +@@ -69,6 +69,8 @@ sub InitMakeParams { + } + else { + $opts = NetSNMPGetOpts("../../"); ++ $Params{'LDDLFLAGS'} = "$Config{lddlflags} " . `$opts->{'nsconfig'} --ldflags`; ++ chomp($Params{'LDDLFLAGS'}); + $Params{'LIBS'} = `$opts->{'nsconfig'} --libs`; + chomp($Params{'LIBS'}); + $Params{'CCFLAGS'} = `$opts->{'nsconfig'} --cflags`; +diff -up net-snmp-5.7.2.pre2/python/setup.py.rhel net-snmp-5.7.2.pre2/python/setup.py +--- net-snmp-5.7.2.pre2/python/setup.py.rhel 2012-07-12 04:23:25.000000000 +0200 ++++ net-snmp-5.7.2.pre2/python/setup.py 2012-07-31 14:00:07.618902228 +0200 +@@ -18,14 +18,18 @@ if intree: + netsnmp_libs = os.popen(basedir+'/net-snmp-config --libs').read() + libdir = os.popen(basedir+'/net-snmp-config --build-lib-dirs '+basedir).read() + incdir = os.popen(basedir+'/net-snmp-config --build-includes '+basedir).read() ++ ldflags = os.popen(basedir+'/net-snmp-config --ldflags').read() + libs = re.findall(r"-l(\S+)", netsnmp_libs) + libdirs = re.findall(r"-L(\S+)", libdir) + incdirs = re.findall(r"-I(\S+)", incdir) ++ linkargs = ldflags.split() + else: + netsnmp_libs = os.popen('net-snmp-config --libs').read() ++ ldflags = os.popen('net-snmp-config --ldflags').read() + libdirs = re.findall(r"-L(\S+)", netsnmp_libs) + incdirs = [] + libs = re.findall(r"-l(\S+)", netsnmp_libs) ++ linkargs = ldflags.split() + + setup( + name="netsnmp-python", version="1.0a1", +@@ -41,6 +45,7 @@ setup( + Extension("netsnmp.client_intf", ["netsnmp/client_intf.c"], + library_dirs=libdirs, + include_dirs=incdirs, +- libraries=libs ) ++ libraries=libs, ++ extra_link_args=linkargs ) + ] + ) diff --git a/SOURCES/net-snmp-5.7-skip-ipv6-tests.patch b/SOURCES/net-snmp-5.7-skip-ipv6-tests.patch new file mode 100644 index 0000000..b828e88 --- /dev/null +++ b/SOURCES/net-snmp-5.7-skip-ipv6-tests.patch @@ -0,0 +1,38 @@ +657835: IPv6 tests fail instead of being skipped + +Detect ipv6 before testing ipv6 transports. + +diff -up net-snmp-5.7.2.pre2/testing/fulltests/transports/T320udpv6_simple.rhel net-snmp-5.7.2.pre2/testing/fulltests/transports/T320udpv6_simple +--- net-snmp-5.7.2.pre2/testing/fulltests/transports/T320udpv6_simple.rhel 2012-07-12 04:23:25.000000000 +0200 ++++ net-snmp-5.7.2.pre2/testing/fulltests/transports/T320udpv6_simple 2012-07-31 11:10:22.668307328 +0200 +@@ -6,6 +6,13 @@ HEADER UDP6 Transport + + SKIPIFNOT NETSNMP_TRANSPORT_UDPIPV6_DOMAIN + ++# primitive detection of ipv6 ++if test `uname -s` == "Linux" ; then ++ if test ! -e /proc/net/if_inet6; then ++ SKIP ++ fi ++fi ++ + # + # Begin test + # +diff -up net-snmp-5.7.2.pre2/testing/fulltests/transports/T330tcpv6_simple.rhel net-snmp-5.7.2.pre2/testing/fulltests/transports/T330tcpv6_simple +--- net-snmp-5.7.2.pre2/testing/fulltests/transports/T330tcpv6_simple.rhel 2012-07-12 04:23:25.000000000 +0200 ++++ net-snmp-5.7.2.pre2/testing/fulltests/transports/T330tcpv6_simple 2012-07-31 11:10:07.756378344 +0200 +@@ -6,6 +6,13 @@ HEADER TCP6 Transport + + SKIPIFNOT NETSNMP_TRANSPORT_TCPIPV6_DOMAIN + ++# primitive detection of ipv6 ++if test `uname -s` == "Linux" ; then ++ if test ! -e /proc/net/if_inet6; then ++ SKIP ++ fi ++fi ++ + # + # Begin test + # diff --git a/SOURCES/net-snmp-5.7-smux-reqid.patch b/SOURCES/net-snmp-5.7-smux-reqid.patch new file mode 100644 index 0000000..dd7c9e1 --- /dev/null +++ b/SOURCES/net-snmp-5.7-smux-reqid.patch @@ -0,0 +1,339 @@ +708370 - net-snmp increments request-id when generating multiple SMUX-PDUs for a SMUX peer + +Source: upstream, copied from master after commit 3fa0088c63fe0dd73417af94d888333192194093 +(too many individial commits to list) + +diff -up net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.c.rhel net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.c +--- net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.c.rhel 2012-07-31 14:13:18.069018537 +0200 ++++ net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.c 2012-07-31 13:49:55.000000000 +0200 +@@ -66,7 +66,6 @@ + #include + + #include "smux.h" +-#include "mibdefs.h" + #include "snmpd.h" + + netsnmp_feature_require(snprint_objid) +@@ -103,10 +102,9 @@ static int smux_pdu_process(int, u_ + static int smux_send_rrsp(int, int); + static smux_reg *smux_find_match(smux_reg *, int, oid *, size_t, long); + static smux_reg *smux_find_replacement(oid *, size_t); +-u_char *var_smux(struct variable *, oid *, size_t *, int, size_t *, +- WriteMethod ** write_method); +-int var_smux_write(int, u_char *, u_char, size_t, u_char *, +- oid *, size_t); ++u_char *var_smux_get(oid *, size_t, oid *, size_t *, int, size_t *, ++ u_char *); ++int var_smux_write(int, u_char *, u_char, size_t, oid *, size_t); + + static smux_reg *ActiveRegs; /* Active registrations */ + static smux_reg *PassiveRegs; /* Currently unused registrations */ +@@ -114,14 +112,6 @@ static smux_reg *PassiveRegs; /* Curre + static smux_peer_auth *Auths[SMUX_MAX_PEERS]; /* Configured peers */ + static int nauths, npeers = 0; + +-struct variable2 smux_variables[] = { +- /* +- * bogus entry, as in pass.c +- */ +- {MIBINDEX, ASN_INTEGER, NETSNMP_OLDAPI_RWRITE, +- var_smux, 0, {MIBINDEX}}, +-}; +- + + + void +@@ -244,7 +234,7 @@ real_init_smux(void) + #endif + netsnmp_sockaddr_in( &lo_socket, smux_socket, SMUXPORT ); + +- if ((smux_listen_sd = socket(AF_INET, SOCK_STREAM, 0)) < 0) { ++ if ((smux_listen_sd = (int) socket(AF_INET, SOCK_STREAM, 0)) < 0) { + snmp_log_perror("[init_smux] socket failed"); + return; + } +@@ -291,21 +281,88 @@ real_init_smux(void) + smux_listen_sd, ntohs(lo_socket.sin_port))); + } + ++static int ++smux_handler(netsnmp_mib_handler *handler, ++ netsnmp_handler_registration *reginfo, ++ netsnmp_agent_request_info *reqinfo, ++ netsnmp_request_info *requests) ++{ ++ u_char *access = NULL; ++ size_t var_len; ++ int exact = 1; ++ int status = 0; ++ u_char var_type; ++ static long old_reqid = -1; ++ static long old_sessid = -1; ++ long new_reqid, new_sessid; ++ ++ /* Increment the reqid of outgoing SMUX messages only when processing ++ * new incoming SNMP message, i.e. when reqid or session id chamges */ ++ new_reqid = reqinfo->asp->pdu->reqid; ++ new_sessid = reqinfo->asp->session->sessid; ++ DEBUGMSGTL(("smux", "smux_handler: incoming reqid=%ld, sessid=%ld\n", ++ new_reqid, new_sessid)); ++ if (old_reqid != new_reqid || old_sessid != new_sessid) { ++ smux_reqid++; ++ old_reqid = new_reqid; ++ old_sessid = new_sessid; ++ } ++ ++ switch (reqinfo->mode) { ++ case MODE_GETNEXT: ++ case MODE_GETBULK: ++ exact = 0; ++ } ++ ++ for (; requests; requests = requests->next) { ++ switch(reqinfo->mode) { ++ case MODE_GET: ++ case MODE_GETNEXT: ++ case MODE_SET_RESERVE1: ++ access = var_smux_get(reginfo->rootoid, ++ reginfo->rootoid_len, ++ requests->requestvb->name, ++ &requests->requestvb->name_length, ++ exact, ++ &var_len, ++ &var_type); ++ if (access) ++ if (reqinfo->mode != MODE_SET_RESERVE1) ++ snmp_set_var_typed_value(requests->requestvb, ++ var_type, access, var_len); ++ if (reqinfo->mode != MODE_SET_RESERVE1) ++ break; ++ /* fall through if MODE_SET_RESERVE1 */ ++ ++ default: ++ /* SET processing */ ++ status = var_smux_write(reqinfo->mode, ++ requests->requestvb->val.string, ++ requests->requestvb->type, ++ requests->requestvb->val_len, ++ requests->requestvb->name, ++ requests->requestvb->name_length); ++ if (status != SNMP_ERR_NOERROR) { ++ netsnmp_set_request_error(reqinfo, requests, status); ++ } ++ } ++ } ++ return SNMP_ERR_NOERROR; ++} ++ + u_char * +-var_smux(struct variable * vp, +- oid * name, +- size_t * length, +- int exact, size_t * var_len, WriteMethod ** write_method) ++var_smux_get(oid *root, size_t root_len, ++ oid * name, size_t * length, ++ int exact, size_t * var_len, u_char *var_type) + { +- u_char *valptr, val_type; ++ u_char *valptr; + smux_reg *rptr; + +- *write_method = var_smux_write; + /* + * search the active registration list + */ + for (rptr = ActiveRegs; rptr; rptr = rptr->sr_next) { +- if (0 >= snmp_oidtree_compare(vp->name, vp->namelen, rptr->sr_name, ++ if (0 >= snmp_oidtree_compare(root, root_len, rptr->sr_name, + rptr->sr_name_len)) + break; + } +@@ -315,7 +372,7 @@ var_smux(struct variable * vp, + return NULL; + + valptr = smux_snmp_process(exact, name, length, +- var_len, &val_type, rptr->sr_fd); ++ var_len, var_type, rptr->sr_fd); + + if (valptr == NULL) + return NULL; +@@ -328,10 +385,6 @@ var_smux(struct variable * vp, + */ + return NULL; + } else { +- /* +- * set the type and return the value +- */ +- vp->type = val_type; + return valptr; + } + } +@@ -341,7 +394,7 @@ var_smux_write(int action, + u_char * var_val, + u_char var_val_type, + size_t var_val_len, +- u_char * statP, oid * name, size_t name_len) ++ oid * name, size_t name_len) + { + smux_reg *rptr; + u_char buf[SMUXMAXPKTSIZE], *ptr, sout[3], type; +@@ -589,7 +642,7 @@ smux_accept(int sd) + */ + DEBUGMSGTL(("smux", "[smux_accept] Calling accept()\n")); + errno = 0; +- if ((fd = accept(sd, (struct sockaddr *) &in_socket, &alen)) < 0) { ++ if ((fd = (int) accept(sd, (struct sockaddr *) &in_socket, &alen)) < 0) { + snmp_log_perror("[smux_accept] accept failed"); + return -1; + } else { +@@ -1000,6 +1053,7 @@ smux_rreq_process(int sd, u_char * ptr, + int i, result; + u_char type; + smux_reg *rptr, *nrptr; ++ netsnmp_handler_registration *reg; + + oid_name_len = MAX_OID_LEN; + ptr = asn_parse_objid(ptr, len, &type, oid_name, &oid_name_len); +@@ -1157,17 +1211,27 @@ smux_rreq_process(int sd, u_char * ptr, + */ + if (nrptr->sr_priority == -1) + nrptr->sr_priority = 0; ++ ++ reg = netsnmp_create_handler_registration("smux", ++ smux_handler, ++ nrptr->sr_name, ++ nrptr->sr_name_len, ++ HANDLER_CAN_RWRITE); ++ if (reg == NULL) { ++ snmp_log(LOG_ERR, "SMUX: cannot create new smux peer " ++ "registration\n"); ++ smux_send_rrsp(sd, -1); ++ free(nrptr); ++ return NULL; ++ } ++ if (netsnmp_register_handler(reg) != MIB_REGISTERED_OK) { ++ snmp_log(LOG_ERR, "SMUX: cannot register new smux peer\n"); ++ smux_send_rrsp(sd, -1); ++ free(nrptr); ++ return NULL; ++ } ++ nrptr->reginfo = reg; + smux_list_add(&ActiveRegs, nrptr); +- if (register_mib("smux", (struct variable *) +- smux_variables, sizeof(struct variable2), +- 1, nrptr->sr_name, nrptr->sr_name_len) +- != SNMPERR_SUCCESS) { +- DEBUGMSGTL(("smux", "[smux_rreq_process] Failed to register subtree\n")); +- smux_list_detach(&ActiveRegs, nrptr); +- free(nrptr); +- smux_send_rrsp(sd, -1); +- return NULL; +- } + + done: + smux_send_rrsp(sd, nrptr->sr_priority); +@@ -1214,16 +1278,35 @@ smux_find_match(smux_reg * regs, int sd, + static void + smux_replace_active(smux_reg * actptr, smux_reg * pasptr) + { ++ netsnmp_handler_registration *reg; ++ + smux_list_detach(&ActiveRegs, actptr); +- unregister_mib(actptr->sr_name, actptr->sr_name_len); ++ if (actptr->reginfo) { ++ netsnmp_unregister_handler(actptr->reginfo); ++ actptr->reginfo = NULL; ++ } + + smux_list_detach(&PassiveRegs, pasptr); +- (void) smux_list_add(&ActiveRegs, pasptr); + +- register_mib("smux", (struct variable *) smux_variables, +- sizeof(struct variable2), 1, pasptr->sr_name, +- pasptr->sr_name_len); ++ (void) smux_list_add(&ActiveRegs, pasptr); + free(actptr); ++ ++ reg = netsnmp_create_handler_registration("smux", ++ smux_handler, ++ pasptr->sr_name, ++ pasptr->sr_name_len, ++ HANDLER_CAN_RWRITE); ++ if (reg == NULL) { ++ snmp_log(LOG_ERR, "SMUX: cannot create new smux peer registration\n"); ++ pasptr->reginfo = NULL; ++ return; ++ } ++ if (netsnmp_register_handler(reg) != MIB_REGISTERED_OK) { ++ snmp_log(LOG_ERR, "SMUX: cannot register new smux peer\n"); ++ pasptr->reginfo = NULL; ++ return; ++ } ++ pasptr->reginfo = reg; + } + + static void +@@ -1373,8 +1456,6 @@ smux_snmp_process(int exact, + /* + * Send the query to the peer + */ +- smux_reqid++; +- + if (exact) + type = SMUX_GET; + else +@@ -1757,6 +1838,7 @@ smux_peer_cleanup(int sd) + { + smux_reg *nrptr, *rptr, *rptr2; + int i; ++ netsnmp_handler_registration *reg; + + /* + * close the descriptor +@@ -1781,15 +1863,30 @@ smux_peer_cleanup(int sd) + rptr2 = rptr->sr_next; + if (rptr->sr_fd == sd) { + smux_list_detach(&ActiveRegs, rptr); +- unregister_mib(rptr->sr_name, rptr->sr_name_len); ++ if (rptr->reginfo) { ++ netsnmp_unregister_handler(rptr->reginfo); ++ rptr->reginfo = NULL; ++ } + if ((nrptr = smux_find_replacement(rptr->sr_name, + rptr->sr_name_len)) != +- NULL) { ++ NULL) { + smux_list_detach(&PassiveRegs, nrptr); ++ reg = netsnmp_create_handler_registration("smux", ++ smux_handler, ++ nrptr->sr_name, ++ nrptr->sr_name_len, ++ HANDLER_CAN_RWRITE); ++ if (reg == NULL) { ++ snmp_log(LOG_ERR, "SMUX: cannot create new smux peer " ++ "registration\n"); ++ continue; ++ } ++ if (netsnmp_register_handler(reg) != MIB_REGISTERED_OK) { ++ snmp_log(LOG_ERR, "SMUX: cannot register new smux peer\n"); ++ continue; ++ } ++ nrptr->reginfo = reg; + smux_list_add(&ActiveRegs, nrptr); +- register_mib("smux", (struct variable *) +- smux_variables, sizeof(struct variable2), +- 1, nrptr->sr_name, nrptr->sr_name_len); + } + free(rptr); + } +diff -up net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.h.rhel net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.h +--- net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.h.rhel 2012-07-31 14:13:21.893006290 +0200 ++++ net-snmp-5.7.2.pre2/agent/mibgroup/smux/smux.h 2012-07-31 13:49:55.000000000 +0200 +@@ -60,6 +60,7 @@ typedef struct _smux_reg { + int sr_priority; /* priority of registration */ + int sr_fd; /* descriptor of owner */ + struct _smux_reg *sr_next; /* next one */ ++ netsnmp_handler_registration *reginfo; + } smux_reg; + + extern void init_smux(void); diff --git a/SOURCES/net-snmp-5.7.2-agentx-disconnect-crash.patch b/SOURCES/net-snmp-5.7.2-agentx-disconnect-crash.patch new file mode 100644 index 0000000..10a9f7b --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-agentx-disconnect-crash.patch @@ -0,0 +1,207 @@ +969061 - net-snmpd crash on time out + +ABI breaking upstream patch. + +commit 793d596838ff7cb48a73b675d62897c56c9e62df +Author: Jan Safranek +Date: Tue Jul 2 14:32:56 2013 +0200 + + From: Jiri Cervenka: snmpd: Fixed agentx crashing and/or freezing on timeout. + + Queued requests are dropped gracefuly. + +diff --git a/agent/mibgroup/agentx/master_admin.c b/agent/mibgroup/agentx/master_admin.c +index 999128a..4b42104 100644 +--- a/agent/mibgroup/agentx/master_admin.c ++++ b/agent/mibgroup/agentx/master_admin.c +@@ -158,6 +158,7 @@ close_agentx_session(netsnmp_session * session, int sessid) + for (sp = session->subsession; sp != NULL; sp = sp->next) { + + if (sp->sessid == sessid) { ++ netsnmp_remove_delegated_requests_for_session(sp); + unregister_mibs_by_session(sp); + unregister_index_by_session(sp); + unregister_sysORTable_by_session(sp); +diff --git a/agent/snmp_agent.c b/agent/snmp_agent.c +index 1261c53..51eb287 100644 +--- a/agent/snmp_agent.c ++++ b/agent/snmp_agent.c +@@ -1415,6 +1415,7 @@ init_agent_snmp_session(netsnmp_session * session, netsnmp_pdu *pdu) + asp->treecache_num = -1; + asp->treecache_len = 0; + asp->reqinfo = SNMP_MALLOC_TYPEDEF(netsnmp_agent_request_info); ++ asp->flags = SNMP_AGENT_FLAGS_NONE; + DEBUGMSGTL(("verbose:asp", "asp %p reqinfo %p created\n", + asp, asp->reqinfo)); + +@@ -1463,6 +1464,9 @@ netsnmp_check_for_delegated(netsnmp_agent_session *asp) + + if (NULL == asp->treecache) + return 0; ++ ++ if (asp->flags & SNMP_AGENT_FLAGS_CANCEL_IN_PROGRESS) ++ return 0; + + for (i = 0; i <= asp->treecache_num; i++) { + for (request = asp->treecache[i].requests_begin; request; +@@ -1541,39 +1545,48 @@ int + netsnmp_remove_delegated_requests_for_session(netsnmp_session *sess) + { + netsnmp_agent_session *asp; +- int count = 0; ++ int total_count = 0; + + for (asp = agent_delegated_list; asp; asp = asp->next) { + /* + * check each request + */ ++ int i; ++ int count = 0; + netsnmp_request_info *request; +- for(request = asp->requests; request; request = request->next) { +- /* +- * check session +- */ +- netsnmp_assert(NULL!=request->subtree); +- if(request->subtree->session != sess) +- continue; ++ for (i = 0; i <= asp->treecache_num; i++) { ++ for (request = asp->treecache[i].requests_begin; request; ++ request = request->next) { ++ /* ++ * check session ++ */ ++ netsnmp_assert(NULL!=request->subtree); ++ if(request->subtree->session != sess) ++ continue; + +- /* +- * matched! mark request as done +- */ +- netsnmp_request_set_error(request, SNMP_ERR_GENERR); +- ++count; ++ /* ++ * matched! mark request as done ++ */ ++ netsnmp_request_set_error(request, SNMP_ERR_GENERR); ++ ++count; ++ } ++ } ++ if (count) { ++ asp->flags |= SNMP_AGENT_FLAGS_CANCEL_IN_PROGRESS; ++ total_count += count; + } + } + + /* + * if we found any, that request may be finished now + */ +- if(count) { ++ if(total_count) { + DEBUGMSGTL(("snmp_agent", "removed %d delegated request(s) for session " +- "%8p\n", count, sess)); +- netsnmp_check_outstanding_agent_requests(); ++ "%8p\n", total_count, sess)); ++ netsnmp_check_delegated_requests(); + } + +- return count; ++ return total_count; + } + + int +@@ -2745,19 +2758,11 @@ handle_var_requests(netsnmp_agent_session *asp) + return final_status; + } + +-/* +- * loop through our sessions known delegated sessions and check to see +- * if they've completed yet. If there are no more delegated sessions, +- * check for and process any queued requests +- */ + void +-netsnmp_check_outstanding_agent_requests(void) ++netsnmp_check_delegated_requests(void) + { + netsnmp_agent_session *asp, *prev_asp = NULL, *next_asp = NULL; + +- /* +- * deal with delegated requests +- */ + for (asp = agent_delegated_list; asp; asp = next_asp) { + next_asp = asp->next; /* save in case we clean up asp */ + if (!netsnmp_check_for_delegated(asp)) { +@@ -2796,6 +2801,22 @@ netsnmp_check_outstanding_agent_requests(void) + prev_asp = asp; + } + } ++} ++ ++/* ++ * loop through our sessions known delegated sessions and check to see ++ * if they've completed yet. If there are no more delegated sessions, ++ * check for and process any queued requests ++ */ ++void ++netsnmp_check_outstanding_agent_requests(void) ++{ ++ netsnmp_agent_session *asp; ++ ++ /* ++ * deal with delegated requests ++ */ ++ netsnmp_check_delegated_requests(); + + /* + * if we are processing a set and there are more delegated +@@ -2825,7 +2846,8 @@ netsnmp_check_outstanding_agent_requests(void) + + netsnmp_processing_set = netsnmp_agent_queued_list; + DEBUGMSGTL(("snmp_agent", "SET request remains queued while " +- "delegated requests finish, asp = %8p\n", asp)); ++ "delegated requests finish, asp = %8p\n", ++ agent_delegated_list)); + break; + } + #endif /* NETSNMP_NO_WRITE_SUPPORT */ +@@ -2886,6 +2908,10 @@ check_delayed_request(netsnmp_agent_session *asp) + case SNMP_MSG_GETBULK: + case SNMP_MSG_GETNEXT: + netsnmp_check_all_requests_status(asp, 0); ++ if (asp->flags & SNMP_AGENT_FLAGS_CANCEL_IN_PROGRESS) { ++ DEBUGMSGTL(("snmp_agent","canceling next walk for asp %p\n", asp)); ++ break; ++ } + handle_getnext_loop(asp); + if (netsnmp_check_for_delegated(asp) && + netsnmp_check_transaction_id(asp->pdu->transid) != +diff --git a/include/net-snmp/agent/snmp_agent.h b/include/net-snmp/agent/snmp_agent.h +index aad8837..43f4fff 100644 +--- a/include/net-snmp/agent/snmp_agent.h ++++ b/include/net-snmp/agent/snmp_agent.h +@@ -32,6 +32,9 @@ extern "C" { + #define SNMP_MAX_PDU_SIZE 64000 /* local constraint on PDU size sent by agent + * (see also SNMP_MAX_MSG_SIZE in snmp_api.h) */ + ++#define SNMP_AGENT_FLAGS_NONE 0x0 ++#define SNMP_AGENT_FLAGS_CANCEL_IN_PROGRESS 0x1 ++ + /* + * If non-zero, causes the addresses of peers to be logged when receptions + * occur. +@@ -205,6 +208,7 @@ extern "C" { + int treecache_num; /* number of current cache entries */ + netsnmp_cachemap *cache_store; + int vbcount; ++ int flags; + } netsnmp_agent_session; + + /* +@@ -240,6 +244,7 @@ extern "C" { + int init_master_agent(void); + void shutdown_master_agent(void); + int agent_check_and_process(int block); ++ void netsnmp_check_delegated_requests(void); + void netsnmp_check_outstanding_agent_requests(void); + + int netsnmp_request_set_error(netsnmp_request_info *request, diff --git a/SOURCES/net-snmp-5.7.2-btrfs.patch b/SOURCES/net-snmp-5.7.2-btrfs.patch new file mode 100644 index 0000000..19e6c05 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-btrfs.patch @@ -0,0 +1,33 @@ +Bug 965348 - HOST-RESOURCES-MIB::hrFS* not includes btrfs +1006758 - HOST-RESOURCES-MIB::hrFS* not includes btrfs + +commit da1fef382591ff45dc92eb3b95a6bfeff9ecfa4f +Author: Jan Safranek +Date: Tue May 21 09:13:41 2013 +0200 + + CHANGES: snmpd: Added btrfs support to hrFSTable + +diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.btrfs net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c +--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.btrfs 2013-09-11 12:12:54.586891414 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c 2013-09-11 12:12:41.565947166 +0200 +@@ -141,6 +141,7 @@ _fsys_type( char *typename ) + !strcmp(typename, MNTTYPE_CVFS) || + !strcmp(typename, MNTTYPE_SIMFS) || + !strcmp(typename, MNTTYPE_VZFS) || ++ !strcmp(typename, MNTTYPE_BTRFS) || + !strcmp(typename, MNTTYPE_LOFS)) + return NETSNMP_FS_TYPE_OTHER; + +diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.btrfs net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h +--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.btrfs 2013-09-11 12:00:15.283166852 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h 2013-09-11 12:00:15.284166847 +0200 +@@ -148,6 +148,9 @@ + #ifndef MNTTYPE_VZFS + #define MNTTYPE_VZFS "vzfs" + #endif ++#ifndef MNTTYPE_BTRFS ++#define MNTTYPE_BTRFS "btrfs" ++#endif + + /* + * File systems to skip diff --git a/SOURCES/net-snmp-5.7.2-clientaddr-port.patch b/SOURCES/net-snmp-5.7.2-clientaddr-port.patch new file mode 100644 index 0000000..43eacac --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-clientaddr-port.patch @@ -0,0 +1,157 @@ +833013 - The port number specified with clientaddr is not used for trap udp socket + +commit 521b4e28b4c794a9d6d929858478d13875246ce3 +Author: Ivosh +Date: Mon Jul 30 10:53:22 2012 -0700 + + CHANGES: libnetsnmp: PATCH 3404876: from hardaker: ability to specify local-bound port in addition to address + + Signed-off-by: Wes Hardaker + +diff -up net-snmp-5.7.2/include/net-snmp/library/default_store.h.port net-snmp-5.7.2/include/net-snmp/library/default_store.h +--- net-snmp-5.7.2/include/net-snmp/library/default_store.h.port 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/include/net-snmp/library/default_store.h 2012-11-13 10:51:34.528804796 +0100 +@@ -94,6 +94,7 @@ extern "C" { + #define NETSNMP_DS_LIB_TSM_USE_PREFIX 39 /* TSM's simple security name mapping */ + #define NETSNMP_DS_LIB_DONT_LOAD_HOST_FILES 40 /* don't read host.conf files */ + #define NETSNMP_DS_LIB_DNSSEC_WARN_ONLY 41 /* tread DNSSEC errors as warnings */ ++#define NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT 42 /* NETSNMP_DS_LIB_CLIENT_ADDR includes address and also port */ + #define NETSNMP_DS_LIB_MAX_BOOL_ID 48 /* match NETSNMP_DS_MAX_SUBIDS */ + + /* +diff -up net-snmp-5.7.2/perl/default_store/default_store.pm.port net-snmp-5.7.2/perl/default_store/default_store.pm +--- net-snmp-5.7.2/perl/default_store/default_store.pm.port 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/perl/default_store/default_store.pm 2012-11-13 10:51:34.679804190 +0100 +@@ -63,6 +63,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK + NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD + NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE + NETSNMP_DS_LIB_APPEND_LOGFILES ++ NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT + NETSNMP_DS_LIB_MIB_WARNINGS + NETSNMP_DS_LIB_SECLEVEL + NETSNMP_DS_LIB_SNMPVERSION +@@ -161,6 +162,7 @@ use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK + NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD + NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE + NETSNMP_DS_LIB_APPEND_LOGFILES ++ NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT + NETSNMP_DS_LIB_MIB_WARNINGS + NETSNMP_DS_LIB_SECLEVEL + NETSNMP_DS_LIB_SNMPVERSION +@@ -299,6 +301,7 @@ None by default. + NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD + NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE + NETSNMP_DS_LIB_APPEND_LOGFILES ++ NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT + NETSNMP_DS_LIB_MIB_WARNINGS + NETSNMP_DS_LIB_SECLEVEL + NETSNMP_DS_LIB_SNMPVERSION +diff -up net-snmp-5.7.2/perl/default_store/default_store.xs.port net-snmp-5.7.2/perl/default_store/default_store.xs +--- net-snmp-5.7.2/perl/default_store/default_store.xs.port 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/perl/default_store/default_store.xs 2012-11-13 10:51:35.154802043 +0100 +@@ -1238,6 +1238,17 @@ __END__ + #endif + } + break; ++ case 36: ++ if (memEQ(name, "NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT", 36)) { ++#ifdef NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT ++ *iv_return = NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT; ++ return PERL_constant_ISIV; ++#else ++ return PERL_constant_NOTDEF; ++#endif ++ } ++ break; ++ + case 38: + return constant_38 (aTHX_ name, iv_return); + break; +@@ -1245,8 +1256,6 @@ __END__ + return PERL_constant_NOTFOUND; + } + +- +- + /* autogenerated by "gen" from const-xs.inc */ + + MODULE = NetSNMP::default_store PACKAGE = NetSNMP::default_store +diff -up net-snmp-5.7.2/perl/default_store/test.pl.port net-snmp-5.7.2/perl/default_store/test.pl +--- net-snmp-5.7.2/perl/default_store/test.pl.port 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/perl/default_store/test.pl 2012-11-13 10:51:35.185801918 +0100 +@@ -52,6 +52,7 @@ BEGIN { $| = 1; + "NETSNMP_DS_LIB_DISABLE_PERSISTENT_LOAD" => 35, + "NETSNMP_DS_LIB_DISABLE_PERSISTENT_SAVE" => 36, + "NETSNMP_DS_LIB_APPEND_LOGFILES" => 37, ++ "NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT" => 42, + "NETSNMP_DS_LIB_MIB_WARNINGS" => 0, + "NETSNMP_DS_LIB_SECLEVEL" => 1, + "NETSNMP_DS_LIB_SNMPVERSION" => 2, +diff -up net-snmp-5.7.2/snmplib/snmp_api.c.port net-snmp-5.7.2/snmplib/snmp_api.c +--- net-snmp-5.7.2/snmplib/snmp_api.c.port 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/snmp_api.c 2012-11-13 10:51:35.188801906 +0100 +@@ -769,6 +769,8 @@ register_default_handlers(void) + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_16BIT_IDS); + netsnmp_ds_register_premib(ASN_OCTET_STR, "snmp", "clientaddr", + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CLIENT_ADDR); ++ netsnmp_ds_register_premib(ASN_BOOLEAN, "snmp", "clientaddrUsesPort", ++ NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT); + netsnmp_ds_register_config(ASN_INTEGER, "snmp", "serverSendBuf", + NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_SERVERSENDBUF); + netsnmp_ds_register_config(ASN_INTEGER, "snmp", "serverRecvBuf", +diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.port net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c +--- net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.port 2012-11-13 10:51:32.781812675 +0100 ++++ net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c 2012-11-13 10:51:35.190801898 +0100 +@@ -183,7 +183,29 @@ netsnmp_udpipv4base_transport(struct soc + NETSNMP_DS_LIB_CLIENT_ADDR); + if (client_socket) { + struct sockaddr_in client_addr; +- netsnmp_sockaddr_in2(&client_addr, client_socket, NULL); ++ ++ char *client_address = client_socket; ++ int uses_port = netsnmp_ds_get_boolean(NETSNMP_DS_LIBRARY_ID, ++ NETSNMP_DS_LIB_CLIENT_ADDR_USES_PORT); ++ if ((uses_port == 1) && (strchr(client_socket, ':') == NULL)) { ++ client_address = malloc(strlen(client_socket) + 3); ++ if (client_address == NULL) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } /* if NETSNMP_DS_LIB_CLIENT_ADDR */ ++ strcpy(client_address, client_socket); /* expects a port but there is none */ ++ strcat(client_address, ":0"); /* specified then provide ephemeral one */ ++ } ++ ++ netsnmp_sockaddr_in2(&client_addr, client_address, NULL); ++ if (uses_port == 0) { ++ client_addr.sin_port = 0; ++ } ++ if (client_address != client_socket) { ++ free(client_address); ++ } ++ + client_addr.sin_port = 0; + DEBUGMSGTL(("netsnmp_udpbase", "binding socket: %d\n", t->sock)); + rc = bind(t->sock, (struct sockaddr *)&client_addr, +commit 9e00fff692081e36c9d883fab7b6bd8881c670fc +Author: Jan Safranek +Date: Tue Aug 7 12:27:18 2012 +0200 + + Document new clientaddrUsesPort option. + +diff --git a/man/snmp.conf.5.def b/man/snmp.conf.5.def +index 9c7c55b..904635b 100644 +--- a/man/snmp.conf.5.def ++++ b/man/snmp.conf.5.def +@@ -127,6 +127,10 @@ This value is also used by \fBsnmpd\fR when generating notifications. + .\" But not responses to an incoming request? + .\" What about snmptrapd? + .\" ++.IP "clientaddrUsesPort no" ++specifies, if clientaddr option contains a port number. Set this option ++to "yes", if clientaddr contains a port number and this port should ++be used for sending outgoing SNMP requests. + .IP "clientRecvBuf INTEGER" + specifies the desired size of the buffer to be used when receiving + responses to SNMP requests. + diff --git a/SOURCES/net-snmp-5.7.2-create-user-multilib.patch b/SOURCES/net-snmp-5.7.2-create-user-multilib.patch new file mode 100644 index 0000000..dc74514 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-create-user-multilib.patch @@ -0,0 +1,41 @@ +Make net-snmp-create-v3-user multilib-clean + +The file had different NSC_AGENTLIBS on different architectures. + +Source: upstream + +commit 68300a9fb43568c5d833c48a2fef3ff16c2923c3 +Author: Jan Safranek +Date: Thu Feb 7 10:14:33 2013 +0100 + + Remove unused variables. + +diff -up net-snmp-5.7.2/net-snmp-create-v3-user.in.multilib net-snmp-5.7.2/net-snmp-create-v3-user.in +--- net-snmp-5.7.2/net-snmp-create-v3-user.in.multilib 2013-03-22 10:19:41.151901243 +0100 ++++ net-snmp-5.7.2/net-snmp-create-v3-user.in 2013-03-22 10:20:02.476801266 +0100 +@@ -8,25 +8,7 @@ + prefix=@prefix@ + exec_prefix=@exec_prefix@ + includedir=@includedir@ +-libdir=@libdir@ + datarootdir=@datarootdir@ +-NSC_LDFLAGS="@LDFLAGS@" +-NSC_INCLUDEDIR=${includedir} +-NSC_LIBDIR=-L${libdir} +-NSC_LIBS="@LIBS@" +-NSC_AGENTLIBS="@AGENTLIBS@ @PERLLDOPTS_FOR_APPS@" +-NSC_PREFIX=$prefix +-NSC_EXEC_PREFIX=$exec_prefix +-NSC_SRCDIR=@srcdir@ +-NSC_INCDIR=${NSC_PREFIX}/include +-NSC_BASE_SUBAGENT_LIBS="-lnetsnmpagent -lnetsnmp" +-NSC_BASE_AGENT_LIBS="-lnetsnmpagent -lnetsnmpmibs -lnetsnmp" +-NSC_SRC_LIBDIRS="agent/.libs snmplib/.libs" +-NSC_SRC_LIBDEPS="agent/.libs/libnetsnmpmibs.a agent/.libs/libnetsnmpagent.a snmplib/.libs/libnetsnmp.a" +- +-if test "x$NSC_SRCDIR" = "x." ; then +- NSC_SRCDIR="NET-SNMP-SOURCE-DIR" +-fi + + if @PSCMD@ | egrep ' snmpd *$' > /dev/null 2>&1 ; then + echo "Apparently at least one snmpd demon is already running." diff --git a/SOURCES/net-snmp-5.7.2-dot3stats-log.patch b/SOURCES/net-snmp-5.7.2-dot3stats-log.patch new file mode 100644 index 0000000..5c57542 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-dot3stats-log.patch @@ -0,0 +1,30 @@ +915302 - snmpd logging strange messages when reading MIB + +commit ecf8682d864d2f08525078543858d361b3adca5c +Author: Jan Safranek +Date: Wed Jul 10 10:47:33 2013 +0200 + + Lower importance of debugging messages, they spam syslog. + +diff --git a/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c b/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c +index 49c3fdb..b110950 100644 +--- a/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c ++++ b/agent/mibgroup/etherlike-mib/data_access/dot3stats_linux.c +@@ -440,7 +440,7 @@ _dot3Stats_netlink_get_errorcntrs(dot3StatsTable_rowreq_ctx *rowreq_ctx, const c + { + dot3StatsTable_data *data = &rowreq_ctx->data; + +- snmp_log(LOG_ERR, "IFLA_STATS for %s\n", name); ++ DEBUGMSGTL(("access:dot3StatsTable", "IFLA_STATS for %s\n", name)); + + data->dot3StatsFCSErrors = ke->stats.rx_crc_errors; + rowreq_ctx->column_exists_flags |= COLUMN_DOT3STATSFCSERRORS_FLAG; +@@ -527,7 +527,7 @@ interface_dot3stats_get_errorcounters (dot3StatsTable_rowreq_ctx *rowreq_ctx, co + + if (_dot3Stats_netlink_get_errorcntrs(rowreq_ctx, name) == 0) + { +- snmp_log(LOG_NOTICE, "interface_dot3stats_get_errorcounters: got data from IFLA_STATS\n"); ++ DEBUGMSGTL(("access:dot3StatsTable", "interface_dot3stats_get_errorcounters: got data from IFLA_STATS\n")); + return; + } + diff --git a/SOURCES/net-snmp-5.7.2-dskTable-dynamic.patch b/SOURCES/net-snmp-5.7.2-dskTable-dynamic.patch new file mode 100644 index 0000000..35e3f6e --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-dskTable-dynamic.patch @@ -0,0 +1,175 @@ +commit e3fc76e0ae502fb8ef0aac87eee237db9d9690f5 +Author: Jan Safranek +Date: Tue Jul 9 14:26:59 2013 +0200 + + CHANGES: snmpd: Make UCD-SNMP::dskTable dynamic if includeAllDisks is set. + +diff --git a/agent/mibgroup/ucd-snmp/disk_hw.c b/agent/mibgroup/ucd-snmp/disk_hw.c +index ea37610..f7911d9 100644 +--- a/agent/mibgroup/ucd-snmp/disk_hw.c ++++ b/agent/mibgroup/ucd-snmp/disk_hw.c +@@ -55,6 +55,7 @@ static netsnmp_fsys_info ** _expand_disk_array( char *cptr ); + + int numdisks; + int allDisksIncluded = 0; ++int allDisksMinPercent = 0; + int maxdisks = 0; + netsnmp_fsys_info **disks = NULL; + +@@ -119,6 +120,7 @@ init_disk_hw(void) + disk_free_config, + "minpercent%"); + allDisksIncluded = 0; ++ allDisksMinPercent = 0; + } + + static void +@@ -140,6 +142,7 @@ disk_free_config(void) + maxdisks = numdisks = 0; + } + allDisksIncluded = 0; ++ allDisksMinPercent = 0; + } + + static void +@@ -199,8 +202,7 @@ static void + disk_parse_config_all(const char *token, char *cptr) + { + int minpercent = DISKMINPERCENT; +- netsnmp_fsys_info *entry; +- ++ + /* + * read the minimum disk usage percent + */ +@@ -220,30 +222,36 @@ disk_parse_config_all(const char *token, char *cptr) + netsnmp_config_error("\tignoring: includeAllDisks %s", cptr); + } + else { +- +- netsnmp_fsys_load( NULL, NULL ); /* Prime the fsys H/W module */ +- for ( entry = netsnmp_fsys_get_first(); +- entry != NULL; +- entry = netsnmp_fsys_get_next( entry )) { +- +- if ( !(entry->flags & NETSNMP_FS_FLAG_ACTIVE )) +- continue; +- entry->minspace = -1; +- entry->minpercent = minpercent; +- entry->flags |= NETSNMP_FS_FLAG_UCD; +- /* +- * Ensure there is space for the new entry +- */ +- if (numdisks == maxdisks) { +- if (!_expand_disk_array( entry->device )) +- return; +- } +- disks[numdisks++] = entry; +- } + allDisksIncluded = 1; ++ allDisksMinPercent = minpercent; + } + } + ++/* add new entries to dskTable dynamically */ ++static void _refresh_disks(int minpercent) ++{ ++ netsnmp_fsys_info *entry; ++ ++ for ( entry = netsnmp_fsys_get_first(); ++ entry != NULL; ++ entry = netsnmp_fsys_get_next( entry )) { ++ ++ if (!(entry->flags & NETSNMP_FS_FLAG_UCD)) { ++ /* this is new disk, add it to the table */ ++ entry->minspace = -1; ++ entry->minpercent = minpercent; ++ entry->flags |= NETSNMP_FS_FLAG_UCD; ++ /* ++ * Ensure there is space for the new entry ++ */ ++ if (numdisks == maxdisks) { ++ if (!_expand_disk_array( entry->device )) ++ return; ++ } ++ disks[numdisks++] = entry; ++ } ++ } ++} + + static int _percent( unsigned long long value, unsigned long long total ) { + float v=value, t=total, pct; +@@ -301,7 +309,7 @@ var_extensible_disk(struct variable *vp, + size_t * var_len, WriteMethod ** write_method) + { + int disknum = 0; +- netsnmp_fsys_info *entry; ++ netsnmp_fsys_info *entry; + unsigned long long val; + static long long_ret; + static char errmsg[300]; +@@ -310,6 +318,8 @@ var_extensible_disk(struct variable *vp, + /* Update the fsys H/W module */ + cache = netsnmp_fsys_get_cache(); + netsnmp_cache_check_and_reload(cache); ++ if (allDisksIncluded) ++ _refresh_disks(allDisksMinPercent); + + tryAgain: + if (header_simple_table +@@ -318,9 +328,14 @@ tryAgain: + disknum = name[*length - 1] - 1; + entry = disks[disknum]; + if ( !entry ) { +- if (!exact || !(entry->flags & NETSNMP_FS_FLAG_UCD)) +- goto tryAgain; +- return NULL; ++ if (exact) ++ return NULL; ++ goto tryAgain; ++ } ++ if (!(entry->flags & NETSNMP_FS_FLAG_ACTIVE) || !(entry->flags & NETSNMP_FS_FLAG_UCD)) { ++ if (exact) ++ return NULL; ++ goto tryAgain; + } + + switch (vp->magic) { +diff --git a/man/snmpd.conf.5.def b/man/snmpd.conf.5.def +index 5f85f72..d2caf9c 100644 +--- a/man/snmpd.conf.5.def ++++ b/man/snmpd.conf.5.def +@@ -652,6 +652,8 @@ This requires that the agent was built with support for the + default build configuration). + .IP "disk PATH [ MINSPACE | MINPERCENT% ]" + monitors the disk mounted at PATH for available disk space. ++Disks mounted after the agent has started will not be monitored, ++unless \fIincludeAllDisks\fR option is specified. + .IP + The minimum threshold can either be specified in kB (MINSPACE) or + as a percentage of the total disk (MINPERCENT% with a '%' character), +@@ -668,6 +670,9 @@ the problem - see the DisMan Event MIB section later. + .IP "includeAllDisks MINPERCENT%" + configures monitoring of all disks found on the system, + using the specified (percentage) threshold. ++The \fCdskTable\fR is dynamically updated, unmounted disks ++disappear from the table and newly mounted disks are ++added to the table. + The threshold for individual disks can be adjusted using suitable + \fIdisk\fR directives (which can come either before or after the + \fIincludeAllDisks\fR directive). +@@ -680,12 +685,8 @@ may affect the indexing of the \fCdskTable\fR. + Only one \fIincludeAllDisks\fR directive should be specified - any + subsequent copies will be ignored. + .IP +-The list of mounted disks will be determined when the agent starts using the +-setmntent(3) and getmntent(3), or fopen(3) and getmntent(3), or +-setfsent(3) and getfsent(3) system calls. If none of the above +-system calls are available then the root partition "/" +-(which is assumed to exist on any UNIX based system) will be monitored. +-Disks mounted after the agent has started will not be monitored. ++The list of mounted disks will be determined from ++HOST-RESOURCES-MIB::hrFSTable. + .\" + .\" XXX - unless the config is re-read ?? + .\" diff --git a/SOURCES/net-snmp-5.7.2-exec-cmdline.patch b/SOURCES/net-snmp-5.7.2-exec-cmdline.patch new file mode 100644 index 0000000..97999ae --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-exec-cmdline.patch @@ -0,0 +1,83 @@ +842279 - Incomplete command line in UCD-SNMP-MIB::extCommand + +commit e8e44b3faecdba5daedfb45d815fae65117d1b22 +Author: Jan Safranek +Date: Mon Sep 10 13:25:38 2012 +0200 + + CHANGES: snmpd: fixed value of UCD-SNMP-MIB::extCommand to contain full command line. + + MIB description of UCD-SNMP-MIB::extCommand suggests it should contail full command line. + Also in Net-SNMP 5.3.2.2, whole command line was shown. + +diff --git a/agent/mibgroup/agent/extend.c b/agent/mibgroup/agent/extend.c +index 085d762..0b2c660 100644 +--- a/agent/mibgroup/agent/extend.c ++++ b/agent/mibgroup/agent/extend.c +@@ -44,6 +44,9 @@ unsigned int num_compatability_entries = 0; + unsigned int max_compatability_entries = 50; + netsnmp_old_extend *compatability_entries; + ++char *cmdlinebuf; ++size_t cmdlinesize; ++ + WriteMethod fixExec2Error; + FindVarMethod var_extensible_old; + oid old_extensible_variables_oid[] = { NETSNMP_UCDAVIS_MIB, NETSNMP_SHELLMIBNUM, 1 }; +@@ -1354,6 +1357,23 @@ handle_nsExtendOutput2Table(netsnmp_mib_handler *handler, + * + *************************/ + ++char * _get_cmdline(netsnmp_extend *extend) ++{ ++ size_t size; ++ ++ size = strlen(extend->command) + strlen(extend->args) + 2; ++ if (size > cmdlinesize) { ++ cmdlinebuf = realloc(cmdlinebuf, size); ++ if (!cmdlinebuf) { ++ cmdlinesize = 0; ++ return NULL; ++ } ++ cmdlinesize = size; ++ } ++ sprintf(cmdlinebuf, "%s %s", extend->command, extend->args); ++ return cmdlinebuf; ++} ++ + u_char * + var_extensible_old(struct variable * vp, + oid * name, +@@ -1364,6 +1384,7 @@ var_extensible_old(struct variable * vp, + netsnmp_old_extend *exten = NULL; + static long long_ret; + unsigned int idx; ++ char *cmdline; + + if (header_simple_table + (vp, name, length, exact, var_len, write_method, num_compatability_entries)) +@@ -1382,8 +1403,10 @@ var_extensible_old(struct variable * vp, + *var_len = strlen(exten->exec_entry->token); + return ((u_char *) (exten->exec_entry->token)); + case SHELLCOMMAND: +- *var_len = strlen(exten->exec_entry->command); +- return ((u_char *) (exten->exec_entry->command)); ++ cmdline = _get_cmdline(exten->exec_entry); ++ if (cmdline) ++ *var_len = strlen(cmdline); ++ return ((u_char *) cmdline); + case ERRORFLAG: /* return code from the process */ + netsnmp_cache_check_and_reload( exten->exec_entry->cache ); + long_ret = exten->exec_entry->result; +@@ -1406,8 +1429,10 @@ var_extensible_old(struct variable * vp, + + case ERRORFIXCMD: + if (exten->efix_entry) { +- *var_len = strlen(exten->efix_entry->command); +- return ((u_char *) exten->efix_entry->command); ++ cmdline = _get_cmdline(exten->efix_entry); ++ if (cmdline) ++ *var_len = strlen(cmdline); ++ return ((u_char *) cmdline); + } else { + *var_len = 0; + return ((u_char *) &long_return); /* Just needs to be non-null! */ diff --git a/SOURCES/net-snmp-5.7.2-fips.patch b/SOURCES/net-snmp-5.7.2-fips.patch new file mode 100644 index 0000000..cfa812b --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-fips.patch @@ -0,0 +1,116 @@ +874440 - net-snmp does not work in FIPS mode + +Three upstream commits are here: + +commit dde3a35baaeb683cf1441a16a15441f8b456c520 +Author: Jan Safranek +Date: Mon Nov 12 15:45:27 2012 +0100 + + CHANGES: snmplib: Fixed crash when MD5 hash is not supported by OpenSSL. + +commit dd53ffbafeb31cde616a89949e70e3d5fe0cc1b3 +Author: Jan Safranek +Date: Mon Nov 12 15:46:43 2012 +0100 + + Fall back to SHA-1 if MD5 is not available. + On paranoid systems where MD5 is disabled use SHA-1 instead of MD5 and don't crash. + +commit 743cb66718904979f55895472501584c30c66f10 +Author: Jan Safranek +Date: Mon Nov 12 15:49:15 2012 +0100 + + Fixed crash when MD5 and/or SHA-1 hash is not supported by OpenSSL. + +diff -up net-snmp-5.7.2/snmplib/keytools.c.fips net-snmp-5.7.2/snmplib/keytools.c +--- net-snmp-5.7.2/snmplib/keytools.c.fips 2012-11-12 13:36:17.868635391 +0100 ++++ net-snmp-5.7.2/snmplib/keytools.c 2012-11-12 14:24:23.031293984 +0100 +@@ -156,27 +156,36 @@ generate_Ku(const oid * hashtype, u_int + EVP_MD_CTX_init(ctx); + #endif + #ifndef NETSNMP_DISABLE_MD5 +- if (ISTRANSFORM(hashtype, HMACMD5Auth)) +- EVP_DigestInit(ctx, EVP_md5()); +- else ++ if (ISTRANSFORM(hashtype, HMACMD5Auth)) { ++ if (!EVP_DigestInit(ctx, EVP_md5())) ++ /* MD5 not supported */ ++ return SNMPERR_GENERR; ++ } else + #endif +- if (ISTRANSFORM(hashtype, HMACSHA1Auth)) +- EVP_DigestInit(ctx, EVP_sha1()); +- else +- QUITFUN(SNMPERR_GENERR, generate_Ku_quit); ++ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) { ++ if (!EVP_DigestInit(ctx, EVP_sha1())) ++ /* SHA1 not supported */ ++ return SNMPERR_GENERR; ++ } else { ++ QUITFUN(SNMPERR_GENERR, generate_Ku_quit); ++ } + #elif NETSNMP_USE_INTERNAL_CRYPTO + #ifndef NETSNMP_DISABLE_MD5 + if (ISTRANSFORM(hashtype, HMACMD5Auth)) { +- MD5_Init(&cmd5); ++ if (!MD5_Init(&cmd5)) ++ /* MD5 not supported */ ++ return SNMPERR_GENERR; + cryptotype = TYPE_MD5; + } else + #endif +- if (ISTRANSFORM(hashtype, HMACSHA1Auth)) { +- SHA1_Init(&csha1); +- cryptotype = TYPE_SHA1; +- } else { +- return (SNMPERR_GENERR); +- } ++ if (ISTRANSFORM(hashtype, HMACSHA1Auth)) { ++ if (!SHA1_Init(&csha1)) ++ /* SHA1 not supported */ ++ return SNMPERR_GENERR; ++ cryptotype = TYPE_SHA1; ++ } else { ++ return (SNMPERR_GENERR); ++ } + #else + MDbegin(&MD); + #endif /* NETSNMP_USE_OPENSSL */ +diff -up net-snmp-5.7.2/snmplib/lcd_time.c.fips net-snmp-5.7.2/snmplib/lcd_time.c +--- net-snmp-5.7.2/snmplib/lcd_time.c.fips 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/lcd_time.c 2012-11-12 13:36:11.326657629 +0100 +@@ -505,6 +505,12 @@ hash_engineID(const u_char * engineID, u + rval = sc_hash(usmHMACMD5AuthProtocol, + sizeof(usmHMACMD5AuthProtocol) / sizeof(oid), + engineID, engineID_len, buf, &buf_len); ++ if (rval == SNMPERR_SC_NOT_CONFIGURED) { ++ /* fall back to sha1 */ ++ rval = sc_hash(usmHMACSHA1AuthProtocol, ++ sizeof(usmHMACSHA1AuthProtocol) / sizeof(oid), ++ engineID, engineID_len, buf, &buf_len); ++ } + #else + rval = sc_hash(usmHMACSHA1AuthProtocol, + sizeof(usmHMACSHA1AuthProtocol) / sizeof(oid), +diff -up net-snmp-5.7.2/snmplib/scapi.c.fips net-snmp-5.7.2/snmplib/scapi.c +--- net-snmp-5.7.2/snmplib/scapi.c.fips 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/scapi.c 2012-11-12 13:36:11.327657627 +0100 +@@ -438,6 +438,7 @@ sc_generate_keyed_hash(const oid * autht + * Returns: + * SNMPERR_SUCCESS Success. + * SNMP_SC_GENERAL_FAILURE Any error. ++ * SNMPERR_SC_NOT_CONFIGURED Hash type not supported. + */ + int + sc_hash(const oid * hashtype, size_t hashtypelen, const u_char * buf, +@@ -495,7 +496,10 @@ sc_hash(const oid * hashtype, size_t has + EVP_MD_CTX_init(cptr); + #endif + #endif +- EVP_DigestInit(cptr, hashfn); ++ if (!EVP_DigestInit(cptr, hashfn)) { ++ /* requested hash function is not available */ ++ return SNMPERR_SC_NOT_CONFIGURED; ++ } + + /** pass the data */ + EVP_DigestUpdate(cptr, buf, buf_len); diff --git a/SOURCES/net-snmp-5.7.2-hrStorage-fs.patch b/SOURCES/net-snmp-5.7.2-hrStorage-fs.patch new file mode 100644 index 0000000..f82a6eb --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-hrStorage-fs.patch @@ -0,0 +1,31 @@ +989498 - vzfs missing in hrStorage in an Virtuozzo Container +861152 - simfs missing in hrStorage in an OpenVZ container + +diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.orig net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c +--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c.orig 2013-08-12 15:38:17.602977746 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/fsys_mntent.c 2013-08-12 15:38:42.018888560 +0200 +@@ -139,6 +139,8 @@ _fsys_type( char *typename ) + !strcmp(typename, MNTTYPE_REISERFS) || + !strcmp(typename, MNTTYPE_OCFS2) || + !strcmp(typename, MNTTYPE_CVFS) || ++ !strcmp(typename, MNTTYPE_SIMFS) || ++ !strcmp(typename, MNTTYPE_VZFS) || + !strcmp(typename, MNTTYPE_LOFS)) + return NETSNMP_FS_TYPE_OTHER; + +diff -up net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.orig net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h +--- net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h.orig 2013-08-12 15:38:52.112851691 +0200 ++++ net-snmp-5.7.2/agent/mibgroup/hardware/fsys/mnttypes.h 2013-08-12 15:39:16.063764218 +0200 +@@ -142,6 +142,12 @@ + #ifndef MNTTYPE_CVFS + #define MNTTYPE_CVFS "cvfs" + #endif ++#ifndef MNTTYPE_SIMFS ++#define MNTTYPE_SIMFS "simfs" ++#endif ++#ifndef MNTTYPE_VZFS ++#define MNTTYPE_VZFS "vzfs" ++#endif + + /* + * File systems to skip diff --git a/SOURCES/net-snmp-5.7.2-kernel-threads.patch b/SOURCES/net-snmp-5.7.2-kernel-threads.patch new file mode 100644 index 0000000..b6722f6 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-kernel-threads.patch @@ -0,0 +1,41 @@ +979329 - hrSWRunTable does not show kernel threads + +commit c655fce784532a523f7db582d0cd07dee4ad7ac5 +Author: Niels Baggesen +Date: Mon Oct 22 16:25:59 2012 +0200 + + Try to better classify Linux kernel threads as hrSWRunType=Os + +diff --git a/agent/mibgroup/host/data_access/swrun_procfs_status.c b/agent/mibgroup/host/data_access/swrun_procfs_status.c +index 80182d0..61c5e3a 100644 +--- a/agent/mibgroup/host/data_access/swrun_procfs_status.c ++++ b/agent/mibgroup/host/data_access/swrun_procfs_status.c +@@ -122,11 +122,11 @@ netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags) + continue; /* file (process) probably went away */ + } + memset(buf, 0, sizeof(buf)); +- if ((cp = fgets( buf, BUFSIZ-1, fp )) == NULL) { +- fclose(fp); +- netsnmp_swrun_entry_free(entry); +- continue; +- } ++ entry->hrSWRunType = HRSWRUNTYPE_APPLICATION; ++ if ((cp = fgets( buf, sizeof(buf)-1, fp )) == NULL) { ++ entry->hrSWRunType = HRSWRUNTYPE_OPERATINGSYSTEM; ++ buf[0] = '\0'; ++ } + fclose(fp); + + /* +@@ -151,11 +151,6 @@ netsnmp_arch_swrun_container_load( netsnmp_container *container, u_int flags) + buf + entry->hrSWRunPath_len + 1); + + /* +- * XXX - No information regarding system processes vs applications +- */ +- entry->hrSWRunType = HRSWRUNTYPE_APPLICATION; +- +- /* + * {xxx} {xxx} STATUS {xxx}*10 UTIME STIME {xxx}*8 RSS + */ + snprintf( buf, BUFSIZ, "/proc/%d/stat", pid ); diff --git a/SOURCES/net-snmp-5.7.2-pie.patch b/SOURCES/net-snmp-5.7.2-pie.patch new file mode 100644 index 0000000..ee02001 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-pie.patch @@ -0,0 +1,24 @@ +diff -up net-snmp-5.7.2/agent/Makefile.in.pie net-snmp-5.7.2/agent/Makefile.in +--- net-snmp-5.7.2/agent/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/agent/Makefile.in 2012-10-18 09:45:13.298613099 +0200 +@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c + $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? + + snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) +- $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS} ++ $(LINK) $(CFLAGS) -o $@ -pie ${LAGENTOBJS} ${LDFLAGS} ${OUR_AGENT_LIBS} + + libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS) + $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@ +diff -up net-snmp-5.7.2/apps/Makefile.in.pie net-snmp-5.7.2/apps/Makefile.in +--- net-snmp-5.7.2/apps/Makefile.in.pie 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/apps/Makefile.in 2012-10-18 09:44:27.827774580 +0200 +@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX + $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS} + + snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) +- $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS} ++ $(LINK) ${CFLAGS} -o $@ -pie $(TRAPD_OBJECTS) $(INSTALLLIBS) ${LDFLAGS} ${TRAPLIBS} + + snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS) + $(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) ${LDFLAGS} ${LIBS} diff --git a/SOURCES/net-snmp-5.7.2-python-ipaddress-size.patch b/SOURCES/net-snmp-5.7.2-python-ipaddress-size.patch new file mode 100644 index 0000000..51a489f --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-python-ipaddress-size.patch @@ -0,0 +1,23 @@ +895357 - net-snmp-python adds zeros to end of IP address (IPADDR type), which is not valid + +Source: upstream commit 234158b8e84cc204cbac96e6e9be6959635404b8 + + --- a/python/netsnmp/client_intf.c ++++ a/python/netsnmp/client_intf.c +@@ -821,14 +821,14 @@ OCT: + + case TYPE_IPADDR: + vars->type = ASN_IPADDRESS; +- vars->val.integer = (long *)malloc(sizeof(long)); ++ vars->val.integer = (in_addr_t *)malloc(sizeof(in_addr_t)); + if (val) + *(vars->val.integer) = inet_addr(val); + else { + ret = FAILURE; + *(vars->val.integer) = 0; + } +- vars->val_len = sizeof(long); ++ vars->val_len = sizeof(in_addr_t); + break; + + case TYPE_OBJID: diff --git a/SOURCES/net-snmp-5.7.2-soname.patch b/SOURCES/net-snmp-5.7.2-soname.patch new file mode 100644 index 0000000..8530a5c --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-soname.patch @@ -0,0 +1,16 @@ +969061 - net-snmpd crash on time out + +We need to bump soname because net-snmp-5.7.2-agentx-disconnect-crash.patch +changes ABI (sizeof(netsnmp_agent_session)). +diff -up net-snmp-5.7.2/Makefile.top.tst net-snmp-5.7.2/Makefile.top +--- net-snmp-5.7.2/Makefile.top.tst 2013-07-12 13:54:36.646160556 +0200 ++++ net-snmp-5.7.2/Makefile.top 2013-07-12 13:54:40.678146522 +0200 +@@ -79,7 +79,7 @@ LINKCC = @LINKCC@ + # 5.3 was at 10, 5.4 is at 15, ... This leaves some room for needed + # changes for past releases if absolutely necessary. + # +-LIBCURRENT = 30 ++LIBCURRENT = 31 + LIBAGE = 0 + LIBREVISION = 2 + diff --git a/SOURCES/net-snmp-5.7.2-systemd.patch b/SOURCES/net-snmp-5.7.2-systemd.patch new file mode 100644 index 0000000..b349097 --- /dev/null +++ b/SOURCES/net-snmp-5.7.2-systemd.patch @@ -0,0 +1,1653 @@ +718183 - Provide native systemd unit file + +Gathered from following upstream git commits and backported to 5.7. + +commit 19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11 +Author: Jan Safranek +Date: Mon Aug 8 15:48:54 2011 +0200 + + CHANGES: snmpd: integrated with systemd, see README.systemd for details. + + It brings sd-daemon.c and .h directly downloaded from systemd. I've made very + few changes to it to match our NETSNMP_NO_SYSTEMD and include paths. + +commit fef6cddfdb94da1a6b1fb768af62918b80f11fd3 +Author: Jan Safranek +Date: Mon Aug 8 15:48:54 2011 +0200 + + CHANGES: snmptrapd: integrate systemd notification support. + +commit 0641e43c694c485cbbffef0556efc4641bd3ff50 +Author: Jan Safranek +Date: Mon Aug 8 15:48:54 2011 +0200 + + Add sd_find_inet_socket() and sd_find_inet_unisx() helpers into + system-specific code. This will help us to find various sockets + created by systemd much easier. + +commit 76530a89f1c8bbd0b63acce63e10d5d4812a1a16 +Author: Jan Safranek +Date: Mon Aug 8 15:48:54 2011 +0200 + + Check sockets created by systemd when opening new server sockets. + + systemd can pass sockets to our daemons during startup using LISTEN_FDS + environment variable. So check this variable when opening new listening + socket - maybe system has already opened the socket for us. + +commit bf108d7f1354f6276fc43c129963f2c49b9fc242 +Author: Jan Safranek +Date: Mon Aug 8 15:48:54 2011 +0200 + + Added sample systemd service files. + +commit 884ec488a6596380ba283d707827dd926a52e0b2 +Author: Jan Safranek +Date: Mon Aug 8 15:48:55 2011 +0200 + + Run autoheader+autoconf. + +commit 86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0 +Author: Jan Safranek +Date: Tue Aug 9 10:53:43 2011 +0200 + + Update systemd documentation and samples. + + - add socket unit for snmpd to paralelize boot + - update WantedBy in socket units as recommended by http://0pointer.de/blog/projects/socket-activation.html + - rephrase README.systemd + + +diff -up net-snmp-5.7.2/agent/snmpd.c.systemd net-snmp-5.7.2/agent/snmpd.c +--- net-snmp-5.7.2/agent/snmpd.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/agent/snmpd.c 2012-11-12 10:18:46.084369548 +0100 +@@ -164,6 +164,10 @@ typedef long fd_mask; + + #endif + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + netsnmp_feature_want(logging_file) + netsnmp_feature_want(logging_stdio) + netsnmp_feature_want(logging_syslog) +@@ -441,18 +445,26 @@ main(int argc, char *argv[]) + int agent_mode = -1; + char *pid_file = NULL; + char option_compatability[] = "-Le"; ++ int prepared_sockets = 0; + #if HAVE_GETPID + int fd; + FILE *PID; + #endif + + #ifndef WIN32 ++#ifndef NETSNMP_NO_SYSYSTEMD ++ /* check if systemd has sockets for us and don't close them */ ++ prepared_sockets = netsnmp_sd_listen_fds(0); ++#endif /* NETSNMP_NO_SYSYSTEMD */ ++ + /* + * close all non-standard file descriptors we may have + * inherited from the shell. + */ +- for (i = getdtablesize() - 1; i > 2; --i) { +- (void) close(i); ++ if (!prepared_sockets) { ++ for (i = getdtablesize() - 1; i > 2; --i) { ++ (void) close(i); ++ } + } + #endif /* #WIN32 */ + +@@ -1100,6 +1112,19 @@ main(int argc, char *argv[]) + netsnmp_addrcache_initialise(); + + /* ++ * Let systemd know we're up. ++ */ ++#ifndef NETSNMP_NO_SYSTEMD ++ netsnmp_sd_notify(1, "READY=1\n"); ++ if (prepared_sockets) ++ /* ++ * Clear the environment variable, we already processed all the sockets ++ * by now. ++ */ ++ netsnmp_sd_listen_fds(1); ++#endif ++ ++ /* + * Forever monitor the dest_port for incoming PDUs. + */ + DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n")); +diff -up net-snmp-5.7.2/apps/snmptrapd.c.systemd net-snmp-5.7.2/apps/snmptrapd.c +--- net-snmp-5.7.2/apps/snmptrapd.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/apps/snmptrapd.c 2012-11-12 10:18:46.084369548 +0100 +@@ -125,6 +125,10 @@ SOFTWARE. + + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + #ifndef BSD4_3 + #define BSD4_2 + #endif +@@ -655,15 +659,22 @@ main(int argc, char *argv[]) + int agentx_subagent = 1; + #endif + netsnmp_trapd_handler *traph; ++ int prepared_sockets = 0; + + + #ifndef WIN32 ++#ifndef NETSNMP_NO_SYSTEMD ++ /* check if systemd has sockets for us and don't close them */ ++ prepared_sockets = netsnmp_sd_listen_fds(0); ++#endif + /* + * close all non-standard file descriptors we may have + * inherited from the shell. + */ +- for (i = getdtablesize() - 1; i > 2; --i) { +- (void) close(i); ++ if (!prepared_sockets) { ++ for (i = getdtablesize() - 1; i > 2; --i) { ++ (void) close(i); ++ } + } + #endif /* #WIN32 */ + +@@ -1311,6 +1322,19 @@ main(int argc, char *argv[]) + #endif + #endif + ++ /* ++ * Let systemd know we're up. ++ */ ++#ifndef NETSNMP_NO_SYSTEMD ++ netsnmp_sd_notify(1, "READY=1\n"); ++ if (prepared_sockets) ++ /* ++ * Clear the environment variable, we already processed all the sockets ++ * by now. ++ */ ++ netsnmp_sd_listen_fds(1); ++#endif ++ + #ifdef WIN32SERVICE + trapd_status = SNMPTRAPD_RUNNING; + #endif +diff -up net-snmp-5.7.2/configure.d/config_modules_lib.systemd net-snmp-5.7.2/configure.d/config_modules_lib +--- net-snmp-5.7.2/configure.d/config_modules_lib.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/configure.d/config_modules_lib 2012-11-12 10:18:46.085369546 +0100 +@@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" + other_ftobjs_list="$other_ftobjs_list winpipe.ft" + fi + ++# Linux systemd ++if test "x$with_systemd" == "xyes"; then ++ other_src_list="$other_src_list sd-daemon.c" ++ other_objs_list="$other_objs_list sd-daemon.o" ++ other_lobjs_list="$other_lobjs_list sd-daemon.lo" ++ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" ++fi ++ + AC_SUBST(other_src_list) + AC_SUBST(other_objs_list) + AC_SUBST(other_lobjs_list) +diff -up net-snmp-5.7.2/configure.d/config_project_with_enable.systemd net-snmp-5.7.2/configure.d/config_project_with_enable +--- net-snmp-5.7.2/configure.d/config_project_with_enable.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/configure.d/config_project_with_enable 2012-11-12 10:18:46.086369544 +0100 +@@ -690,6 +690,15 @@ if test "x$with_dummy_values" != "xyes"; + data for]) + fi + ++NETSNMP_ARG_WITH(systemd, ++[ --with-systemd Provide systemd support. See README.systemd ++ for details.]) ++# Define unless specifically suppressed (i.e., option defaults to false). ++if test "x$with_systemd" != "xyes"; then ++ AC_DEFINE(NETSNMP_NO_SYSTEMD, 1, ++ [If you don't want to integrate with systemd.]) ++fi ++ + NETSNMP_ARG_ENABLE(set-support, + [ --disable-set-support Do not allow SNMP set requests.]) + if test "x$enable_set_support" = "xno"; then +diff -up net-snmp-5.7.2/configure.systemd net-snmp-5.7.2/configure +--- net-snmp-5.7.2/configure.systemd 2012-10-10 00:35:37.000000000 +0200 ++++ net-snmp-5.7.2/configure 2012-11-12 10:18:46.099369517 +0100 +@@ -950,6 +950,8 @@ with_kmem_usage + enable_kmem_usage + with_dummy_values + enable_dummy_values ++with_systemd ++enable_systemd + enable_set_support + with_set_support + with_sys_contact +@@ -1866,6 +1868,8 @@ Configuring the agent: + This is technically not compliant with the + SNMP specifications, but was how the agent + operated for versions < 4.0. ++ --with-systemd Provide systemd support. See README.systemd ++ for details. + --with-sys-contact="who@where" Default system contact. + (Default: LOGIN@DOMAINNAME) + --with-sys-location="location" Default system location. +@@ -4397,6 +4401,24 @@ $as_echo "#define NETSNMP_NO_DUMMY_VALUE + + fi + ++ ++# Check whether --with-systemd was given. ++if test "${with_systemd+set}" = set; then : ++ withval=$with_systemd; ++fi ++ ++ # Check whether --enable-systemd was given. ++if test "${enable_systemd+set}" = set; then : ++ enableval=$enable_systemd; as_fn_error $? "Invalid option. Use --with-systemd/--without-systemd instead" "$LINENO" 5 ++fi ++ ++# Define unless specifically suppressed (i.e., option defaults to false). ++if test "x$with_systemd" != "xyes"; then ++ ++$as_echo "#define NETSNMP_NO_SYSTEMD 1" >>confdefs.h ++ ++fi ++ + # Check whether --enable-set-support was given. + if test "${enable_set_support+set}" = set; then : + enableval=$enable_set_support; +@@ -18239,6 +18261,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" + other_ftobjs_list="$other_ftobjs_list winpipe.ft" + fi + ++# Linux systemd ++if test "x$with_systemd" == "xyes"; then ++ other_src_list="$other_src_list sd-daemon.c" ++ other_objs_list="$other_objs_list sd-daemon.o" ++ other_lobjs_list="$other_lobjs_list sd-daemon.lo" ++ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" ++fi ++ + + + +diff -up net-snmp-5.7.2/dist/snmpd.service.systemd net-snmp-5.7.2/dist/snmpd.service +--- net-snmp-5.7.2/dist/snmpd.service.systemd 2012-11-12 10:18:46.104369507 +0100 ++++ net-snmp-5.7.2/dist/snmpd.service 2012-11-12 10:18:46.104369507 +0100 +@@ -0,0 +1,18 @@ ++# ++# SNMP agent service file for systemd ++# ++# ++# The service should be enabled, i.e. snmpd should start during machine boot. ++# Socket activation shall not be used. See README.systemd for details. ++ ++[Unit] ++Description=Simple Network Management Protocol (SNMP) daemon. ++After=syslog.target network.target ++ ++[Service] ++# Type=notify is also supported. It should be set when snmpd.socket is not used. ++Type=simple ++ExecStart=/usr/sbin/snmpd -f ++ ++[Install] ++WantedBy=multi-user.target +diff -up net-snmp-5.7.2/dist/snmpd.socket.systemd net-snmp-5.7.2/dist/snmpd.socket +--- net-snmp-5.7.2/dist/snmpd.socket.systemd 2012-11-12 10:18:46.104369507 +0100 ++++ net-snmp-5.7.2/dist/snmpd.socket 2012-11-12 10:18:46.104369507 +0100 +@@ -0,0 +1,17 @@ ++[Unit] ++Description=Socket listening for SNMP and AgentX messages ++ ++[Socket] ++ListenDatagram=0.0.0.0:161 ++# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. ++# It must match listening addresses/ports defined in snmpd.service ++# or snmpd.conf. ++# ListenStream=0.0.0.0:161 ++# ListenDatagram=[::]:161 ++# ListenStream=[::]:161 ++# ++# Uncomment AgentX socket if snmpd.conf enables AgentX protocol. ++# ListenStream=/var/agentx/master ++ ++[Install] ++WantedBy=sockets.target +diff -up net-snmp-5.7.2/dist/snmptrapd.service.systemd net-snmp-5.7.2/dist/snmptrapd.service +--- net-snmp-5.7.2/dist/snmptrapd.service.systemd 2012-11-12 10:18:46.105369505 +0100 ++++ net-snmp-5.7.2/dist/snmptrapd.service 2012-11-12 10:18:46.105369505 +0100 +@@ -0,0 +1,16 @@ ++# ++# SNMP trap-processing service file for systemd ++# ++ ++[Unit] ++Description=Simple Network Management Protocol (SNMP) Trap daemon. ++After=syslog.target network.target ++ ++[Service] ++# Type=notify is also supported. It should be set when snmptrapd.socket is not ++# used. ++Type=simple ++ExecStart=/usr/sbin/snmptrapd -f ++ ++[Install] ++WantedBy=multi-user.target +diff -up net-snmp-5.7.2/dist/snmptrapd.socket.systemd net-snmp-5.7.2/dist/snmptrapd.socket +--- net-snmp-5.7.2/dist/snmptrapd.socket.systemd 2012-11-12 10:18:46.105369505 +0100 ++++ net-snmp-5.7.2/dist/snmptrapd.socket 2012-11-12 10:18:46.105369505 +0100 +@@ -0,0 +1,14 @@ ++[Unit] ++Description=Socket listening for SNMP trap messages ++ ++[Socket] ++ListenDatagram=0.0.0.0:162 ++# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. ++# It must match listening addresses/ports defined in snmptrapd.service ++# or snmptrapd.conf. ++# ListenStream=0.0.0.0:162 ++# ListenDatagram=[::]:162 ++# ListenStream=[::]:162 ++ ++[Install] ++WantedBy=sockets.target +diff -up net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h.systemd net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h +--- net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h.systemd 2012-11-12 10:18:46.106369503 +0100 ++++ net-snmp-5.7.2/include/net-snmp/library/sd-daemon.h 2012-11-12 10:18:46.106369503 +0100 +@@ -0,0 +1,286 @@ ++/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ ++ ++#ifndef SNMPD_SD_DAEMON_H ++#define SNMPD_SD_DAEMON_H ++ ++/*** ++ Copyright 2010 Lennart Poettering ++ ++ Permission is hereby granted, free of charge, to any person ++ obtaining a copy of this software and associated documentation files ++ (the "Software"), to deal in the Software without restriction, ++ including without limitation the rights to use, copy, modify, merge, ++ publish, distribute, sublicense, and/or sell copies of the Software, ++ and to permit persons to whom the Software is furnished to do so, ++ subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be ++ included in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ++ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ SOFTWARE. ++***/ ++ ++#include ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* ++ Reference implementation of a few systemd related interfaces for ++ writing daemons. These interfaces are trivial to implement. To ++ simplify porting we provide this reference implementation. ++ Applications are welcome to reimplement the algorithms described ++ here if they do not want to include these two source files. ++ ++ The following functionality is provided: ++ ++ - Support for logging with log levels on stderr ++ - File descriptor passing for socket-based activation ++ - Daemon startup and status notification ++ - Detection of systemd boots ++ ++ You may compile this with -DDISABLE_SYSTEMD to disable systemd ++ support. This makes all those calls NOPs that are directly related to ++ systemd (i.e. only sd_is_xxx() will stay useful). ++ ++ Since this is drop-in code we don't want any of our symbols to be ++ exported in any case. Hence we declare hidden visibility for all of ++ them. ++ ++ You may find an up-to-date version of these source files online: ++ ++ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h ++ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c ++ ++ This should compile on non-Linux systems, too, but with the ++ exception of the sd_is_xxx() calls all functions will become NOPs. ++ ++ See sd-daemon(7) for more information. ++*/ ++ ++#ifndef _sd_printf_attr_ ++#if __GNUC__ >= 4 ++#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) ++#else ++#define _sd_printf_attr_(a,b) ++#endif ++#endif ++ ++/* ++ Log levels for usage on stderr: ++ ++ fprintf(stderr, SD_NOTICE "Hello World!\n"); ++ ++ This is similar to printk() usage in the kernel. ++*/ ++#define SD_EMERG "<0>" /* system is unusable */ ++#define SD_ALERT "<1>" /* action must be taken immediately */ ++#define SD_CRIT "<2>" /* critical conditions */ ++#define SD_ERR "<3>" /* error conditions */ ++#define SD_WARNING "<4>" /* warning conditions */ ++#define SD_NOTICE "<5>" /* normal but significant condition */ ++#define SD_INFO "<6>" /* informational */ ++#define SD_DEBUG "<7>" /* debug-level messages */ ++ ++/* The first passed file descriptor is fd 3 */ ++#define SD_LISTEN_FDS_START 3 ++ ++/* ++ Returns how many file descriptors have been passed, or a negative ++ errno code on failure. Optionally, removes the $LISTEN_FDS and ++ $LISTEN_PID file descriptors from the environment (recommended, but ++ problematic in threaded environments). If r is the return value of ++ this function you'll find the file descriptors passed as fds ++ SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative ++ errno style error code on failure. This function call ensures that ++ the FD_CLOEXEC flag is set for the passed file descriptors, to make ++ sure they are not passed on to child processes. If FD_CLOEXEC shall ++ not be set, the caller needs to unset it after this call for all file ++ descriptors that are used. ++ ++ See sd_listen_fds(3) for more information. ++*/ ++int netsnmp_sd_listen_fds(int unset_environment); ++ ++/* ++ Helper call for identifying a passed file descriptor. Returns 1 if ++ the file descriptor is a FIFO in the file system stored under the ++ specified path, 0 otherwise. If path is NULL a path name check will ++ not be done and the call only verifies if the file descriptor ++ refers to a FIFO. Returns a negative errno style error code on ++ failure. ++ ++ See sd_is_fifo(3) for more information. ++*/ ++int netsnmp_sd_is_fifo(int fd, const char *path); ++ ++/* ++ Helper call for identifying a passed file descriptor. Returns 1 if ++ the file descriptor is a special character device on the file ++ system stored under the specified path, 0 otherwise. ++ If path is NULL a path name check will not be done and the call ++ only verifies if the file descriptor refers to a special character. ++ Returns a negative errno style error code on failure. ++ ++ See sd_is_special(3) for more information. ++*/ ++int netsnmp_sd_is_special(int fd, const char *path); ++ ++/* ++ Helper call for identifying a passed file descriptor. Returns 1 if ++ the file descriptor is a socket of the specified family (AF_INET, ++ ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If ++ family is 0 a socket family check will not be done. If type is 0 a ++ socket type check will not be done and the call only verifies if ++ the file descriptor refers to a socket. If listening is > 0 it is ++ verified that the socket is in listening mode. (i.e. listen() has ++ been called) If listening is == 0 it is verified that the socket is ++ not in listening mode. If listening is < 0 no listening mode check ++ is done. Returns a negative errno style error code on failure. ++ ++ See sd_is_socket(3) for more information. ++*/ ++int netsnmp_sd_is_socket(int fd, int family, int type, int listening); ++ ++/* ++ Helper call for identifying a passed file descriptor. Returns 1 if ++ the file descriptor is an Internet socket, of the specified family ++ (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, ++ SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version ++ check is not done. If type is 0 a socket type check will not be ++ done. If port is 0 a socket port check will not be done. The ++ listening flag is used the same way as in sd_is_socket(). Returns a ++ negative errno style error code on failure. ++ ++ See sd_is_socket_inet(3) for more information. ++*/ ++int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); ++ ++/* ++ Helper call for identifying a passed file descriptor. Returns 1 if ++ the file descriptor is an AF_UNIX socket of the specified type ++ (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 ++ a socket type check will not be done. If path is NULL a socket path ++ check will not be done. For normal AF_UNIX sockets set length to ++ 0. For abstract namespace sockets set length to the length of the ++ socket name (including the initial 0 byte), and pass the full ++ socket path in path (including the initial 0 byte). The listening ++ flag is used the same way as in sd_is_socket(). Returns a negative ++ errno style error code on failure. ++ ++ See sd_is_socket_unix(3) for more information. ++*/ ++int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); ++ ++/* ++ Informs systemd about changed daemon state. This takes a number of ++ newline separated environment-style variable assignments in a ++ string. The following variables are known: ++ ++ READY=1 Tells systemd that daemon startup is finished (only ++ relevant for services of Type=notify). The passed ++ argument is a boolean "1" or "0". Since there is ++ little value in signaling non-readiness the only ++ value daemons should send is "READY=1". ++ ++ STATUS=... Passes a single-line status string back to systemd ++ that describes the daemon state. This is free-from ++ and can be used for various purposes: general state ++ feedback, fsck-like programs could pass completion ++ percentages and failing programs could pass a human ++ readable error message. Example: "STATUS=Completed ++ 66% of file system check..." ++ ++ ERRNO=... If a daemon fails, the errno-style error code, ++ formatted as string. Example: "ERRNO=2" for ENOENT. ++ ++ BUSERROR=... If a daemon fails, the D-Bus error-style error ++ code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" ++ ++ MAINPID=... The main pid of a daemon, in case systemd did not ++ fork off the process itself. Example: "MAINPID=4711" ++ ++ Daemons can choose to send additional variables. However, it is ++ recommended to prefix variable names not listed above with X_. ++ ++ Returns a negative errno-style error code on failure. Returns > 0 ++ if systemd could be notified, 0 if it couldn't possibly because ++ systemd is not running. ++ ++ Example: When a daemon finished starting up, it could issue this ++ call to notify systemd about it: ++ ++ sd_notify(0, "READY=1"); ++ ++ See sd_notifyf() for more complete examples. ++ ++ See sd_notify(3) for more information. ++*/ ++int netsnmp_sd_notify(int unset_environment, const char *state); ++ ++/* ++ Similar to sd_notify() but takes a format string. ++ ++ Example 1: A daemon could send the following after initialization: ++ ++ sd_notifyf(0, "READY=1\n" ++ "STATUS=Processing requests...\n" ++ "MAINPID=%lu", ++ (unsigned long) getpid()); ++ ++ Example 2: A daemon could send the following shortly before ++ exiting, on failure: ++ ++ sd_notifyf(0, "STATUS=Failed to start up: %s\n" ++ "ERRNO=%i", ++ strerror(errno), ++ errno); ++ ++ See sd_notifyf(3) for more information. ++*/ ++int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); ++ ++/* ++ Returns > 0 if the system was booted with systemd. Returns < 0 on ++ error. Returns 0 if the system was not booted with systemd. Note ++ that all of the functions above handle non-systemd boots just ++ fine. You should NOT protect them with a call to this function. Also ++ note that this function checks whether the system, not the user ++ session is controlled by systemd. However the functions above work ++ for both user and system services. ++ ++ See sd_booted(3) for more information. ++*/ ++int netsnmp_sd_booted(void); ++ ++/** ++ * Find an socket with given parameters. See man sd_is_socket_inet for ++ * description of the arguments. ++ * ++ * Returns the file descriptor if it is found, 0 otherwise. ++ */ ++int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port); ++ ++/** ++ * Find an unix socket with given parameters. See man sd_is_socket_unix for ++ * description of the arguments. ++ * ++ * Returns the file descriptor if it is found, 0 otherwise. ++ */ ++int ++netsnmp_sd_find_unix_socket(int type, int listening, const char *path); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* SNMPD_SD_DAEMON_H */ +diff -up net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in.systemd net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in +--- net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/include/net-snmp/net-snmp-config.h.in 2012-11-12 10:18:46.107369501 +0100 +@@ -1389,6 +1389,9 @@ + /* If you don't have root access don't exit upon kmem errors */ + #undef NETSNMP_NO_ROOT_ACCESS + ++/* If you don't want to integrate with systemd. */ ++#undef NETSNMP_NO_SYSTEMD ++ + /* Define if you want to remove all SET/write access from the code */ + #undef NETSNMP_NO_WRITE_SUPPORT + +diff -up net-snmp-5.7.2/README.systemd.systemd net-snmp-5.7.2/README.systemd +--- net-snmp-5.7.2/README.systemd.systemd 2012-11-12 10:18:46.108369499 +0100 ++++ net-snmp-5.7.2/README.systemd 2012-11-12 10:18:46.108369499 +0100 +@@ -0,0 +1,41 @@ ++README.systemd ++-------------- ++Net-SNMP provides two daemons, which support systemd system manager. ++See http://www.freedesktop.org/wiki/Software/systemd to learn how ++systemd works. Both socket activation and notification is supported by these ++daemons. ++ ++To enable systemd support, the sources must be compiled with ++--with-systemd configure option. ++ ++snmpd - The SNMP agent ++---------------------- ++Socket activation od snmpd daemon is implemented, but it's discouraged. ++The reason is simple - snmpd not only listens and processes SNMP requests ++from network, but also gathers system statistics counters, sends traps and ++communicates with subagents. It even opens few netlink sockets. ++ ++In other words, snmpd should run from system start to properly work. ++This can be done in two ways: ++1) either as snmpd service unit with 'Type=notification' and without a socket ++ unit ++2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit ++ and the snmpd service enabled. This way systemd creates the snmpd listening ++ socket early during boot and passes the sockets to snmpd slightly later ++ (but still during machine boot). This way systemd can paralelize start of ++ services, which depend on snmpd. Admins must adjust the socket file manually, ++ depending if the snmpd support AgentX, IPv6, SMUX etc. ++ ++snmpd should be started with '-f' command line parameter to disable forking - ++systemd does that for us automatically. ++ ++ ++snmptrapd - The trap processing daemon ++-------------------------------------- ++snmptrapd supports full socket activation and also notification (if needed). ++Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services ++will work. Again, '-f' parameter should be provided on snmptrapd command line. ++ ++If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should ++start during boot and not after first SNMP trap arrives. Same rules as for snmpd ++applies then. +\ No newline at end of file +diff -up net-snmp-5.7.2/snmplib/sd-daemon.c.systemd net-snmp-5.7.2/snmplib/sd-daemon.c +--- net-snmp-5.7.2/snmplib/sd-daemon.c.systemd 2012-11-12 10:18:46.109369497 +0100 ++++ net-snmp-5.7.2/snmplib/sd-daemon.c 2012-11-12 10:18:46.109369497 +0100 +@@ -0,0 +1,532 @@ ++/* ++ * Systemd integration parts. ++ * ++ * Most of this file is directly copied from systemd sources. ++ * Changes: ++ * - all functions were renamed to have netsnmp_ prefix ++ * - includes were changed to match Net-SNMP style. ++ * - removed gcc export macros ++ * - removed POSIX message queues ++ */ ++ ++#include ++#include ++#include ++#include ++ ++#ifndef NETSNMP_NO_SYSTEMD ++ ++/*** ++ Copyright 2010 Lennart Poettering ++ ++ Permission is hereby granted, free of charge, to any person ++ obtaining a copy of this software and associated documentation files ++ (the "Software"), to deal in the Software without restriction, ++ including without limitation the rights to use, copy, modify, merge, ++ publish, distribute, sublicense, and/or sell copies of the Software, ++ and to permit persons to whom the Software is furnished to do so, ++ subject to the following conditions: ++ ++ The above copyright notice and this permission notice shall be ++ included in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ++ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ SOFTWARE. ++***/ ++ ++#ifndef _GNU_SOURCE ++#define _GNU_SOURCE ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++int netsnmp_sd_listen_fds(int unset_environment) { ++ ++ int r, fd; ++ const char *e; ++ char *p = NULL; ++ unsigned long l; ++ ++ if (!(e = getenv("LISTEN_PID"))) { ++ r = 0; ++ goto finish; ++ } ++ ++ errno = 0; ++ l = strtoul(e, &p, 10); ++ ++ if (errno != 0) { ++ r = -errno; ++ goto finish; ++ } ++ ++ if (!p || *p || l <= 0) { ++ r = -EINVAL; ++ goto finish; ++ } ++ ++ /* Is this for us? */ ++ if (getpid() != (pid_t) l) { ++ r = 0; ++ goto finish; ++ } ++ ++ if (!(e = getenv("LISTEN_FDS"))) { ++ r = 0; ++ goto finish; ++ } ++ ++ errno = 0; ++ l = strtoul(e, &p, 10); ++ ++ if (errno != 0) { ++ r = -errno; ++ goto finish; ++ } ++ ++ if (!p || *p) { ++ r = -EINVAL; ++ goto finish; ++ } ++ ++ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { ++ int flags; ++ ++ if ((flags = fcntl(fd, F_GETFD)) < 0) { ++ r = -errno; ++ goto finish; ++ } ++ ++ if (flags & FD_CLOEXEC) ++ continue; ++ ++ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { ++ r = -errno; ++ goto finish; ++ } ++ } ++ ++ r = (int) l; ++ ++finish: ++ if (unset_environment) { ++ unsetenv("LISTEN_PID"); ++ unsetenv("LISTEN_FDS"); ++ } ++ ++ return r; ++} ++ ++int netsnmp_sd_is_fifo(int fd, const char *path) { ++ struct stat st_fd; ++ ++ if (fd < 0) ++ return -EINVAL; ++ ++ memset(&st_fd, 0, sizeof(st_fd)); ++ if (fstat(fd, &st_fd) < 0) ++ return -errno; ++ ++ if (!S_ISFIFO(st_fd.st_mode)) ++ return 0; ++ ++ if (path) { ++ struct stat st_path; ++ ++ memset(&st_path, 0, sizeof(st_path)); ++ if (stat(path, &st_path) < 0) { ++ ++ if (errno == ENOENT || errno == ENOTDIR) ++ return 0; ++ ++ return -errno; ++ } ++ ++ return ++ st_path.st_dev == st_fd.st_dev && ++ st_path.st_ino == st_fd.st_ino; ++ } ++ ++ return 1; ++} ++ ++int netsnmp_sd_is_special(int fd, const char *path) { ++ struct stat st_fd; ++ ++ if (fd < 0) ++ return -EINVAL; ++ ++ if (fstat(fd, &st_fd) < 0) ++ return -errno; ++ ++ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) ++ return 0; ++ ++ if (path) { ++ struct stat st_path; ++ ++ if (stat(path, &st_path) < 0) { ++ ++ if (errno == ENOENT || errno == ENOTDIR) ++ return 0; ++ ++ return -errno; ++ } ++ ++ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) ++ return ++ st_path.st_dev == st_fd.st_dev && ++ st_path.st_ino == st_fd.st_ino; ++ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) ++ return st_path.st_rdev == st_fd.st_rdev; ++ else ++ return 0; ++ } ++ ++ return 1; ++} ++ ++static int sd_is_socket_internal(int fd, int type, int listening) { ++ struct stat st_fd; ++ ++ if (fd < 0 || type < 0) ++ return -EINVAL; ++ ++ if (fstat(fd, &st_fd) < 0) ++ return -errno; ++ ++ if (!S_ISSOCK(st_fd.st_mode)) ++ return 0; ++ ++ if (type != 0) { ++ int other_type = 0; ++ socklen_t l = sizeof(other_type); ++ ++ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) ++ return -errno; ++ ++ if (l != sizeof(other_type)) ++ return -EINVAL; ++ ++ if (other_type != type) ++ return 0; ++ } ++ ++ if (listening >= 0) { ++ int accepting = 0; ++ socklen_t l = sizeof(accepting); ++ ++ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) ++ return -errno; ++ ++ if (l != sizeof(accepting)) ++ return -EINVAL; ++ ++ if (!accepting != !listening) ++ return 0; ++ } ++ ++ return 1; ++} ++ ++union sockaddr_union { ++ struct sockaddr sa; ++ struct sockaddr_in in4; ++ struct sockaddr_in6 in6; ++ struct sockaddr_un un; ++ struct sockaddr_storage storage; ++}; ++ ++int netsnmp_sd_is_socket(int fd, int family, int type, int listening) { ++ int r; ++ ++ if (family < 0) ++ return -EINVAL; ++ ++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) ++ return r; ++ ++ if (family > 0) { ++ union sockaddr_union sockaddr; ++ socklen_t l; ++ ++ memset(&sockaddr, 0, sizeof(sockaddr)); ++ l = sizeof(sockaddr); ++ ++ if (getsockname(fd, &sockaddr.sa, &l) < 0) ++ return -errno; ++ ++ if (l < sizeof(sa_family_t)) ++ return -EINVAL; ++ ++ return sockaddr.sa.sa_family == family; ++ } ++ ++ return 1; ++} ++ ++int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { ++ union sockaddr_union sockaddr; ++ socklen_t l; ++ int r; ++ ++ if (family != 0 && family != AF_INET && family != AF_INET6) ++ return -EINVAL; ++ ++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) ++ return r; ++ ++ memset(&sockaddr, 0, sizeof(sockaddr)); ++ l = sizeof(sockaddr); ++ ++ if (getsockname(fd, &sockaddr.sa, &l) < 0) ++ return -errno; ++ ++ if (l < sizeof(sa_family_t)) ++ return -EINVAL; ++ ++ if (sockaddr.sa.sa_family != AF_INET && ++ sockaddr.sa.sa_family != AF_INET6) ++ return 0; ++ ++ if (family > 0) ++ if (sockaddr.sa.sa_family != family) ++ return 0; ++ ++ if (port > 0) { ++ if (sockaddr.sa.sa_family == AF_INET) { ++ if (l < sizeof(struct sockaddr_in)) ++ return -EINVAL; ++ ++ return htons(port) == sockaddr.in4.sin_port; ++ } else { ++ if (l < sizeof(struct sockaddr_in6)) ++ return -EINVAL; ++ ++ return htons(port) == sockaddr.in6.sin6_port; ++ } ++ } ++ ++ return 1; ++} ++ ++int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { ++ union sockaddr_union sockaddr; ++ socklen_t l; ++ int r; ++ ++ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) ++ return r; ++ ++ memset(&sockaddr, 0, sizeof(sockaddr)); ++ l = sizeof(sockaddr); ++ ++ if (getsockname(fd, &sockaddr.sa, &l) < 0) ++ return -errno; ++ ++ if (l < sizeof(sa_family_t)) ++ return -EINVAL; ++ ++ if (sockaddr.sa.sa_family != AF_UNIX) ++ return 0; ++ ++ if (path) { ++ if (length <= 0) ++ length = strlen(path); ++ ++ if (length <= 0) ++ /* Unnamed socket */ ++ return l == offsetof(struct sockaddr_un, sun_path); ++ ++ if (path[0]) ++ /* Normal path socket */ ++ return ++ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && ++ memcmp(path, sockaddr.un.sun_path, length+1) == 0; ++ else ++ /* Abstract namespace socket */ ++ return ++ (l == offsetof(struct sockaddr_un, sun_path) + length) && ++ memcmp(path, sockaddr.un.sun_path, length) == 0; ++ } ++ ++ return 1; ++} ++ ++int netsnmp_sd_notify(int unset_environment, const char *state) { ++ int fd = -1, r; ++ struct msghdr msghdr; ++ struct iovec iovec; ++ union sockaddr_union sockaddr; ++ const char *e; ++ ++ if (!state) { ++ r = -EINVAL; ++ goto finish; ++ } ++ ++ if (!(e = getenv("NOTIFY_SOCKET"))) ++ return 0; ++ ++ /* Must be an abstract socket, or an absolute path */ ++ if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { ++ r = -EINVAL; ++ goto finish; ++ } ++ ++ if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { ++ r = -errno; ++ goto finish; ++ } ++ ++ memset(&sockaddr, 0, sizeof(sockaddr)); ++ sockaddr.sa.sa_family = AF_UNIX; ++ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); ++ ++ if (sockaddr.un.sun_path[0] == '@') ++ sockaddr.un.sun_path[0] = 0; ++ ++ memset(&iovec, 0, sizeof(iovec)); ++ iovec.iov_base = (char *)state; ++ iovec.iov_len = strlen(state); ++ ++ memset(&msghdr, 0, sizeof(msghdr)); ++ msghdr.msg_name = &sockaddr; ++ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); ++ ++ if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) ++ msghdr.msg_namelen = sizeof(struct sockaddr_un); ++ ++ msghdr.msg_iov = &iovec; ++ msghdr.msg_iovlen = 1; ++ ++ if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { ++ r = -errno; ++ goto finish; ++ } ++ ++ r = 1; ++ ++finish: ++ if (unset_environment) ++ unsetenv("NOTIFY_SOCKET"); ++ ++ if (fd >= 0) ++ close(fd); ++ ++ return r; ++} ++ ++int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) { ++ va_list ap; ++ char *p = NULL; ++ int r; ++ ++ va_start(ap, format); ++ r = vasprintf(&p, format, ap); ++ va_end(ap); ++ ++ if (r < 0 || !p) ++ return -ENOMEM; ++ ++ r = netsnmp_sd_notify(unset_environment, p); ++ free(p); ++ ++ return r; ++} ++ ++int netsnmp_sd_booted(void) { ++ struct stat a, b; ++ ++ /* We simply test whether the systemd cgroup hierarchy is ++ * mounted */ ++ ++ if (lstat("/sys/fs/cgroup", &a) < 0) ++ return 0; ++ ++ if (lstat("/sys/fs/cgroup/systemd", &b) < 0) ++ return 0; ++ ++ return a.st_dev != b.st_dev; ++} ++ ++/* End of original sd-daemon.c from systemd sources */ ++ ++int ++netsnmp_sd_find_inet_socket(int family, int type, int listening, int port) ++{ ++ int count, fd; ++ ++ count = netsnmp_sd_listen_fds(0); ++ if (count <= 0) { ++ DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n")); ++ return 0; ++ } ++ DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n", ++ count)); ++ ++ for (fd = 3; fd < 3+count; fd++) { ++ int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port); ++ if (rc < 0) ++ DEBUGMSGTL(("systemd:find_inet_socket", ++ "sd_is_socket_inet error: %d\n", rc)); ++ if (rc > 0) { ++ DEBUGMSGTL(("systemd:find_inet_socket", ++ "Found the socket in LISTEN_FDS\n")); ++ return fd; ++ } ++ } ++ DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n")); ++ return 0; ++} ++ ++int ++netsnmp_sd_find_unix_socket(int type, int listening, const char *path) ++{ ++ int count, fd; ++ ++ count = netsnmp_sd_listen_fds(0); ++ if (count <= 0) { ++ DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n")); ++ return 0; ++ } ++ DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n", ++ count)); ++ ++ for (fd = 3; fd < 3+count; fd++) { ++ int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0); ++ if (rc < 0) ++ DEBUGMSGTL(("systemd:find_unix_socket", ++ "netsnmp_sd_is_socket_unix error: %d\n", rc)); ++ if (rc > 0) { ++ DEBUGMSGTL(("systemd:find_unix_socket", ++ "Found the socket in LISTEN_FDS\n")); ++ return fd; ++ } ++ } ++ DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n")); ++ return 0; ++} ++ ++#endif /* ! NETSNMP_NO_SYSTEMD */ +diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c +--- net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/transports/snmpTCPDomain.c 2012-11-12 10:19:41.767217067 +0100 +@@ -43,6 +43,10 @@ + #include + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + /* + * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c + * and perl/agent/agent.xs +@@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in + netsnmp_transport *t = NULL; + netsnmp_udp_addr_pair *addr_pair = NULL; + int rc = 0; ++ int socket_initialized = 0; + + #ifdef NETSNMP_NO_LISTEN_SUPPORT + if (local) +@@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in + t->domain_length = + sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]); + +- t->sock = socket(PF_INET, SOCK_STREAM, 0); ++#ifndef NETSNMP_NO_SYSTEMD ++ /* ++ * Maybe the socket was already provided by systemd... ++ */ ++ if (local) { ++ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1, ++ ntohs(addr->sin_port)); ++ if (t->sock) ++ socket_initialized = 1; ++ } ++#endif ++ if (!socket_initialized) ++ t->sock = socket(PF_INET, SOCK_STREAM, 0); + if (t->sock < 0) { + netsnmp_transport_free(t); + return NULL; +@@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in + setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, + sizeof(opt)); + +- rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } + + /* +@@ -235,12 +254,13 @@ netsnmp_tcp_transport(struct sockaddr_in + /* + * Now sit here and wait for connections to arrive. + */ +- +- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } + + /* +diff -up net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c +--- net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/transports/snmpTCPIPv6Domain.c 2012-11-12 10:20:32.019078971 +0100 +@@ -49,6 +49,10 @@ + #include + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + #include "inet_ntop.h" + + oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 }; +@@ -140,6 +144,7 @@ netsnmp_tcp6_transport(struct sockaddr_i + { + netsnmp_transport *t = NULL; + int rc = 0; ++ int socket_initialized = 0; + + #ifdef NETSNMP_NO_LISTEN_SUPPORT + if (local) +@@ -174,7 +179,19 @@ netsnmp_tcp6_transport(struct sockaddr_i + t->domain = netsnmp_TCPIPv6Domain; + t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid); + +- t->sock = socket(PF_INET6, SOCK_STREAM, 0); ++#ifndef NETSNMP_NO_SYSTEMD ++ /* ++ * Maybe the socket was already provided by systemd... ++ */ ++ if (local) { ++ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1, ++ ntohs(addr->sin6_port)); ++ if (t->sock) ++ socket_initialized = 1; ++ } ++#endif ++ if (!socket_initialized) ++ t->sock = socket(PF_INET6, SOCK_STREAM, 0); + if (t->sock < 0) { + netsnmp_transport_free(t); + return NULL; +@@ -220,12 +237,14 @@ netsnmp_tcp6_transport(struct sockaddr_i + + setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt)); + +- rc = bind(t->sock, (struct sockaddr *) addr, +- sizeof(struct sockaddr_in6)); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = bind(t->sock, (struct sockaddr *) addr, ++ sizeof(struct sockaddr_in6)); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } + + /* +@@ -242,11 +261,13 @@ netsnmp_tcp6_transport(struct sockaddr_i + * Now sit here and wait for connections to arrive. + */ + +- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } + + /* +diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c +--- net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/transports/snmpUDPIPv4BaseDomain.c 2012-11-12 10:22:30.279750750 +0100 +@@ -40,6 +40,10 @@ + + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + #if (defined(linux) && defined(IP_PKTINFO)) \ + || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \ + && HAVE_STRUCT_MSGHDR_MSG_FLAGS +@@ -67,6 +71,7 @@ netsnmp_udpipv4base_transport(struct soc + char *client_socket = NULL; + netsnmp_indexed_addr_pair addr_pair; + socklen_t local_addr_len; ++ int socket_initialized = 0; + + #ifdef NETSNMP_NO_LISTEN_SUPPORT + if (local) +@@ -91,7 +96,20 @@ netsnmp_udpipv4base_transport(struct soc + free(str); + } + +- t->sock = socket(PF_INET, SOCK_DGRAM, 0); ++#ifndef NETSNMP_NO_SYSTEMD ++ /* ++ * Maybe the socket was already provided by systemd... ++ */ ++ if (local) { ++ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1, ++ ntohs(addr->sin_port)); ++ if (t->sock) ++ socket_initialized = 1; ++ } ++#endif ++ if (!socket_initialized) ++ t->sock = socket(PF_INET, SOCK_DGRAM, 0); ++ + DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local)); + if (t->sock < 0) { + netsnmp_transport_free(t); +@@ -141,13 +159,15 @@ netsnmp_udpipv4base_transport(struct soc + DEBUGMSGTL(("netsnmp_udp", "set IP_RECVDSTADDR\n")); + } + #endif +- rc = bind(t->sock, (struct sockaddr *) addr, +- sizeof(struct sockaddr)); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; +- } ++ if (!socket_initialized) { ++ rc = bind(t->sock, (struct sockaddr *) addr, ++ sizeof(struct sockaddr)); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } ++ } + t->data = NULL; + t->data_length = 0; + #else /* NETSNMP_NO_LISTEN_SUPPORT */ +diff -up net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c +--- net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/transports/snmpUDPIPv6Domain.c 2012-11-12 10:23:19.713603003 +0100 +@@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any + #include + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + #include "inet_ntop.h" + #include "inet_pton.h" + +@@ -190,6 +194,7 @@ netsnmp_udp6_transport(struct sockaddr_i + { + netsnmp_transport *t = NULL; + int rc = 0; ++ int socket_initialized = 0; + + #ifdef NETSNMP_NO_LISTEN_SUPPORT + if (local) +@@ -217,7 +222,19 @@ netsnmp_udp6_transport(struct sockaddr_i + t->domain_length = + sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]); + +- t->sock = socket(PF_INET6, SOCK_DGRAM, 0); ++#ifndef NETSNMP_NO_SYSTEMD ++ /* ++ * Maybe the socket was already provided by systemd... ++ */ ++ if (local) { ++ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1, ++ ntohs(addr->sin6_port)); ++ if (t->sock) ++ socket_initialized = 1; ++ } ++#endif ++ if (!socket_initialized) ++ t->sock = socket(PF_INET6, SOCK_DGRAM, 0); + if (t->sock < 0) { + netsnmp_transport_free(t); + return NULL; +@@ -242,13 +259,14 @@ netsnmp_udp6_transport(struct sockaddr_i + } + } + #endif +- +- rc = bind(t->sock, (struct sockaddr *) addr, +- sizeof(struct sockaddr_in6)); +- if (rc != 0) { +- netsnmp_socketbase_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = bind(t->sock, (struct sockaddr *) addr, ++ sizeof(struct sockaddr_in6)); ++ if (rc != 0) { ++ netsnmp_socketbase_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } + t->local = (unsigned char*)malloc(18); + if (t->local == NULL) { +diff -up net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c.systemd net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c +--- net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c.systemd 2012-10-10 00:28:58.000000000 +0200 ++++ net-snmp-5.7.2/snmplib/transports/snmpUnixDomain.c 2012-11-12 10:24:02.803466358 +0100 +@@ -37,6 +37,10 @@ + #include /* mkdirhier */ + #include + ++#ifndef NETSNMP_NO_SYSTEMD ++#include ++#endif ++ + netsnmp_feature_child_of(transport_unix_socket_all, transport_all) + netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all) + +@@ -295,6 +299,7 @@ netsnmp_unix_transport(struct sockaddr_u + netsnmp_transport *t = NULL; + sockaddr_un_pair *sup = NULL; + int rc = 0; ++ int socket_initialized = 0; + + #ifdef NETSNMP_NO_LISTEN_SUPPORT + /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate, +@@ -333,7 +338,18 @@ netsnmp_unix_transport(struct sockaddr_u + t->data_length = sizeof(sockaddr_un_pair); + sup = (sockaddr_un_pair *) t->data; + +- t->sock = socket(PF_UNIX, SOCK_STREAM, 0); ++#ifndef NETSNMP_NO_SYSTEMD ++ /* ++ * Maybe the socket was already provided by systemd... ++ */ ++ if (local) { ++ t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path); ++ if (t->sock) ++ socket_initialized = 1; ++ } ++#endif ++ if (!socket_initialized) ++ t->sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (t->sock < 0) { + netsnmp_transport_free(t); + return NULL; +@@ -357,25 +373,26 @@ netsnmp_unix_transport(struct sockaddr_u + + t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; + +- unlink(addr->sun_path); +- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); +- +- if (rc != 0 && errno == ENOENT && create_path) { +- rc = mkdirhier(addr->sun_path, create_mode, 1); ++ if (!socket_initialized) { ++ unlink(addr->sun_path); ++ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); ++ if (rc != 0 && errno == ENOENT && create_path) { ++ rc = mkdirhier(addr->sun_path, create_mode, 1); ++ if (rc != 0) { ++ netsnmp_unix_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } ++ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); ++ } + if (rc != 0) { ++ DEBUGMSGTL(("netsnmp_unix_transport", ++ "couldn't bind \"%s\", errno %d (%s)\n", ++ addr->sun_path, errno, strerror(errno))); + netsnmp_unix_close(t); + netsnmp_transport_free(t); + return NULL; + } +- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); +- } +- if (rc != 0) { +- DEBUGMSGTL(("netsnmp_unix_transport", +- "couldn't bind \"%s\", errno %d (%s)\n", +- addr->sun_path, errno, strerror(errno))); +- netsnmp_unix_close(t); +- netsnmp_transport_free(t); +- return NULL; + } + + /* +@@ -391,16 +408,17 @@ netsnmp_unix_transport(struct sockaddr_u + * Now sit here and listen for connections to arrive. + */ + +- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); +- if (rc != 0) { +- DEBUGMSGTL(("netsnmp_unix_transport", +- "couldn't listen to \"%s\", errno %d (%s)\n", +- addr->sun_path, errno, strerror(errno))); +- netsnmp_unix_close(t); +- netsnmp_transport_free(t); +- return NULL; ++ if (!socket_initialized) { ++ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); ++ if (rc != 0) { ++ DEBUGMSGTL(("netsnmp_unix_transport", ++ "couldn't listen to \"%s\", errno %d (%s)\n", ++ addr->sun_path, errno, strerror(errno))); ++ netsnmp_unix_close(t); ++ netsnmp_transport_free(t); ++ return NULL; ++ } + } +- + } else { + t->remote = (u_char *)malloc(strlen(addr->sun_path)); + if (t->remote == NULL) { diff --git a/SOURCES/net-snmp-config b/SOURCES/net-snmp-config new file mode 100755 index 0000000..a719c28 --- /dev/null +++ b/SOURCES/net-snmp-config @@ -0,0 +1,58 @@ +#!/bin/sh +# +# net-snmp-config +# +# this shell script is designed to merely dump the configuration +# information about how the net-snmp package was compiled. The +# information is particularily useful for applications that need to +# link against the net-snmp libraries and hence must know about any +# other libraries that must be linked in as well. + +# this particular shell script calls arch specific script to avoid +# multilib conflicts + +# Supported arches ix86 ia64 ppc ppc64 s390 s390x x86_64 alpha sparc sparc64 + +arch=`arch` +echo $arch | grep -q i.86 +if [ $? -eq 0 ] ; then + net-snmp-config-i386 $* + exit 0 +fi +if [ "$arch" = "ia64" ] ; then + net-snmp-config-ia64 $* + exit 0 +fi +if [ "$arch" = "ppc" ] ; then + net-snmp-config-ppc $* + exit 0 +fi +if [ "$arch" = "ppc64" ] ; then + net-snmp-config-ppc64 $* + exit 0 +fi +if [ "$arch" = "s390" ] ; then + net-snmp-config-s390 $* + exit 0 +fi +if [ "$arch" = "s390x" ] ; then + net-snmp-config-s390x $* + exit 0 +fi +if [ "$arch" = "x86_64" ] ; then + net-snmp-config-x86_64 $* + exit 0 +fi +if [ "$arch" = "alpha" ] ; then + net-snmp-config-alpha $* + exit 0 +fi +if [ "$arch" = "sparc" ] ; then + net-snmp-config-sparc $* + exit 0 +fi +if [ "$arch" = "sparc64" ] ; then + net-snmp-config-sparc64 $* + exit 0 +fi +echo "Cannot determine architecture" diff --git a/SOURCES/net-snmp-config.h b/SOURCES/net-snmp-config.h new file mode 100644 index 0000000..81aaf5b --- /dev/null +++ b/SOURCES/net-snmp-config.h @@ -0,0 +1,36 @@ +/* This file is here to prevent a file conflict on multiarch systems. A + * conflict will frequently occur because arch-specific build-time + * configuration options are stored (and used, so they can't just be stripped + * out) in net-snmp-config.h. The original net-snmp-config.h has been renamed. + * DO NOT INCLUDE THE NEW FILE DIRECTLY -- ALWAYS INCLUDE THIS ONE INSTEAD. */ + +#ifdef net-snmp-config_multilib_redirection_h +#error "Do not define net-snmp-config_multilib_redirection_h!" +#endif +#define net-snmp-config_multilib_redirection_h + +#if defined(__i386__) +#include "net-snmp-config-i386.h" +#elif defined(__ia64__) +#include "net-snmp-config-ia64.h" +#elif defined(__powerpc64__) +#include "net-snmp-config-ppc64.h" +#elif defined(__powerpc__) +#include "net-snmp-config-ppc.h" +#elif defined(__s390x__) +#include "net-snmp-config-s390x.h" +#elif defined(__s390__) +#include "net-snmp-config-s390.h" +#elif defined(__x86_64__) +#include "net-snmp-config-x86_64.h" +#elif defined(__alpha__) +#include "net-snmp-config-alpha.h" +#elif defined(__sparc__) && defined (__arch64__) +#include "net-snmp-config-sparc64.h" +#elif defined(__sparc__) +#include "net-snmp-config-sparc.h" +#else +#error "net-snmp-devel package does not work on your architecture" +#endif + +#undef net-snmp-config_multilib_redirection_h diff --git a/SOURCES/net-snmp-tmpfs.conf b/SOURCES/net-snmp-tmpfs.conf new file mode 100644 index 0000000..382f8eb --- /dev/null +++ b/SOURCES/net-snmp-tmpfs.conf @@ -0,0 +1 @@ +d /var/run/net-snmp 0755 root root diff --git a/SOURCES/net-snmp-trapd.redhat.conf b/SOURCES/net-snmp-trapd.redhat.conf new file mode 100644 index 0000000..72ce1cc --- /dev/null +++ b/SOURCES/net-snmp-trapd.redhat.conf @@ -0,0 +1,6 @@ +# Example configuration file for snmptrapd +# +# No traps are handled by default, you must edit this file! +# +# authCommunity log,execute,net public +# traphandle SNMPv2-MIB::coldStart /usr/bin/bin/my_great_script cold diff --git a/SOURCES/net-snmp.redhat.conf b/SOURCES/net-snmp.redhat.conf new file mode 100644 index 0000000..ee19ab8 --- /dev/null +++ b/SOURCES/net-snmp.redhat.conf @@ -0,0 +1,462 @@ +############################################################################### +# +# snmpd.conf: +# An example configuration file for configuring the ucd-snmp snmpd agent. +# +############################################################################### +# +# This file is intended to only be as a starting point. Many more +# configuration directives exist than are mentioned in this file. For +# full details, see the snmpd.conf(5) manual page. +# +# All lines beginning with a '#' are comments and are intended for you +# to read. All other lines are configuration commands for the agent. + +############################################################################### +# Access Control +############################################################################### + +# As shipped, the snmpd demon will only respond to queries on the +# system mib group until this file is replaced or modified for +# security purposes. Examples are shown below about how to increase the +# level of access. + +# By far, the most common question I get about the agent is "why won't +# it work?", when really it should be "how do I configure the agent to +# allow me to access it?" +# +# By default, the agent responds to the "public" community for read +# only access, if run out of the box without any configuration file in +# place. The following examples show you other ways of configuring +# the agent so that you can change the community names, and give +# yourself write access to the mib tree as well. +# +# For more information, read the FAQ as well as the snmpd.conf(5) +# manual page. + +#### +# First, map the community name "public" into a "security name" + +# sec.name source community +com2sec notConfigUser default public + +#### +# Second, map the security name into a group name: + +# groupName securityModel securityName +group notConfigGroup v1 notConfigUser +group notConfigGroup v2c notConfigUser + +#### +# Third, create a view for us to let the group have rights to: + +# Make at least snmpwalk -v 1 localhost -c public system fast again. +# name incl/excl subtree mask(optional) +view systemview included .1.3.6.1.2.1.1 +view systemview included .1.3.6.1.2.1.25.1.1 + +#### +# Finally, grant the group read-only access to the systemview view. + +# group context sec.model sec.level prefix read write notif +access notConfigGroup "" any noauth exact systemview none none + +# ----------------------------------------------------------------------------- + +# Here is a commented out example configuration that allows less +# restrictive access. + +# YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY +# KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO +# SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE. + +## sec.name source community +#com2sec local localhost COMMUNITY +#com2sec mynetwork NETWORK/24 COMMUNITY + +## group.name sec.model sec.name +#group MyRWGroup any local +#group MyROGroup any mynetwork +# +#group MyRWGroup any otherv3user +#... + +## incl/excl subtree mask +#view all included .1 80 + +## -or just the mib2 tree- + +#view mib2 included .iso.org.dod.internet.mgmt.mib-2 fc + + +## context sec.model sec.level prefix read write notif +#access MyROGroup "" any noauth 0 all none none +#access MyRWGroup "" any noauth 0 all all all + + +############################################################################### +# Sample configuration to make net-snmpd RFC 1213. +# Unfortunately v1 and v2c don't allow any user based authentification, so +# opening up the default config is not an option from a security point. +# +# WARNING: If you uncomment the following lines you allow write access to your +# snmpd daemon from any source! To avoid this use different names for your +# community or split out the write access to a different community and +# restrict it to your local network. +# Also remember to comment the syslocation and syscontact parameters later as +# otherwise they are still read only (see FAQ for net-snmp). +# + +# First, map the community name "public" into a "security name" +# sec.name source community +#com2sec notConfigUser default public + +# Second, map the security name into a group name: +# groupName securityModel securityName +#group notConfigGroup v1 notConfigUser +#group notConfigGroup v2c notConfigUser + +# Third, create a view for us to let the group have rights to: +# Open up the whole tree for ro, make the RFC 1213 required ones rw. +# name incl/excl subtree mask(optional) +#view roview included .1 +#view rwview included system.sysContact +#view rwview included system.sysName +#view rwview included system.sysLocation +#view rwview included interfaces.ifTable.ifEntry.ifAdminStatus +#view rwview included at.atTable.atEntry.atPhysAddress +#view rwview included at.atTable.atEntry.atNetAddress +#view rwview included ip.ipForwarding +#view rwview included ip.ipDefaultTTL +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteDest +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteIfIndex +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric1 +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric2 +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric3 +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric4 +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteType +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteAge +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMask +#view rwview included ip.ipRouteTable.ipRouteEntry.ipRouteMetric5 +#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaIfIndex +#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaPhysAddress +#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaNetAddress +#view rwview included ip.ipNetToMediaTable.ipNetToMediaEntry.ipNetToMediaType +#view rwview included tcp.tcpConnTable.tcpConnEntry.tcpConnState +#view rwview included egp.egpNeighTable.egpNeighEntry.egpNeighEventTrigger +#view rwview included snmp.snmpEnableAuthenTraps + +# Finally, grant the group read-only access to the systemview view. +# group context sec.model sec.level prefix read write notif +#access notConfigGroup "" any noauth exact roview rwview none + + + +############################################################################### +# System contact information +# + +# It is also possible to set the sysContact and sysLocation system +# variables through the snmpd.conf file: + +syslocation Unknown (edit /etc/snmp/snmpd.conf) +syscontact Root (configure /etc/snmp/snmp.local.conf) + +# Example output of snmpwalk: +# % snmpwalk -v 1 localhost -c public system +# system.sysDescr.0 = "SunOS name sun4c" +# system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4 +# system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55 +# system.sysContact.0 = "Me " +# system.sysName.0 = "name" +# system.sysLocation.0 = "Right here, right now." +# system.sysServices.0 = 72 + + +############################################################################### +# Logging +# + +# We do not want annoying "Connection from UDP: " messages in syslog. +# If the following option is commented out, snmpd will print each incoming +# connection, which can be useful for debugging. + +dontLogTCPWrappersConnects yes + +# ----------------------------------------------------------------------------- + + +############################################################################### +# Process checks. +# +# The following are examples of how to use the agent to check for +# processes running on the host. The syntax looks something like: +# +# proc NAME [MAX=0] [MIN=0] +# +# NAME: the name of the process to check for. It must match +# exactly (ie, http will not find httpd processes). +# MAX: the maximum number allowed to be running. Defaults to 0. +# MIN: the minimum number to be running. Defaults to 0. + +# +# Examples (commented out by default): +# + +# Make sure mountd is running +#proc mountd + +# Make sure there are no more than 4 ntalkds running, but 0 is ok too. +#proc ntalkd 4 + +# Make sure at least one sendmail, but less than or equal to 10 are running. +#proc sendmail 10 1 + +# A snmpwalk of the process mib tree would look something like this: +# +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.2 +# enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1 +# enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2 +# enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3 +# enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd" +# enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd" +# enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail" +# enterprises.ucdavis.procTable.prEntry.prMin.1 = 0 +# enterprises.ucdavis.procTable.prEntry.prMin.2 = 0 +# enterprises.ucdavis.procTable.prEntry.prMin.3 = 1 +# enterprises.ucdavis.procTable.prEntry.prMax.1 = 0 +# enterprises.ucdavis.procTable.prEntry.prMax.2 = 4 +# enterprises.ucdavis.procTable.prEntry.prMax.3 = 10 +# enterprises.ucdavis.procTable.prEntry.prCount.1 = 0 +# enterprises.ucdavis.procTable.prEntry.prCount.2 = 0 +# enterprises.ucdavis.procTable.prEntry.prCount.3 = 1 +# enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1 +# enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0 +# enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0 +# enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running." +# enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = "" +# enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = "" +# enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0 +# enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0 +# enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0 +# +# Note that the errorFlag for mountd is set to 1 because one is not +# running (in this case an rpc.mountd is, but thats not good enough), +# and the ErrMessage tells you what's wrong. The configuration +# imposed in the snmpd.conf file is also shown. +# +# Special Case: When the min and max numbers are both 0, it assumes +# you want a max of infinity and a min of 1. +# + + +# ----------------------------------------------------------------------------- + + +############################################################################### +# Executables/scripts +# + +# +# You can also have programs run by the agent that return a single +# line of output and an exit code. Here are two examples. +# +# exec NAME PROGRAM [ARGS ...] +# +# NAME: A generic name. The name must be unique for each exec statement. +# PROGRAM: The program to run. Include the path! +# ARGS: optional arguments to be passed to the program + +# a simple hello world + +#exec echotest /bin/echo hello world + +# Run a shell script containing: +# +# #!/bin/sh +# echo hello world +# echo hi there +# exit 35 +# +# Note: this has been specifically commented out to prevent +# accidental security holes due to someone else on your system writing +# a /tmp/shtest before you do. Uncomment to use it. +# +#exec shelltest /bin/sh /tmp/shtest + +# Then, +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.8 +# enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1 +# enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2 +# enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest" +# enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest" +# enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world" +# enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest" +# enterprises.ucdavis.extTable.extEntry.extResult.1 = 0 +# enterprises.ucdavis.extTable.extEntry.extResult.2 = 35 +# enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world." +# enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world." +# enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0 +# enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0 + +# Note that the second line of the /tmp/shtest shell script is cut +# off. Also note that the exit status of 35 was returned. + +# ----------------------------------------------------------------------------- + + +############################################################################### +# disk checks +# + +# The agent can check the amount of available disk space, and make +# sure it is above a set limit. + +# disk PATH [MIN=100000] +# +# PATH: mount path to the disk in question. +# MIN: Disks with space below this value will have the Mib's errorFlag set. +# Default value = 100000. + +# Check the / partition and make sure it contains at least 10 megs. + +#disk / 10000 + +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.9 +# enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0 +# enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F +# enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0" +# enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000 +# enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130 +# enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325 +# enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092 +# enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58 +# enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0 +# enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = "" + +# ----------------------------------------------------------------------------- + + +############################################################################### +# load average checks +# + +# load [1MAX=12.0] [5MAX=12.0] [15MAX=12.0] +# +# 1MAX: If the 1 minute load average is above this limit at query +# time, the errorFlag will be set. +# 5MAX: Similar, but for 5 min average. +# 15MAX: Similar, but for 15 min average. + +# Check for loads: +#load 12 14 14 + +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.10 +# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1 +# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2 +# enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3 +# enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1" +# enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5" +# enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15" +# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39 +# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31 +# enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36 +# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00" +# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00" +# enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00" +# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0 +# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0 +# enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0 +# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = "" +# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = "" +# enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = "" + +# ----------------------------------------------------------------------------- + + +############################################################################### +# Extensible sections. +# + +# This alleviates the multiple line output problem found in the +# previous executable mib by placing each mib in its own mib table: + +# Run a shell script containing: +# +# #!/bin/sh +# echo hello world +# echo hi there +# exit 35 +# +# Note: this has been specifically commented out to prevent +# accidental security holes due to someone else on your system writing +# a /tmp/shtest before you do. Uncomment to use it. +# +# exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest + +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.50 +# enterprises.ucdavis.50.1.1 = 1 +# enterprises.ucdavis.50.2.1 = "shelltest" +# enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest" +# enterprises.ucdavis.50.100.1 = 35 +# enterprises.ucdavis.50.101.1 = "hello world." +# enterprises.ucdavis.50.101.2 = "hi there." +# enterprises.ucdavis.50.102.1 = 0 + +# Now the Output has grown to two lines, and we can see the 'hi +# there.' output as the second line from our shell script. +# +# Note that you must alter the mib.txt file to be correct if you want +# the .50.* outputs above to change to reasonable text descriptions. + +# Other ideas: +# +# exec .1.3.6.1.4.1.2021.51 ps /bin/ps +# exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top +# exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq + +# ----------------------------------------------------------------------------- + + +############################################################################### +# Pass through control. +# + +# Usage: +# pass MIBOID EXEC-COMMAND +# +# This will pass total control of the mib underneath the MIBOID +# portion of the mib to the EXEC-COMMAND. +# +# Note: You'll have to change the path of the passtest script to your +# source directory or install it in the given location. +# +# Example: (see the script for details) +# (commented out here since it requires that you place the +# script in the right location. (its not installed by default)) + +# pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/local/passtest + +# % snmpwalk -v 1 localhost -c public .1.3.6.1.4.1.2021.255 +# enterprises.ucdavis.255.1 = "life the universe and everything" +# enterprises.ucdavis.255.2.1 = 42 +# enterprises.ucdavis.255.2.2 = OID: 42.42.42 +# enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42 +# enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1 +# enterprises.ucdavis.255.5 = 42 +# enterprises.ucdavis.255.6 = Gauge: 42 +# +# % snmpget -v 1 localhost public .1.3.6.1.4.1.2021.255.5 +# enterprises.ucdavis.255.5 = 42 +# +# % snmpset -v 1 localhost public .1.3.6.1.4.1.2021.255.1 s "New string" +# enterprises.ucdavis.255.1 = "New string" +# + +# For specific usage information, see the man/snmpd.conf.5 manual page +# as well as the local/passtest script used in the above example. + +############################################################################### +# Further Information +# +# See the snmpd.conf manual page, and the output of "snmpd -H". diff --git a/SOURCES/net-snmpd.init b/SOURCES/net-snmpd.init new file mode 100755 index 0000000..6038c51 --- /dev/null +++ b/SOURCES/net-snmpd.init @@ -0,0 +1,115 @@ +#!/bin/bash +# ucd-snmp init file for snmpd +# +# chkconfig: - 50 50 +# description: Simple Network Management Protocol (SNMP) Daemon +# +# processname: /usr/sbin/snmpd +# config: /etc/snmp/snmpd.conf +# config: /usr/share/snmp/snmpd.conf +# pidfile: /var/run/snmpd.pid + +### BEGIN INIT INFO +# Provides: snmpd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: start and stop Net-SNMP daemon +# Description: Simple Network Management Protocol (SNMP) Daemon +### END INIT INFO + +# source function library +. /etc/init.d/functions + + +OPTIONS="-LS0-6d -Lf /dev/null -p /var/run/snmpd.pid" +if [ -e /etc/sysconfig/snmpd ]; then + . /etc/sysconfig/snmpd +fi + +RETVAL=0 +prog="snmpd" +binary=/usr/sbin/snmpd +pidfile=/var/run/snmpd.pid + +start() { + [ -x $binary ] || exit 5 + echo -n $"Starting $prog: " + if [ $UID -ne 0 ]; then + RETVAL=1 + failure + else + daemon --pidfile=$pidfile $binary $OPTIONS + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/snmpd + fi; + echo + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + if [ $UID -ne 0 ]; then + RETVAL=1 + failure + else + killproc -p $pidfile $binary + RETVAL=$? + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/snmpd + fi; + echo + return $RETVAL +} + +reload(){ + echo -n $"Reloading $prog: " + killproc -p $pidfile $binary -HUP + RETVAL=$? + echo + return $RETVAL +} + +restart(){ + stop + start +} + +condrestart(){ + [ -e /var/lock/subsys/snmpd ] && restart + return 0 +} + +case "$1" in + start) + start + RETVAL=$? + ;; + stop) + stop + RETVAL=$? + ;; + restart) + restart + RETVAL=$? + ;; + reload|force-reload) + reload + RETVAL=$? + ;; + condrestart|try-restart) + condrestart + RETVAL=$? + ;; + status) + status snmpd + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/SOURCES/net-snmpd.sysconfig b/SOURCES/net-snmpd.sysconfig new file mode 100644 index 0000000..6949ec0 --- /dev/null +++ b/SOURCES/net-snmpd.sysconfig @@ -0,0 +1,3 @@ +# snmpd command line options +# '-f' is implicitly added by snmpd systemd unit file +# OPTIONS="-LS0-6d" diff --git a/SOURCES/net-snmptrapd.init b/SOURCES/net-snmptrapd.init new file mode 100755 index 0000000..55a786c --- /dev/null +++ b/SOURCES/net-snmptrapd.init @@ -0,0 +1,103 @@ +#!/bin/bash + +# ucd-snmp init file for snmptrapd +# +# chkconfig: - 50 50 +# description: Simple Network Management Protocol (SNMP) Trap Daemon +# +# processname: /usr/sbin/snmptrapd +# config: /etc/snmp/snmptrapd.conf +# config: /usr/share/snmp/snmptrapd.conf +# pidfile: /var/run/snmptrapd.pid + + +### BEGIN INIT INFO +# Provides: snmptrapd +# Required-Start: $local_fs $network +# Required-Stop: $local_fs $network +# Should-Start: +# Should-Stop: +# Default-Start: +# Default-Stop: +# Short-Description: start and stop Net-SNMP trap daemon +# Description: Simple Network Management Protocol (SNMP) trap daemon +### END INIT INFO + +# source function library +. /etc/init.d/functions + +OPTIONS="-Lsd -p /var/run/snmptrapd.pid" +if [ -e /etc/sysconfig/snmptrapd ]; then + . /etc/sysconfig/snmptrapd +fi + +RETVAL=0 +prog="snmptrapd" +binary=/usr/sbin/snmptrapd +pidfile=/var/run/snmptrapd.pid + +start() { + [ -x $binary ] || exit 5 + echo -n $"Starting $prog: " + daemon --pidfile=$pidfile /usr/sbin/snmptrapd $OPTIONS + RETVAL=$? + echo + touch /var/lock/subsys/snmptrapd + return $RETVAL +} + +stop() { + echo -n $"Stopping $prog: " + killproc -p $pidfile /usr/sbin/snmptrapd + RETVAL=$? + echo + rm -f /var/lock/subsys/snmptrapd + return $RETVAL +} + +reload(){ + stop + start +} + +restart(){ + stop + start +} + +condrestart(){ + [ -e /var/lock/subsys/snmptrapd ] && restart + return 0 +} + +case "$1" in + start) + start + RETVAL=$? + ;; + stop) + stop + RETVAL=$? + ;; + restart) + restart + RETVAL=$? + ;; + reload|force-reload) + reload + RETVAL=$? + ;; + condrestart|try-restart) + condrestart + RETVAL=$? + ;; + status) + status snmptrapd + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload|force-reload}" + RETVAL=2 +esac + +exit $RETVAL diff --git a/SOURCES/net-snmptrapd.sysconfig b/SOURCES/net-snmptrapd.sysconfig new file mode 100644 index 0000000..85e3128 --- /dev/null +++ b/SOURCES/net-snmptrapd.sysconfig @@ -0,0 +1,3 @@ +# snmptrapd command line options +# '-f' is implicitly added by snmptrapd systemd unit file +# OPTIONS="-Lsd" diff --git a/SOURCES/snmpd.service b/SOURCES/snmpd.service new file mode 100644 index 0000000..adb394d --- /dev/null +++ b/SOURCES/snmpd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Simple Network Management Protocol (SNMP) Daemon. +After=syslog.target network.target + +[Service] +Type=notify +Environment=OPTIONS="-LS0-6d" +EnvironmentFile=-/etc/sysconfig/snmpd +ExecStart=/usr/sbin/snmpd $OPTIONS -f +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/SOURCES/snmptrapd.service b/SOURCES/snmptrapd.service new file mode 100644 index 0000000..9835a38 --- /dev/null +++ b/SOURCES/snmptrapd.service @@ -0,0 +1,13 @@ +[Unit] +Description=Simple Network Management Protocol (SNMP) Trap Daemon. +After=syslog.target network.target + +[Service] +Type=notify +Environment=OPTIONS="-Lsd" +EnvironmentFile=-/etc/sysconfig/snmptrapd +ExecStart=/usr/sbin/snmptrapd $OPTIONS -f +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target diff --git a/SPECS/net-snmp.spec b/SPECS/net-snmp.spec new file mode 100644 index 0000000..fbd7926 --- /dev/null +++ b/SPECS/net-snmp.spec @@ -0,0 +1,1700 @@ +# use netsnmp_tcp_wrappers 0 to disable tcp_wrappers support +%{!?netsnmp_tcp_wrappers:%global netsnmp_tcp_wrappers 1} +# use nestnmp_check 0 to speed up packaging by disabling 'make test' +%{!?netsnmp_check: %global netsnmp_check 1} + +# allow compilation on Fedora 11 and older +%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} +# Arches on which we need to prevent arch conflicts on net-snmp-config.h +%global multilib_arches %{ix86} ia64 ppc ppc64 s390 s390x x86_64 sparc sparcv9 sparc64 + +Summary: A collection of SNMP protocol tools and libraries +Name: net-snmp +Version: 5.7.2 +Release: 11%{?dist} +Epoch: 1 + +License: BSD +Group: System Environment/Daemons +URL: http://net-snmp.sourceforge.net/ +Source0: net-snmp-%{version}-noapsl.tar.gz +# Original source: http://dl.sourceforge.net/net-snmp/net-snmp-%{version}.tar.gz +# Net-snmp contains code licensed under APSL 1.1. This code is used on MacOS only, +# and it must be removed from source code before we distribute source RPM. +# Download the upstream tarball and invoke this script while in the +# tarball's directory: +# ./generate-tarball.sh 5.7.2 +Source1: net-snmp.redhat.conf +Source2: net-snmpd.init +Source3: net-snmptrapd.init +Source4: net-snmp-config.h +Source5: net-snmp-config +Source6: net-snmp-trapd.redhat.conf +Source7: net-snmpd.sysconfig +Source8: net-snmptrapd.sysconfig +Source9: net-snmp-tmpfs.conf +Source10: snmpd.service +Source11: snmptrapd.service +Patch1: net-snmp-5.7.2-pie.patch +Patch2: net-snmp-5.5-dir-fix.patch +Patch3: net-snmp-5.6-multilib.patch +Patch5: net-snmp-5.6-test-debug.patch +Patch6: net-snmp-5.7.2-systemd.patch +Patch7: net-snmp-5.7.2-fips.patch +Patch8: net-snmp-5.7-skip-ipv6-tests.patch +Patch9: net-snmp-5.7-relro.patch +Patch10: net-snmp-5.7-smux-reqid.patch +Patch11: net-snmp-5.7-agentx-crash.patch +Patch12: net-snmp-5.7.2-exec-cmdline.patch +Patch13: net-snmp-5.7.2-clientaddr-port.patch +Patch14: net-snmp-5.5-getnext-loop.patch +Patch15: net-snmp-5.7-dsktable-cache.patch +Patch16: net-snmp-5.7.2-python-ipaddress-size.patch +Patch17: net-snmp-5.7.2-create-user-multilib.patch +Patch18: net-snmp-5.5-extend-realloc-leak.patch +Patch19: net-snmp-5.5-man-config-path.patch +Patch20: net-snmp-5.7.2-kernel-threads.patch +Patch21: net-snmp-5.7.2-agentx-disconnect-crash.patch +Patch22: net-snmp-5.7.2-dskTable-dynamic.patch +Patch23: net-snmp-5.5-extTable-crash.patch +Patch24: net-snmp-5.7.2-dot3stats-log.patch +Patch25: net-snmp-5.7.2-soname.patch +Patch26: net-snmp-5.5-ber-int-size.patch +Patch27: net-snmp-5.5-ber-int-size2.patch +Patch28: net-snmp-5.7.2-hrStorage-fs.patch +Patch29: net-snmp-5.7.2-btrfs.patch + +Requires(post): chkconfig +Requires(preun): chkconfig +# for /sbin/service +Requires(preun): initscripts +# for /bin/rm +Requires(preun): coreutils +Requires: %{name}-libs = %{epoch}:%{version}-%{release} +Requires: %{name}-agent-libs = %{epoch}:%{version}-%{release} +Requires: mysql-libs +# This is actually needed for the %%triggerun script but Requires(triggerun) +# is not valid. We can use %%post because this particular %triggerun script +# should fire just after this package is installed. +Requires(post): systemd-sysv + +BuildRequires: openssl-devel, bzip2-devel, elfutils-devel +BuildRequires: libselinux-devel, elfutils-libelf-devel, rpm-devel +BuildRequires: perl-devel, perl(ExtUtils::Embed), gawk, procps +BuildRequires: python-devel, python-setuptools +BuildRequires: chrpath +BuildRequires: mysql-devel +# for netstat, needed by 'make test' +BuildRequires: net-tools +# for make test +BuildRequires: perl(TAP::Harness) +BuildRequires: systemd-units +%ifnarch s390 s390x +BuildRequires: lm_sensors-devel >= 3 +%endif +%if %{netsnmp_tcp_wrappers} +BuildRequires: tcp_wrappers-devel +%endif + +%description +SNMP (Simple Network Management Protocol) is a protocol used for +network management. The NET-SNMP project includes various SNMP tools: +an extensible agent, an SNMP library, tools for requesting or setting +information from SNMP agents, tools for generating and handling SNMP +traps, a version of the netstat command which uses SNMP, and a Tk/Perl +mib browser. This package contains the snmpd and snmptrapd daemons, +documentation, etc. + +You will probably also want to install the net-snmp-utils package, +which contains NET-SNMP utilities. + +%package utils +Group: Applications/System +Summary: Network management utilities using SNMP, from the NET-SNMP project +Requires: %{name}-libs = %{epoch}:%{version}-%{release} + +%description utils +The net-snmp-utils package contains various utilities for use with the +NET-SNMP network management project. + +Install this package if you need utilities for managing your network +using the SNMP protocol. You will also need to install the net-snmp +package. + +%package devel +Group: Development/Libraries +Summary: The development environment for the NET-SNMP project +Requires: %{name}-libs = %{epoch}:%{version}-%{release} +Requires: %{name}-agent-libs = %{epoch}:%{version}-%{release} +Requires: elfutils-devel, rpm-devel, elfutils-libelf-devel, openssl-devel +%if %{netsnmp_tcp_wrappers} +Requires: tcp_wrappers-devel +%endif +%ifnarch s390 s390x +Requires: lm_sensors-devel +%endif +# pull perl development libraries, net-snmp agent libraries may link to them +Requires: perl-devel%{?_isa} + +%description devel +The net-snmp-devel package contains the development libraries and +header files for use with the NET-SNMP project's network management +tools. + +Install the net-snmp-devel package if you would like to develop +applications for use with the NET-SNMP project's network management +tools. You'll also need to have the net-snmp and net-snmp-utils +packages installed. + +%package perl +Group: Development/Libraries +Summary: The perl NET-SNMP module and the mib2c tool +Requires: %{name}-libs = %{epoch}:%{version}-%{release}, perl +Requires: %{name}-agent-libs = %{epoch}:%{version}-%{release} +BuildRequires: perl + +%description perl +The net-snmp-perl package contains the perl files to use SNMP from within +Perl. + +Install the net-snmp-perl package, if you want to use mib2c or SNMP +with perl. + +%package gui +Group: Applications/System +Summary: An interactive graphical MIB browser for SNMP +Requires: perl-Tk, net-snmp-perl = %{epoch}:%{version}-%{release} + +%description gui +The net-snmp-gui package contains tkmib utility, which is a graphical user +interface for browsing the Message Information Bases (MIBs). It is also +capable of sending or retrieving the SNMP management information to/from +the remote agents interactively. + +Install the net-snmp-gui package, if you want to use this interactive utility. + +%package libs +Group: Development/Libraries +Summary: The NET-SNMP runtime client libraries + +%description libs +The net-snmp-libs package contains the runtime client libraries for shared +binaries and applications. + +%package agent-libs +Group: Development/Libraries +Summary: The NET-SNMP runtime agent libraries +# the libs link against libperl.so: +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: %{name}-libs = %{epoch}:%{version}-%{release} + +%description agent-libs +The net-snmp-agent-libs package contains the runtime agent libraries for shared +binaries and applications. + +%package python +Group: Development/Libraries +Summary: The Python 'netsnmp' module for the Net-SNMP +Requires: %{name}-libs = %{epoch}:%{version}-%{release} + +%description python +The 'netsnmp' module provides a full featured, tri-lingual SNMP (SNMPv3, +SNMPv2c, SNMPv1) client API. The 'netsnmp' module internals rely on the +Net-SNMP toolkit library. + +%package sysvinit +Group: System Environment/Daemons +Summary: Legacy SysV init scripts for Net-SNMP daemons +Requires: %{name} = %{epoch}:%{version}-%{release} + +%description sysvinit +The net-snmp-sysvinit package provides SysV init scripts for Net-SNMP daemons. + +%prep +%setup -q + +%ifnarch ia64 +%patch1 -p1 -b .pie +%endif + +%patch2 -p1 -b .dir-fix +%patch3 -p1 -b .multilib +%patch5 -p1 +%patch6 -p1 -b .systemd +%patch7 -p1 -b .fips +%patch8 -p1 +%patch9 -p1 -b .relro +%patch10 -p1 -b .smux-reqid +%patch11 -p1 -b .agentx-crash +%patch12 -p1 -b .exec-cmdline +%patch13 -p1 -b .clientaddr-port +%patch14 -p1 -b .getnext-loop +%patch15 -p1 -b .dsktable-cache +%patch16 -p1 -b .ipaddress-size +%patch17 -p1 -b .multilib +%patch18 -p1 -b .extend-realloc-leak +%patch19 -p1 -b .man-config-path +%patch20 -p1 -b .kernel-threads +%patch21 -p1 -b .disconnect-crash +%patch22 -p1 -b .dskTable-dynamic +%patch23 -p1 -b .extTable-crash +%patch24 -p1 -b .dot3stats-log +%patch25 -p1 -b .soname +%patch26 -p1 -b .ber-int-size +%patch27 -p1 -b .ber-int-size2 +%patch28 -p1 -b .hrStorage-fs +%patch29 -p1 -b .btrfs + +%ifarch sparc64 s390 s390x +# disable failing test - see https://bugzilla.redhat.com/show_bug.cgi?id=680697 +rm testing/fulltests/default/T200* +%endif + +%build +MIBS="host agentx smux \ + ucd-snmp/diskio tcp-mib udp-mib mibII/mta_sendmail \ + ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ + ip-mib/ipAddressPrefixTable/ipAddressPrefixTable \ + ip-mib/ipDefaultRouterTable/ipDefaultRouterTable \ + ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ + sctp-mib rmon-mib etherlike-mib" + +%ifnarch s390 s390x +# there are no lm_sensors on s390 +MIBS="$MIBS ucd-snmp/lmsensorsMib" +%endif + +%configure \ + --disable-static --enable-shared \ + --with-cflags="$RPM_OPT_FLAGS -D_RPM_4_4_COMPAT" \ + --with-ldflags="-Wl,-z,relro -Wl,-z,now" \ + --with-sys-location="Unknown" \ + --with-logfile="/var/log/snmpd.log" \ + --with-persistent-directory="/var/lib/net-snmp" \ + --with-mib-modules="$MIBS" \ +%if %{netsnmp_tcp_wrappers} + --with-libwrap=yes \ +%endif + --sysconfdir=%{_sysconfdir} \ + --enable-ipv6 \ + --enable-ucd-snmp-compatibility \ + --with-openssl \ + --with-pic \ + --enable-embedded-perl \ + --enable-as-needed \ + --with-perl-modules="INSTALLDIRS=vendor" \ + --enable-mfd-rewrites \ + --enable-local-smux \ + --with-temp-file-pattern=/var/run/net-snmp/snmp-tmp-XXXXXX \ + --with-transports="DTLSUDP TLSTCP" \ + --with-security-modules=tsm \ + --with-mysql \ + --with-systemd \ + --with-sys-contact="root@localhost" <$file.utf8 + mv $file.utf8 $file +done + +# remove executable bit from documentation samples +chmod 644 local/passtest local/ipf-mod.pl + +# dirty hack for #603243, until it's fixed properly upstream +install -m 755 -d $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs +install -m 644 agent/mibgroup/util_funcs/*.h $RPM_BUILD_ROOT/usr/include/net-snmp/agent/util_funcs + +# systemd stuff +install -m 755 -d $RPM_BUILD_ROOT/%{_sysconfdir}/tmpfiles.d/ +install -m 644 %SOURCE9 $RPM_BUILD_ROOT/%{_sysconfdir}/tmpfiles.d/net-snmp.conf +install -m 755 -d $RPM_BUILD_ROOT/%{_unitdir} +install -m 644 %SOURCE10 %SOURCE11 $RPM_BUILD_ROOT/%{_unitdir}/ + +%check +%if %{netsnmp_check} +%ifarch ppc ppc64 +rm -vf testing/fulltests/default/T200snmpv2cwalkall_simple +%endif +# restore libtool, for unknown reason it does not work with the one without rpath +cp -f libtool.orig libtool +# temporary workaround to make test "extending agent functionality with pass" working +chmod 755 local/passtest + +LD_LIBRARY_PATH=${RPM_BUILD_ROOT}/%{_libdir} make test +%endif + + +%post +%systemd_post snmpd.service snmptrapd.service + +%preun +%systemd_preun snmpd.service snmptrapd.service + + +%postun +%systemd_postun_with_restart snmpd.service snmptrapd.service + + +%triggerun -- net-snmp < 1:5.7-5 +# Convert SysV -> systemd. +# Save the current service runlevel info, +# User must manually run systemd-sysv-convert --apply snmpd +# to migrate them to systemd targets +/usr/bin/systemd-sysv-convert --save snmpd >/dev/null 2>&1 ||: +/usr/bin/systemd-sysv-convert --save snmptrapd >/dev/null 2>&1 ||: +/sbin/chkconfig --del snmpd >/dev/null 2>&1 || : +/sbin/chkconfig --del snmptrapd >/dev/null 2>&1 || : +/bin/systemctl try-restart snmpd.service >/dev/null 2>&1 || : +/bin/systemctl try-restart snmptrapd.service >/dev/null 2>&1 || : + +%triggerpostun -n net-snmp-sysvinit -- net-snmp < 1:5.7-5 +/sbin/chkconfig --add snmpd >/dev/null 2>&1 || : +/sbin/chkconfig --add snmptrapd >/dev/null 2>&1 || : + +%post libs -p /sbin/ldconfig + +%postun libs -p /sbin/ldconfig + +%post agent-libs -p /sbin/ldconfig + +%postun agent-libs -p /sbin/ldconfig + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%doc COPYING ChangeLog.trimmed EXAMPLE.conf FAQ NEWS TODO +%doc README README.agent-mibs README.agentx README.krb5 README.snmpv3 +%doc local/passtest local/ipf-mod.pl +%doc README.thread AGENT.txt PORTING local/README.mib2c +%dir %{_sysconfdir}/snmp +%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/snmp/snmpd.conf +%config(noreplace) %attr(0600,root,root) %{_sysconfdir}/snmp/snmptrapd.conf +%{_bindir}/snmpconf +%{_bindir}/agentxtrap +%{_bindir}/net-snmp-create-v3-user +%{_sbindir}/* +%attr(0644,root,root) %{_mandir}/man[58]/snmp*d* +%attr(0644,root,root) %{_mandir}/man5/snmp_config.5.gz +%attr(0644,root,root) %{_mandir}/man5/variables* +%attr(0644,root,root) %{_mandir}/man1/net-snmp-create-v3-user* +%attr(0644,root,root) %{_mandir}/man1/snmpconf.1.gz +%dir %{_datadir}/snmp +%{_datadir}/snmp/snmpconf-data +%dir %{_localstatedir}/run/net-snmp +%config(noreplace) %{_sysconfdir}/tmpfiles.d/net-snmp.conf +%{_unitdir}/snmp* +%config(noreplace) %{_sysconfdir}/sysconfig/snmpd +%config(noreplace) %{_sysconfdir}/sysconfig/snmptrapd + +%files utils +%{_bindir}/encode_keychange +%{_bindir}/snmp[^c-]* +%attr(0644,root,root) %{_mandir}/man1/snmp[^-]*.1* +%attr(0644,root,root) %{_mandir}/man1/encode_keychange*.1* +%attr(0644,root,root) %{_mandir}/man1/agentxtrap.1* +%attr(0644,root,root) %{_mandir}/man5/snmp.conf.5.gz +%attr(0644,root,root) %{_mandir}/man5/variables.5.gz + +%files devel +%{_libdir}/lib*.so +/usr/include/* +%attr(0644,root,root) %{_mandir}/man3/*.3.* +%attr(0755,root,root) %{_bindir}/net-snmp-config* +%attr(0644,root,root) %{_mandir}/man1/net-snmp-config*.1.* + +%files perl +%{_bindir}/mib2c-update +%{_bindir}/mib2c +%{_bindir}/snmp-bridge-mib +%{_bindir}/net-snmp-cert +%dir %{_datadir}/snmp +%{_datadir}/snmp/mib2c* +%{_datadir}/snmp/*.pl +%{_bindir}/traptoemail +%attr(0644,root,root) %{_mandir}/man[15]/mib2c* +%attr(0644,root,root) %{_mandir}/man3/*.3pm.* +%attr(0644,root,root) %{_mandir}/man1/traptoemail*.1* +%attr(0644,root,root) %{_mandir}/man1/snmp-bridge-mib.1* +%{perl_vendorarch}/*SNMP* +%{perl_vendorarch}/auto/*SNMP* +%{perl_vendorarch}/auto/Bundle/*SNMP* + +%files python +%doc README +%{python_sitearch}/* + +%files gui +%{_bindir}/tkmib +%attr(0644,root,root) %{_mandir}/man1/tkmib.1* + +%files libs +%doc COPYING README ChangeLog.trimmed FAQ NEWS TODO +%{_libdir}/libnetsnmp.so.* +%dir %{_datadir}/snmp +%dir %{_datadir}/snmp/mibs +%{_datadir}/snmp/mibs/* +%dir %{_localstatedir}/lib/net-snmp +%dir %{_localstatedir}/lib/net-snmp/mib_indexes +%dir %{_localstatedir}/lib/net-snmp/cert_indexes + +%files agent-libs +%{_libdir}/libnetsnmpagent*.so.* +%{_libdir}/libnetsnmphelpers*.so.* +%{_libdir}/libnetsnmpmibs*.so.* +%{_libdir}/libnetsnmptrapd*.so.* + +%files sysvinit +%{_initrddir}/snmpd +%{_initrddir}/snmptrapd + +%changelog +* Wed Sep 11 2013 Jan Safranek +- added support of btrfs to hrStorageTable (#1006758) + +* Mon Aug 12 2013 Jan Safranek - 1:5.7.2-11 +- fixed parsing of integer variable sizes (#953926, #983116) +- added support of simfs and vzfs to hrStorageTable (#861152, #989498) + +* Fri Jul 12 2013 Jan Safranek - 1:5.7.2-10 +- bumping libnetsnmp soname because of ABI-breaking patch + (#969061) + +* Wed Jun 26 2013 Jan Safranek - 1:5.7.2-9 +- fixed potential memory leak on realloc failure when processing 'extend' + option (#978384) +- added precise enumeration of configuration files searched to + snmp_config(5) man page (#978398) +- set permissions of snmpd.conf and snmptrapd conf to 0600 (#919240) +- fixed kernel threads in hrSWRunTable (#979329) +- fixed snmpd crashing in the middle of agentx request processing when + a subagent disconnects (#969061) +- updated UCD-SNMP-MIB::dskTable to dynamically add/remove disks if + 'includeAllDisks' is specified in snmpd.conf (#982644) +- fixed crash in extTable on empty command line (#955609) +- lowered severity of few debugging messages in dot3statsTable (#915302) + +* Thu Feb 7 2013 Jan Safranek - 1:5.7.2-8 +- Removed APSL patch (#830796) +- fixed net-snmp-create-v3-user to have the same content on all architectures +- /var/lib/net-snmp/mib_indexes and cert_indexes added to net-snmp-libs + (#906761) +- Python: fixed IPADDRESS size on 64-bit systems (#895357) + +* Mon Dec 17 2012 Jan Safranek - 1:5.7.2-7 +- Fixed UCD-SNMP::dskTable being slow on NFS mounts (#877326) + +* Thu Nov 29 2012 Jan Safranek - 1:5.7.2-6 +- Removed unused patch +- Added net-snmp-agent-libs dependency where appropriate +- Added full relro +- Make net-snmp-create-v3-user multilib safe + +* Mon Nov 12 2012 Jan Safranek - 1:5.7.2-5 +- Fixed snmpd in FIPS mode (#874440) +- Removed APSL licensed code (#830796) +- Synchronized with RHEL-6.4 + +* Mon Nov 12 2012 Jan Safranek - 1:5.7.2-4 +- Fixed systemd support (#875632). + +* Mon Oct 29 2012 Jan Safranek - 1:5.7.2-3 +- Added direct dependency on perl-devel with architectute in + net-snmp-devel package to pull proper dependencies. + +* Wed Oct 24 2012 Jan Safranek - 1:5.7.2-2 +- Fixed net-snmp dependency on net-snmp-agent-libs. + +* Thu Oct 18 2012 Jan Safranek - 1:5.7.2-1 +- Updated to 5.7.2 + +* Mon Aug 27 2012 Jan Safranek - 1:5.7.1-10 +- Updated RPM scriplets with latest systemd-rpm macros (#850403). +- Fixed fedora-review tool complaints. + +* Fri Jul 20 2012 Fedora Release Engineering - 1:5.7.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jun 08 2012 Petr Pisar - 1:5.7.1-8 +- Perl 5.16 rebuild + +* Fri May 18 2012 Jan Safranek 5.7.1-7 +- Move /var/lib/net-snmp from net-snmp to net-snmp-libs (#822508) + +* Mon Apr 23 2012 Karsten Hopp 5.7.1-6 +- Temporarily disable T200snmpv2cwalkall_simple test on ppc(64) until + bug 814829 is fixed + +* Fri Mar 30 2012 Jan Safranek - 1:5.7.1-5 +- Rebuilt for new rpm + +* Fri Jan 13 2012 Fedora Release Engineering - 1:5.7.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Mon Nov 28 2011 Jan Safranek - 1:5.7.1-3 +- re-introduced /etc/sysconfig files (#752821) + +* Wed Oct 5 2011 Jan Safranek - 1:5.7.1-2 +- fixed perl linking (#742678) + +* Tue Oct 4 2011 Jan Safranek - 1:5.7.1-1 +- updated to 5.7.1: + - Fixed the mib-parsing-bug introduced shortly before 5.7 + - fixed rounding errors for disk percentage calculations + - Many other miscellaneous minor bug fixes + +* Tue Sep 06 2011 Dan Horák - 1:5.7-7 +- disable failing test on s390(x) (#680697) + +* Thu Aug 11 2011 Jan Safranek - 1:5.7-6 +- added new net-snmp-agent-libs subpackage with agent libraries + -> net-snmp-libs do not need perl and lm_sensors libs +- removed libsnmp.so, it's not used in Fedora (#729811) +- added README.systemd +- added new net-snmp-sysvinit subpackage with legacy init scripts + (#718183) + +* Tue Aug 9 2011 Jan Safranek - 1:5.7-5 +- integrated with systemd (#718183) + +* Thu Jul 21 2011 Petr Sabata - 1:5.7-4 +- Perl mass rebuild + +* Wed Jul 20 2011 Petr Sabata - 1:5.7-3 +- Perl mass rebuild + +* Fri Jul 8 2011 Jan Safranek - 1:5.7-2 +- restored rpath in net-snmp-config output - SNMP subagent won't link + with libsnmpagent.so without it, linker needs to know location + of libperl.so +- fixed check section to make tests pass on machine without DNS + +* Thu Jul 7 2011 Jan Safranek - 1:5.7-1 +- updated to net-snmp-5.7 + +* Mon Jun 20 2011 Marcela Mašláňová - 1:5.6.1-9 +- Perl mass rebuild + +* Thu Jun 09 2011 Marcela Mašláňová - 1:5.6.1-8 +- Perl 5.14 mass rebuild + +* Wed Mar 23 2011 Jan Safranek - 1:5.6.1-7 +- Rebuild against newer mysql + +* Sat Feb 26 2011 Dennis Gilmore - 1:5.6.1-6 +- disable failing test on sparc64 + +* Tue Feb 15 2011 Jan Safranek - 1:5.6.1-5 +- enabled MySQL support in snmptrapd + +* Tue Feb 08 2011 Fedora Release Engineering - 1:5.6.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Jan 19 2011 Jan Safranek - 1:5.6.1-3 +- Rebuild (again) against newer rpm, now with proper rpm-4.9 detection + +* Wed Jan 19 2011 Matthias Clasen - 1:5.6.1-2 +- Rebuild against newer rpm + +* Tue Jan 4 2011 Jan Safranek - 1:5.6.1-1 +- updated to net-snmp-5.6.1 + +* Mon Dec 6 2010 Jan Safranek - 1:5.6-5 +- re-create /var/run/net-snmp on boot using tmpfiles.d (#656637) +- move snmp-bridge-mib and net-snmp-cert utilities to net-snmp-perl + subpackage, net-snmp-utils subpackage does not depend on Perl now + +* Tue Nov 23 2010 Jan Safranek - 1:5.6-4 +- properly fix failing tests on ppc/s390 (#655731) + +* Mon Nov 22 2010 Dan Horák - 1:5.6-3 +- temporarily disable a test failing on ppc/s390 arches + +* Fri Nov 5 2010 Jan Safranek - 1:5.6-2 +- fixed c++ guards in net-snmp header files (#650219) + +* Mon Oct 25 2010 Jan Safranek - 1:5.6-1 +- updated to net-snmp-5.6 + +* Mon Oct 11 2010 Jan Safranek - 1:5.5-21 +- fixed truncation of sysObjectID (#640848) + +* Thu Aug 19 2010 Jan Safranek - 1:5.5-20 +- Remove rpath from net-snmp-config output (#554747) + +* Wed Aug 4 2010 Jan Safranek - 1:5.5-19 +- Add APSL 2.0 license to COPYING file + +* Wed Jul 21 2010 David Malcolm - 1:5.5-18 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Tue Jul 20 2010 Jan Safranek - 1:5.5-17 +- fixed temporary filename generation in snmptrapd (#616347) + +* Mon Jun 28 2010 Jan Safranek - 1:5.5-16 +- rebuild for new perl + +* Wed Jun 16 2010 Jan Safranek - 1:5.5-14 +- add missing struct.h header file (#603243) + +* Wed Jun 16 2010 Jan Safranek - 1:5.5-13 +- add missing include files from util_funcs directory (#603243) + +* Tue Jun 01 2010 Marcela Maslanova - 1:5.5-13 +- Mass rebuild with perl-5.12.0 + +* Tue Feb 2 2010 Jan Safranek - 1:5.5-12 +- store temporary files in /var/run/net-snmp instead of /tmp - + SELinux does not like it. + +* Tue Jan 12 2010 Stepan Kasal - 1:5.5-11 +- move the perl(:MODULE_COMPAT_5.10.x) require to net-snmp-libs + +* Tue Jan 12 2010 Jan Safranek - 1:5.5-10 +- document various legacy options in this spec file + +* Tue Jan 12 2010 Stepan Kasal - 1:5.5-9 +- require perl(:MODULE_COMPAT_5.10.x) because the package links against + libperl.so + +* Tue Jan 5 2010 Jan Safranek - 1:5.5-8 +- fix invalid access to memory in tcpListenerTable (#551030) + +* Mon Dec 21 2009 Jan Safranek - 1:5.5-7 +- fix crash with interfaces without broadcast addresses (like OpenVPN's tun0) + (#544849) + +* Tue Dec 8 2009 Jan Safranek - 1:5.5-6 +- fix compilation of the python module + +* Mon Dec 7 2009 Stepan Kasal - 1:5.5-5 +- rebuild against perl 5.10.1 + +* Wed Dec 2 2009 Jan Safranek 1:5.5-4 +- fix udpTable indexes on big-endian systems (#543352) +- fix snmptrapd init script to survive with empty /etc/sysconfig/snmptrapd +- lower the default log level of snmpd to get rid of the debug messages + +* Wed Nov 25 2009 Jan Safranek 1:5.5-3 +- prepare the .spec file for review +- run automatic regression suite after the compilation of the package + to check for obvious regressions +- remove unnecessary package dependencies + +* Tue Nov 24 2009 Jan Safranek 1:5.5-2 +- introduce /etc/sysconfig/snmptrapd. Use it to specify snmptrapd command + line options. /etc/snmp/snmptrapd.options is not used anymore (#540799) +- build-in ipAddressPrefixTable, ipDefaultRouterTable, ipv6ScopeZoneIndexTable, + ipIfStatsTable, SCTP-MIB, RMON-MIB and Etherlike-MIBs +- remove ucd5820stat helper script, it depends on get5820stats, which is not + available in Fedora +- move sample services ipf-mod.pl to documentation +- remove logrotate config, snmpd logs into syslog + +* Tue Sep 29 2009 Jan Safranek Jan Safranek 5.5-1 +- update to Net-SNMP 5.5 +- remove static libraries from -devel subpackage + +* Mon Sep 14 2009 Jan Safranek 1:5.4.2.1-17 +- implement force-reload command in initscripts (#523126) + +* Fri Aug 21 2009 Tomas Mraz - 1:5.4.2.1-16 +- rebuilt with new openssl + +* Fri Aug 14 2009 Orion Poplawski 1:5.4.2.1-15 +- Prevent post script failure on fresh installs + +* Sat Jul 25 2009 Fedora Release Engineering - 1:5.4.2.1-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Jul 1 2009 Jan Safranek 5.4.2.1-13 +- package cleanup, remove unnecessary patches +- move local state file from /var/net-snmp/ to /var/lib/net-snmp + +* Wed Jul 1 2009 Jan Safranek 5.4.2.1-12 +- make the default configuration less noisy, i.e. do not print "Connection from + UDP:" and "Received SNMP packet(s) from UDP:" messages on each connection. + (#509055) + +* Mon May 18 2009 Jan Safranek 5.4.2.1-11 +- fix divison-by-zero in cpu statistics (#501210) + +* Fri Mar 06 2009 Jesse Keating - 5.4.2.1-10 +- Rebuild for new rpm + +* Wed Feb 25 2009 Fedora Release Engineering - 1:5.4.2.1-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 16 2009 Jan Safranek 5.4.2.1-8 +- fix tcp_wrappers integration (CVE-2008-6123) + +* Fri Jan 30 2009 Karsten Hopp 5.4.2.1-7 +- fix build on s390x which has no libsensors + +* Sat Jan 17 2009 Tomas Mraz 5.4.2.1-7 +- rebuild with new openssl + +* Wed Dec 17 2008 Jan Safranek 5.4.2.1-6 +- rebuilt for new python again... + +* Mon Dec 1 2008 Jan Safranek 5.4.2.1-5 +- fix rpm ownership of all created directories (#473582) + +* Mon Dec 1 2008 Jan Safranek 5.4.2.1-4 +- Rebuild for fixed rpm (#473420) + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 1:5.4.2.1-3 +- Rebuild for Python 2.6 + +* Mon Nov 3 2008 Jan Safranek 5.4.2.1-1 +- explicitly require the right version and release of net-snmp and + net-snmp-libs +- update to net-snmp-5.4.2.1 to fix CVE-2008-4309 + +* Fri Sep 26 2008 Jan Safranek 5.4.2-3 +- further tune up the distribution of files among subpackages + and dependencies + +* Fri Sep 26 2008 Jan Safranek 5.4.2-2 +- redistribute the perl scripts to the net-snmp package, + net-snmp-utils doesn't depend on perl now (#462484) + +* Wed Sep 17 2008 Jan Safranek 5.4.2-1 +- update to net-snmp-5.4.2 + +* Wed Sep 10 2008 John A. Khvatov 5.4.1-22 +- add net-snmp-python + +* Tue Jul 22 2008 Jan Safranek 5.4.1-21 +- fix perl SNMP::Session::set (#452131) + +* Fri Jul 11 2008 Jan Safranek 5.4.1-20 +- prepare for new rpm version + +* Tue Jun 10 2008 Jan Safranek 5.4.1-19 +- fix various flaws (CVE-2008-2292 CVE-2008-0960) + +* Sat May 31 2008 Dennis Gilmore 5.4.1-18 +- fix sparc handling in /usr/bin/net-snmp-config + +* Thu May 29 2008 Dennis Gilmore 5.4.1-17 +- fix sparc handling in /usr/include/net-snmp/net-snmp-config-sparc.h + +* Sun May 25 2008 Dennis Gilmore 5.4.1-16 +-sparc multilib handling + +* Mon Apr 21 2008 Jan Safranek 5.4.1-15 +- explicitly require lm_sensor > 3 for build (#442718) +- create multilib net-snmp-config on multilib architectures only + +* Tue Mar 18 2008 Tom "spot" Callaway 5.4.1-14 +- add Requires for versioned perl (libperl.so) +- get rid of silly file Requires + +* Thu Mar 6 2008 Tom "spot" Callaway 5.4.1-13 +- BR: perl(ExtUtils::Embed) + +* Thu Mar 6 2008 Tom "spot" Callaway 5.4.1-12 +- rebuild for new perl + +* Thu Feb 21 2008 Jan Safranek 5.4.1-11 +- add openssl-devel to the list of netsnmp-devel deps + +* Thu Feb 14 2008 Jan Safranek 5.4.1-10 +- fixing ipNetToMediaNetAddress to show IP address (#432780) + +* Tue Feb 12 2008 Jan Safranek 5.4.1-9 +- introduce /etc/sysconfig/snmpd. Use it to specify snmpd command line options. + /etc/snmp/snmpd.options is not used anymore (#431391) + +* Mon Jan 28 2008 Jan Safranek 5.4.1-8 +- init scripts made LSB compliant + +* Wed Dec 5 2007 Jan Safranek 5.4.1-7 +- rebuild for openssl soname bump + +* Wed Nov 14 2007 Jan Safranek 5.4.1-6 +- add support of lm_sensors v3 +- added procps to build dependencies (#380321) +- removed beecrypt from dependencies +- fixed crash on reading xen interfaces (#386611) + +* Thu Oct 25 2007 Jan Safranek 5.4.1-5 +- move mib2c-update from net-snmp-utils to net-snmp-perl, where + mib2c is located +- add tkmib to net-snmp-gui package (#167933) + +* Tue Oct 16 2007 Jan Safranek 5.4.1-4 +- License: field fixed to "BSD and CMU" + +* Thu Aug 23 2007 Jan Safranek 5.4.1-3 +- include these tables: ip-mib/ipv4InterfaceTable + ip-mib/ipv6InterfaceTable, ip-mib/ipAddressPrefixTable +- fix Requires of net-snmp-devel to include lmsensors-devel on supported + architectures + +* Wed Aug 22 2007 Jan Safranek 5.4.1-2 +- gawk added to build dependencies + +* Tue Aug 7 2007 Jan Safranek 5.4.1-1 +- License: field changed to MIT +- 5.4.1 integrated + +* Tue Jul 31 2007 Jan Safranek 5.4-16 +- supported lm_sensors on ppc64 (#249255) +- snmpconf generates config files with proper selinux context + (#247462) +- fix leak in udp transport (#247771) +- add alpha to supported archs in net-snmp-config (#246825) +- fix hrSWInst (#250237) + +* Thu Jun 28 2007 Jan Safranek 5.4-15 +- fix default snmptrapd.conf + +* Thu May 3 2007 Jan Safranek 5.4-14 +- fix snmptrapd hostname logging (#238587) +- fix udpEndpointProcess remote IP address (#236551) +- fix -M option of net-snmp-utils (#244784) +- default snmptrapd.conf added (#243536) +- fix crash when multiple exec statements have the same name + (#243536) +- fix ugly error message when more interfaces share + one IP address (#209861) + +* Mon Mar 12 2007 Radek Vokál - 1:5.4-13 +- fix overly verbose log message (#221911) +- few minor tweaks for review - still not perfect +- fix linking with lcrypto (#231805) + +* Fri Mar 9 2007 Radek Vokál - 5.4-12 +- lm_sensors-devel only where avaliable + +* Thu Mar 1 2007 Radek Vokál - 5.4-11 +- fix lm_sensors-devel Requires (#229109) + +* Mon Feb 26 2007 Vitezslav Crhonek - 5.4-10 +- fix net-snmp-config strange values for --libs (#228588) + +* Fri Feb 23 2007 Radek Vokál - 5.4-9 +- fix dependency on lm_sensors-devel (#229109) +- spec file cleanups + +* Tue Jan 23 2007 Radek Vokál - 5.4-8 +- fix occasional segfaults when snmpd starts + +* Thu Jan 11 2007 Radek Vokál - 5.4-7 +- fix ethtool extension (#222268) + +* Thu Jan 11 2007 Radek Vokál - 5.4-6 +- swith to new disman implementation + +* Tue Dec 12 2006 Radek Vokál - 5.4-5 +- fix memleaks in ip-addr and tcpConn + +* Thu Dec 7 2006 Radek Vokál - 5.4-4 +- fix rtnetlink.h/if_addr.h + +* Thu Dec 7 2006 Joe Orton - 5.4-3 +- add Requires for tcp_wrappers-devel for -devel + +* Mon Dec 4 2006 Radek Vokál - 5.4-2 +- rebuilt against tcp_wrappers-devel + +* Mon Nov 27 2006 Radek Vokal - 5.4-1 +- upgrade to 5.4 +- patch cleanup +- snmpd uses /var/run/snmpd.pid (#211264) + +* Sun Oct 01 2006 Jesse Keating - 5.3.1-11 +- rebuilt for unwind info generation, broken in gcc-4.1.1-21 + +* Mon Sep 25 2006 Radek Vokal 5.3.1-10 +- add mibII/mta_sendmail (#207909) + +* Fri Sep 22 2006 Radek Vokal 5.3.1-9 +- fix deprecated syscall base_reachable_time (#207273) + +* Wed Sep 13 2006 Radek Vokal 5.3.1-8 +- enable smux to listen only on LOCAL by default (#181667) +- use correct answer adrress + +* Tue Sep 5 2006 Radek Vokal 5.3.1-7 +- better upstream patch for byteorder +- add epoch to corespond with upstream versioning + +* Wed Aug 30 2006 Radek Vokal 5.3.1.0-6 +- fix IPv4/IPv6 address presentation (#200255) + +* Wed Aug 23 2006 Radek Vokal 5.3.1.0-5 +- SMUX support is still needed .. will disappear later! +- static libs should be in devel not libs (#203571) +- fix lm_sensors issues + +* Tue Aug 22 2006 Radek Vokal 5.3.1.0-4 +- turn off SMUX support (#110931) +- add dist tag + +* Thu Aug 10 2006 Radek Vokal 5.3.1.0-3 +- fix lib dirs in configure (#197684) + +* Thu Aug 3 2006 Radek Vokal 5.3.1.0-2 +- better patch for depreciated sysctl call + +* Mon Jul 17 2006 Radek Vokal 5.3.1.0-1 +- update to 5.3.1 final version, fix version number + +* Wed Jul 12 2006 Radek Vokál 5.3.1.rc4-2 +- fix init script, read .options files from /etc/snmp (#195702) + +* Wed Jul 12 2006 Jesse Keating - 5.3.1.rc4-1.1 +- rebuild + +* Mon Jul 10 2006 Radek Vokal 5.3.1.rc4-1 +- update to release candidate 4 +- fix lib dependencies on 64bit archs +- supress perl build + +* Tue Jun 13 2006 Radek Vokal 5.3.1.pre3-2 +- add tcp-mib (#194856) + +* Fri Jun 2 2006 Radek Vokal 5.3.1.pre3-1 +- update to another prerelease (fixes perl agents) + +* Fri May 26 2006 Radek Vokal 5.3.1.pre2-4 +- fix lib version + +* Thu May 25 2006 Radek Vokal 5.3.1.pre2-3 +- another multilib fix. Fix also net-snmp-config script + +* Wed May 24 2006 Radek Vokal 5.3.1.pre2-2 +- another attempt to fix multilib issue. Generate dummy net-snmp-config.h file + +* Tue May 23 2006 Radek Vokal 5.3.1.pre2-1 +- update to 5.3.1.pre2 +- fix multilib issues (#192736) + On system with /usr/lib64 use net-snmp-config64 and net-snmp-config64.h + +* Sat Apr 15 2006 Radek Vokál 5.3-8 +- fix missing IF-MIB::ifNumber.0 (#189007) + +* Wed Apr 05 2006 Radek Vokál 5.3-7 +- fix parsing of /proc/diskstats +- fix disman monitor crash +- fix perl vendor name +- fix OID lookup fail + +* Sat Mar 25 2006 Radek Vokal 5.3-6 +- use net.ipv6.neigh.lo.retrans_time_ms (#186546) + +* Mon Mar 20 2006 Radek Vokal 5.3-5 +- allow disman/event-mib + +* Fri Feb 10 2006 Jesse Keating - 5.3-4.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 5.3-4.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Thu Feb 2 2006 Radek Vokál 5.3-4 +- fix crash on s390x and ppc64 + +* Mon Jan 30 2006 Radek Vokál 5.3-3 +- fix for lm_Senors, the max is no longer a fixed value +- parsing fixed for /proc/net/if_inet6 + +* Wed Jan 18 2006 Radek Vokal 5.3-2 +- Security fix. Bug granting write access to read-only users + or communities which were configured using the "rocommunity" + or "rouser" snmpd.conf tokens fixed + +* Fri Dec 30 2005 Radek Vokal +- upgrade to 5.3 + +* Fri Dec 16 2005 Jesse Keating +- rebuilt for new gcj + +* Fri Dec 16 2005 Radek Vokal - 5.2.2-4 +- check for header files in configure +- patch for SNMPv3 traps / session user creation (net-snmp bz#1374087) + +* Fri Dec 09 2005 Radek Vokal - 5.2.2-3 +- fix ipaddr return type on 64bit machines + +* Wed Dec 07 2005 Radek Vokal - 5.2.2-2 +- fix read problem on stream sockets (net-snmp bz#1337534) + +* Tue Nov 29 2005 Radek Vokal - 5.2.2-1 +- upgrade to 5.2.2 final + +* Mon Nov 21 2005 Radek Vokal - 5.2.2-0.rc6.1 +- update to rc6, snmpnetstat changes due to license problems +- persistent files in directory defined by snmp.conf persistentDir are + loaded at startup + +* Tue Nov 15 2005 Radek Vokal - 5.2.2-0.rc5.1 +- another release candidate + +* Tue Nov 08 2005 Radek Vokal - 5.2.2-0.rc4.2 +- Remove .la file from net-snmp-libs (#172618) +- grab new openssl + +* Mon Nov 07 2005 Radek Vokal - 5.2.2-0.rc4.1 +- update to release candidate 4 + +* Tue Nov 01 2005 Radek Vokal - 5.2.2-0.rc3.1 +- release candidate 3 of net-snmp-5.2.2 + +* Tue Oct 25 2005 Radek Vokal - 5.2.2.rc2-1 +- rc2 prebuilt + +* Tue Sep 20 2005 Radek Vokal - 5.2.1.2-3 +- fix endian issues for addresses + +* Fri Aug 12 2005 Radek Vokal - 5.2.1.2-2 +- fix for s390x counter32 overflow (sachinp@in.ibm.com) + +* Wed Jul 13 2005 Radek Vokal - 5.2.1.2-1 +- CAN-2005-2177 new upstream version fixing DoS (#162908) + +* Tue May 31 2005 Radek Vokal - 5.2.1-13 +- CAN-2005-1740 net-snmp insecure temporary file usage (#158770) +- patch from suse.de + +* Wed May 18 2005 Radek Vokal - 5.2.1-12 +- session free fixed, agentx modules build fine (#157851) +- fixed dependency for net-snmp libs (#156932) + +* Wed May 04 2005 Radek Vokal - 5.2.1-11 +- report gigabit Ethernet speeds using Ethtool (#152480) + +* Tue Apr 19 2005 Radek Vokal - 5.2.1-10 +- fixed missing requires for devel package (#155221) + +* Wed Apr 06 2005 Radek Vokal - 5.2.1-9 +- switching to a different 64bit patch, hopefully 64bit problems are gone for a while + +* Mon Apr 04 2005 Radek Vokal - 5.2.1-8 +- net-snmp properly deals with large partitions (#153101) + +* Thu Mar 31 2005 Radek Vokal - 5.2.1-7 +- agentx double free error fix + +* Thu Mar 24 2005 Radek Vokal - 5.2.1-6 +- fixed unexpected length for type ASN_UNSIGNED (#151892) +- fixed uptime problems on ia64 + +* Wed Mar 09 2005 Radek Vokal - 5.2.1-5 +- 64bit needed some changes, was causing timeouts on 64bit archs!? +- affects bugs #125432 and #132058 + +* Tue Mar 1 2005 Tomas Mraz - 5.2.1-4 +- rebuild with openssl-0.9.7e + +* Wed Feb 23 2005 Radek Vokal - 5.1.2-3 +- patch from CVS - kill extra carriage return (#144917) +- removed patch for interface indexing - doesn't show virtual interfaces + +* Tue Feb 8 2005 Jeremy Katz - 5.2.1-2 +- rebuild for new librpm + +* Mon Jan 31 2005 Radek Vokal 5.2.1-1 +- new release, fixing several issues +- pointer needs to be inicialized (#146417) + +* Mon Dec 27 2004 Radek Vokal 5.2-2 +- patch adding ipv6 support to ip system stats + +* Tue Nov 30 2004 Radek Vokal 5.2-1 +- net-snmp-5.2, patch clean-up + +* Mon Nov 15 2004 Radek Vokal 5.1.2-12 +- snmpd crash with 'interfaces' directives in snmpd.conf fixed #139010 +- rather dirty patch fixing conf directory for net-snmp-config + +* Fri Oct 15 2004 Radek Vokal 5.1.2-11 +- Logrotate support added (#125004) + +* Thu Oct 14 2004 Phil Knirsch 5.1.2-10 +- Extended the libwrap and bsdcompat patches + +* Mon Oct 11 2004 Phil Knirsch 5.1.2-9 +- Droped obsolete lm-sensors patch and enabled lmSensors module +- Marked several patches to be removed for 5.1.3 + +* Wed Sep 29 2004 Warren Togami 5.1.2-8 +- remove README* that do not apply to Linux +- trim massive ChangeLog + +* Wed Sep 22 2004 Florian La Roche +- move ldconfig post/postun to libs subrpm + +* Wed Sep 15 2004 Phil Knirsch 5.1.2-6 +- Split out libs package for multilib compatibility + +* Wed Sep 08 2004 Radek Vokal 5.1.2-4 +- New prereq for net-snmp-devel +- lelf check removed from configure.in (#128748) +- fixed snmpd coredump when sent SIGHUP (#127314) + +* Tue Sep 07 2004 Radek Vokal 5.1.2-3 +- Agentx failed to send trap, fixed (#130752, #122338) + +* Mon Sep 06 2004 Radek Vokal 5.1.2-2 +- Patch fixing uninitalized stack variable in smux_trap_process (#130179) + +* Wed Aug 18 2004 Phil Knirsch 5.1.2-1 +- Update to 5.1.2 +- Removed net-snmp-5.0.1-initializer patch, included upstream + +* Tue Jun 15 2004 Phil Knirsch +- Fixed small bug in snmptrapd initscript (#126000). + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Thu May 06 2004 Phil Knirsch 5.1.1-3 +- Reworked the perl filelist stuff (Thanks to marius feraru). + +* Thu Apr 08 2004 Phil Knirsch 5.1.1-2 +- Added Kaj J. Niemi that fixes ipAdEntIfIndex problem (#119106) +- Added Kaj J. Niemi to shut up memshared message for 2.6 kernel (#119203) + +* Tue Mar 23 2004 Phil Knirsch 5.1.1-1 +- Update to latest upstream version 5.1.1 +- Included updated patches from Kaj J. Niemi (#118580). + +* Thu Mar 18 2004 Phil Knirsch 5.1-12 +- Hacked an ugly perl hack to get rid of perl RPATH problems. +- Fixed 64bit patch and applied it. ;-) + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Wed Feb 04 2004 Phil Knirsch 5.1-10 +- Included 64bit fix from Mark Langsdorf (#114645). + +* Tue Feb 03 2004 Phil Knirsch 5.1-9 +- Reverted removal of _includir redefiniton due to php-snmp dependancy. +- Remove SO_BSDCOMPAT setsockopt() call, deprecated. + +* Thu Jan 29 2004 Phil Knirsch 5.1-8 +- Quite a bit of specfile cleanup from Marius FERARU. + +* Thu Jan 22 2004 Thomas Woerner 5.1-7 +- enabled pie (snmpd, snmptrapd) - postponed for ia64 +- added --with-pic to configure call + +* Thu Jan 15 2004 Phil Knirsch 5.1-6 +- Fixed 64bit build problems when 32bit popt lib is installed. + +* Tue Jan 13 2004 Phil Knirsch 5.1-5 +- rebuilt + +* Sun Jan 11 2004 Florian La Roche 5.1-4 +- rebuild for new rpm + +* Wed Dec 10 2003 Phil Knirsch 5.1-3 +- Removed snmpcheck again, needs perl(Tk) which we don't ship (#111194). +- Fixed getopt definition in include file (#111209). +- Included Kaj J. Niemi's patch for broken perl module (#111319). +- Included Kaj J. Niemi's patch for broken async getnext perl call (#111479). +- Included Kaj J. Niemi's patch for broken hr_storage (#111502). + +* Wed Nov 26 2003 Phil Knirsch 5.1-2 +- Included BuildPrereq on lm_sensors-devel on x86 archs (#110616). +- Fixed deprecated initscript options (#110618). + +* Wed Nov 19 2003 Phil Knirsch 5.1-1 +- Updated to latest net-snmp-5.1 upstream version. +- Tons of specfile and patch cleanup. +- Cleaned up perl stuff (mib2c etc, see #107707). +- Added lm_sensors support patch for x86 archs from Kaj J. Niemi (#107618). +- Added support for custom mib paths and mibs to snmptrapd initscript (#102762) + +* Mon Oct 13 2003 Phil Knirsch 5.0.9-2 +- Due to rpm-devel we need elfutils-devel, too (#103982). + +* Mon Sep 29 2003 Phil Knirsch 5.0.9-1 +- Updated to latest upstream version net-snmp-5.0.9 +- Added patch to fix net-snmp-perl problems (#105842). + +* Tue Sep 23 2003 Florian La Roche +- allow compiling without tcp_wrappers + +* Wed Sep 17 2003 Phil Knirsch 5.0.8-11.1 +- rebuilt + +* Wed Sep 17 2003 Phil Knirsch 5.0.8-11 +- Fixed permission for net-snmp-config in net-snmp-devel + +* Mon Sep 08 2003 Phil Knirsch 5.0.8-10.1 +- rebuilt + +* Mon Sep 08 2003 Phil Knirsch 5.0.8-10 +- Moved net-snmp-config into devel package (#103927) + +* Fri Aug 22 2003 Phil Knirsch 5.0.8-9.1 +- rebuilt + +* Thu Aug 21 2003 Phil Knirsch 5.0.8-9 +- Added sample config to make net-snmp RFC 1213 compliant. + +* Fri Aug 15 2003 Phil Knirsch 5.0.8-8 +- Fixed problem with perl option (#102420). +- Added patch for libwrap fix (#77926). + +* Tue Aug 12 2003 Phil Knirsch 5.0.8-7.1 +- rebuilt + +* Tue Aug 12 2003 Phil Knirsch 5.0.8-7 +- Fixed build problems on ppc64 +- Fixed double packaged manpages (#102075). + +* Thu Aug 07 2003 Phil Knirsch +- Fixed problem with new proc output (#98619, #89960). + +* Wed Aug 06 2003 Phil Knirsch +- Fixed ro/rw problem with v2 and v3 request (#89612) + +* Tue Aug 05 2003 Phil Knirsch +- Fixed permission problem for debuginfo (#101456) + +* Thu Jul 31 2003 Phil Knirsch 5.0.8-6.1 +- Fixed file list for latest build. + +* Thu Jul 31 2003 Phil Knirsch 5.0.8-6 +- Fixed build problems for net-snmp-perl. + +* Sun Jul 27 2003 Florian La Roche 5.0.8-5 +- actually apply ipv6 patch + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Tue Apr 29 2003 Phil Knirsch 5.0.8-3 +- bumped release and rebuilt. + +* Tue Apr 29 2003 Phil Knirsch 5.0.8-2 +- Hack to make it build on 64bit platforms with /usr/lib64 correctly. +- Fixed bug #85071 (leak of open descriptors for ipv6). + +* Fri Mar 28 2003 Phil Knirsch 5.0.8-1 +- Updated to latest upstream version 5.0.8 (bug #88580) + +* Thu Feb 13 2003 Phil Knirsch +- Included generation of perl stuff. Thanks to Harald Hoyer. + +* Wed Feb 12 2003 Phil Knirsch 5.0.7-1 +- Updated to net-snmp-5.0.7. Fixed especially the performance problem with + limited trees. + +* Tue Feb 11 2003 Phil Knirsch 5.0.6-17 +- Fixed ucd-snmp.redhat.conf (#78391). +- Fixed snmpwalk examples in config file. + +* Mon Feb 10 2003 Phil Knirsch 5.0.6-15 +- Fixed invalid SMUX packet (#83487). + +* Thu Feb 06 2003 Phil Knirsch 5.0.6-14 +- Fixed the libdir problem. + +* Wed Feb 05 2003 Phil Knirsch 5.0.6-13 +- Updated the old libtool rpath patch. + +* Wed Jan 22 2003 Tim Powers 5.0.6-12 +- rebuilt + +* Tue Jan 14 2003 Phil Knirsch 5.0.6-11 +- Updated nolibelf patch and activated it again. + +* Tue Jan 7 2003 Nalin Dahyabhai 5.0.6-10 +- Rebuild + +* Tue Dec 17 2002 Phil Knirsch 5.0.6-9 +- Added bzip2-devel to BuildPreReq (#76086, #70199). + +* Thu Nov 28 2002 Phil Knirsch 5.0.6-8 +- Added patch to increase SMUXMAXSTRLEN. + +* Thu Nov 7 2002 Tim Powers 5.0.6-6 +- rebuilt to fix broken deps +- remove files from the buildroot that we don't want to ship + +* Thu Nov 7 2002 Joe Orton 5.0.6-5 +- add fix for -DUCD_COMPATIBLE (#77405) + +* Thu Nov 07 2002 Phil Knirsch 5.0.6-4 +- Another bump required. Some more specfile changes. + +* Wed Nov 06 2002 Phil Knirsch 5.0.6-3 +- Bumped release and rebuilt. +- Removed all dbFOO cruft again. + +* Wed Oct 09 2002 Phil Knirsch 5.0.6-2 +- Updated to latest released version. + +* Sat Aug 31 2002 Florian La Roche +- do not link against -lelf + +* Thu Jun 27 2002 Phil Knirsch 5.0.1-5 +- Added --enable-ucd-snmp-compatibility for compatibility with older version + and fixed installation thereof. +- Got rid of the perl(Tk) dependancy by removing snmpcheck. +- Include /usr/include/ucd-snmp in the filelist. +- Fixed a problem with the ucd-snmp/version.h file. + +* Wed Jun 26 2002 Phil Knirsch 5.0.1-1 +- Updated to 5.0.1 +- Dropped --enable-reentrant as it's currently broken + +* Tue Apr 23 2002 Phil Knirsch 5.0-1 +- Switch to latest stable version, 5.0 +- Renamed the packate to net-snmp and obsoleted ucd-snmp. + +* Wed Apr 17 2002 Phil Knirsch 4.2.4-3 +- Fixed problem with reload in initscript (#63526). + +* Mon Apr 15 2002 Tim Powers 4.2.4-2 +- rebuilt in new environment + +* Mon Apr 15 2002 Tim Powers 4.2.4-1 +- update to 4.2.4 final + +* Sat Apr 13 2002 Phil Knirsch 4.2.4.pre3-5 +- Added some missing files to the %%files section. + +* Tue Apr 09 2002 Phil Knirsch 4.2.4.pre3-4 +- Hardcoded the ETC_MNTTAB to point to "/etc/mtab". + +* Mon Apr 08 2002 Phil Knirsch 4.2.4.pre3-3 +- Removed the check for dbFOO as we don't want to add another requirement. + +* Fri Apr 05 2002 Phil Knirsch 4.2.4.pre3-2 +- Added missing BuildPrereq to openssl-devel (#61525) + +* Thu Apr 04 2002 Phil Knirsch 4.2.4.pre3-1 +- Added ucd5820stat to the files section. +- Updated to latest version (4.2.4.pre3) + +* Mon Mar 18 2002 Phil Knirsch 4.2.4.pre2-1 +- Updated to latest version (4.2.4.pre2) + +* Tue Jan 29 2002 Phil Knirsch 4.2.3-4 +- Added the snmptrapd init script as per request (#49205) +- Fixed the again broken rpm query stuff (#57444) +- Removed all old and none-used db related stuff (libs and header checks/files) + +* Mon Jan 07 2002 Phil Knirsch 4.2.3-2 +- Included the Axioma Security Research fix for snmpnetstat from bugtraq. + +* Mon Dec 03 2001 Phil Knirsch 4.2.3-1 +- Update to 4.2.3 final. +- Fixed libtool/rpath buildroot pollution problem. +- Fixed library naming problem. + +* Fri Oct 5 2001 Philipp Knirsch +- Fixed a server segfault for snmpset operation (#53640). Thanks to Josh Giles + and Wes Hardaker for the patch. + +* Mon Sep 10 2001 Philipp Knirsch +- Fixed problem with RUNTESTS script. + +* Tue Sep 4 2001 Preston Brown +- fixed patch related to bug #35016 (Dell) + +* Fri Aug 24 2001 Philipp Knirsch 4.2.1-6 +- Fixed snmpd description (#52366) + +* Wed Aug 22 2001 Philipp Knirsch +- Final bcm5820 fix. Last one was broken. +- Fixed bugzilla bug (#51960) where the binaries contained rpath references. + +* Wed Aug 15 2001 Philipp Knirsch +- Fixed a couple of security issues: + o /tmp race and setgroups() privilege problem + o Various buffer overflow and format string issues. + o One signedness problem in ASN handling. +- Fixed an important RFE to support bcm5820 cards. (#51125) + +* Fri Jul 20 2001 Philipp Knirsch +- Removed tkmib from the package once again as we don't ship the Tk.pm CPAN + perl module required to run it (#49363) +- Added missing Provides for the .so.0 libraries as rpm doesn't seem to find + those during the build anymore (it used to) (#46388) + +* Thu Jul 19 2001 Philipp Knirsch +- Enabled IPv6 support (RFE #47764) +- Hopefully final fix of snmpwalk problem (#42153). Thanks to Douglas Warzecha + for the patch and Matt Domsch for reporting the problem. + +* Tue Jun 26 2001 Philipp Knirsch +- Fixed smux compilation problems (#41452) +- Fixed wrong paths displayed in manpages (#43053) + +* Mon Jun 25 2001 Philipp Knirsch +- Updated to 4.2.1. Removed 2 obsolete patches (fromcvs and #18153) +- Include /usr/share/snmp/snmpconf in %%files + +* Wed Jun 13 2001 Than Ngo +- fix to use libwrap in distro +- add buildprereq: tcp_wrappers + +* Fri Jun 1 2001 Bill Nottingham +- add a *new* patch for IP address return sizes + +* Fri Apr 20 2001 Bill Nottingham +- add patch so that only four bytes are returned for IP addresses on ia64 (#32244) + +* Wed Apr 11 2001 Bill Nottingham +- rebuild (missing alpha packages) + +* Fri Apr 6 2001 Matt Wilson +- added ucd-snmp-4.2-null.patch to correcly handle a NULL value (#35016) + +* Tue Apr 3 2001 Preston Brown +- clean up deinstallation (#34168) + +* Tue Mar 27 2001 Matt Wilson +- return a usable RETVAL when running "service snmpd status" (#33571) + +* Tue Mar 13 2001 Matt Wilson +- configure with --enable-reentrant and added "smux" and "agentx" to + --with-mib-modules= argument (#29626) + +* Fri Mar 2 2001 Nalin Dahyabhai +- rebuild in new environment + +* Mon Feb 26 2001 Tim Powers +- fixed initscript, for reload and restart it was start then stop, + fixed. (#28477) + +* Fri Feb 2 2001 Trond Eivind Glomsrod +- i18nize initscript + +* Sat Jan 6 2001 Jeff Johnson +- don't depend on /etc/init.d so that package will work with 6.2. +- perl path fiddles no longer needed. +- rely on brp-compress frpm rpm to compress man pages. +- patch from ucd-snmp CVS (Wes Hardaker). +- configure.in needs to check for rpm libraries correctly (#23033). +- add simple logrotate script (#21399). +- add options to create pidfile and log with syslog with addresses (#23476). + +* Sat Dec 30 2000 Jeff Johnson +- package for Red Hat 7.1. + +* Thu Dec 07 2000 Wes Hardaker +- update for 4.2 + +* Thu Oct 12 2000 Jeff Johnson +- add explicit format for syslog call (#18153). + +* Thu Jul 20 2000 Bill Nottingham +- move initscript back + +* Thu Jul 20 2000 Jeff Johnson +- rebuild per Trond's request. + +* Tue Jul 18 2000 Nalin Dahyabhai +- fix syntax error that crept in with condrestart + +* Wed Jul 12 2000 Prospector +- automatic rebuild + +* Mon Jul 10 2000 Preston Brown +- move initscript and add condrestart magic + +* Sat Jun 17 2000 Bill Nottingham +- fix %%attr on man pages + +* Mon Jun 12 2000 Jeff Johnson +- tkmib doco had #!/usr/bin/perl55 +- include snmpcheck and tkmib again (still needs some CPAN module, however). + +* Tue Jun 6 2000 Jeff Johnson +- update to 4.1.2. +- FHS packaging. +- patch for rpm 4.0. + +* Thu May 18 2000 Trond Eivind Glomsrod +- add version to buildroot +- rebuilt with new libraries + +* Sun Feb 27 2000 Jeff Johnson +- default config was broken (from Wes Hardaker) (#9752) + +* Sun Feb 13 2000 Jeff Johnson +- compressed man pages. + +* Fri Feb 11 2000 Wes Hardaker +- update to 4.1.1 + +* Sat Feb 5 2000 Florian La Roche +- change %%postun to %%preun + +* Thu Feb 3 2000 Elliot Lee +- Don't ship tkmib, since we don't ship the perl modules needed to run it. +(Bug #4881) + +* Tue Aug 31 1999 Jeff Johnson +- default config permits RO access to system group only (Wed Hardaker). + +* Sun Aug 29 1999 Jeff Johnson +- implement suggestions from Wes Hardaker. + +* Fri Aug 27 1999 Jeff Johnson +- stateless access to rpm database. + +* Wed Aug 25 1999 Jeff Johnson +- update to 4.0.1. + +* Mon Aug 16 1999 Bill Nottingham +- initscript munging + +* Sat Jun 12 1999 Jeff Johnson +- update to 3.6.2 (#3219,#3259). +- add missing man pages (#3057). + +* Thu Apr 8 1999 Wes Hardaker +- fix Source0 location. +- fix the snmpd.conf file to use real community names. + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 3) + +* Fri Mar 19 1999 Preston Brown +- upgrade to 3.6.1, fix configuration file stuff. + +* Wed Feb 24 1999 Preston Brown +- Injected new description and group. + +* Tue Feb 2 1999 Jeff Johnson +- restore host resources mib +- simplified config file +- rebuild for 6.0. + +* Tue Dec 22 1998 Bill Nottingham +- remove backup file to fix perl dependencies + +* Tue Dec 8 1998 Jeff Johnson +- add all relevant rpm scalars to host resources mib. + +* Sun Dec 6 1998 Jeff Johnson +- enable libwrap (#253) +- enable host module (rpm queries over SNMP!). + +* Mon Oct 12 1998 Cristian Gafton +- strip binaries + +* Fri Oct 2 1998 Jeff Johnson +- update to 3.5.3. +- don't include snmpcheck until perl-SNMP is packaged. + +* Thu Aug 13 1998 Jeff Johnson +- ucd-snmpd.init: start daemon w/o -f. + +* Tue Aug 4 1998 Jeff Johnson +- don't start snmpd unless requested +- start snmpd after pcmcia. + +* Sun Jun 21 1998 Jeff Johnson +- all but config (especially SNMPv2p) ready for prime time + +* Sat Jun 20 1998 Jeff Johnson +- update to 3.5. + +* Tue Dec 30 1997 Otto Hammersmith +- created the package... possibly replace cmu-snmp with this.