rpms/net-snmp/devel net-snmp-5.2.2-rh9-headers.patch, NONE, 1.1 net-snmp-5.2.2-snmpv3-traps.patch, NONE, 1.1 net-snmp.spec, 1.57, 1.58

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Fri Dec 16 09:10:00 UTC 2005


Author: rvokal

Update of /cvs/dist/rpms/net-snmp/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv18331

Modified Files:
	net-snmp.spec 
Added Files:
	net-snmp-5.2.2-rh9-headers.patch 
	net-snmp-5.2.2-snmpv3-traps.patch 
Log Message:
 - check for header files in configure
 - patch for SNMPv3 traps / session user creation (net-snmp bz#1374087)



net-snmp-5.2.2-rh9-headers.patch:
 agent/mibgroup/if-mib/data_access/interface_linux.c |    3 +++
 configure                                           |    3 ++-
 configure.in                                        |    2 +-
 include/net-snmp/net-snmp-config.h.in               |    3 +++
 4 files changed, 9 insertions(+), 2 deletions(-)

--- NEW FILE net-snmp-5.2.2-rh9-headers.patch ---
Index: configure.in
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/configure.in,v
retrieving revision 5.134.2.47
diff -u -r5.134.2.47 configure.in
--- configure.in	7 Dec 2005 12:27:07 -0000	5.134.2.47
+++ configure.in	8 Dec 2005 10:28:46 -0000
@@ -2509,7 +2509,7 @@
 #endif
 ]])
 # Linux
-AC_CHECK_HEADERS(sys/conf.h netinet/tcp_fsm.h sys/protosw.h nlist.h ioctls.h asm/page.h netipx/ipx.h pci/pci.h)
+AC_CHECK_HEADERS(sys/conf.h netinet/tcp_fsm.h sys/protosw.h nlist.h ioctls.h asm/page.h asm/types.h netipx/ipx.h pci/pci.h)
 # Solaris
 AC_CHECK_HEADERS(inet/mib2.h)
 # NetBSD required headers
Index: configure
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/configure,v
retrieving revision 5.124.2.46
diff -u -r5.124.2.46 configure
--- configure	7 Dec 2005 12:30:24 -0000	5.124.2.46
+++ configure	8 Dec 2005 10:28:49 -0000
@@ -19440,7 +19440,8 @@
 
 
 
-for ac_header in sys/conf.h netinet/tcp_fsm.h sys/protosw.h nlist.h ioctls.h asm/page.h netipx/ipx.h pci/pci.h
+
+for ac_header in sys/conf.h netinet/tcp_fsm.h sys/protosw.h nlist.h ioctls.h asm/page.h asm/types.h netipx/ipx.h pci/pci.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
Index: include/net-snmp/net-snmp-config.h.in
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/include/net-snmp/net-snmp-config.h.in,v
retrieving revision 5.64.2.6
diff -u -r5.64.2.6 net-snmp-config.h.in
--- include/net-snmp/net-snmp-config.h.in	14 Oct 2005 22:45:36 -0000	5.64.2.6
+++ include/net-snmp/net-snmp-config.h.in	8 Dec 2005 10:28:49 -0000
@@ -206,6 +206,9 @@
 /* Define to 1 if you have the <asm/page.h> header file. */
 #undef HAVE_ASM_PAGE_H
 
+/* Define to 1 if you have the <asm/types.h> header file. */
+#undef HAVE_ASM_TYPES_H
+
 /* Define to 1 if you have the `bcopy' function. */
 #undef HAVE_BCOPY
 
Index: agent/mibgroup/if-mib/data_access/interface_linux.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/if-mib/data_access/interface_linux.c,v
retrieving revision 1.20.2.4
diff -u -r1.20.2.4 interface_linux.c
--- agent/mibgroup/if-mib/data_access/interface_linux.c	15 Jun 2005 21:39:50 -0000	1.20.2.4
+++ agent/mibgroup/if-mib/data_access/interface_linux.c	8 Dec 2005 10:28:49 -0000
@@ -23,6 +23,9 @@
 #include <sys/types.h>
 
 #ifdef HAVE_LINUX_ETHTOOL_H
+#   ifdef HAVE_ASM_TYPES_H
+#      include <asm/types.h>
+#   endif /* HAVE_ASM_TYPES_H */
 #   ifdef HAVE_PCI_PCI_H
 #      include <pci/pci.h> /* for u32 typedef in linux/ethtool */
 #   endif /* HAVE_PCI_PCI_H */
net-snmp-5.2.2-snmpv3-traps.patch:
 include/net-snmp/library/snmp_api.h |    3 ++-
 snmplib/snmp_api.c                  |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 1 deletion(-)

--- NEW FILE net-snmp-5.2.2-snmpv3-traps.patch ---
Index: snmplib/snmp_api.c
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/snmplib/snmp_api.c,v
retrieving revision 5.91
diff -u -p -r5.91 snmp_api.c
--- snmplib/snmp_api.c	16 Nov 2005 15:10:19 -0000	5.91
+++ snmplib/snmp_api.c	30 Nov 2005 21:04:59 -0000
@@ -1439,6 +1439,13 @@ _sess_open(netsnmp_session * in_session)
         snmp_sess_close(slp);
         return 0;
     }
+    if (create_user_from_session(slp->session) != SNMPERR_SUCCESS) {
+        in_session->s_snmp_errno = SNMPERR_UNKNOWN_USER_NAME;       /* XX?? */
+        DEBUGMSGTL(("snmp_api",
+                    "_sess_open(): failed(2) to create a new user from session\n"));
+        return 0;
+    }
+    
     session->flags &= ~SNMP_FLAGS_DONT_PROBE;
 
 
@@ -1571,6 +1578,12 @@ snmp_sess_add_ex(netsnmp_session * in_se
             snmp_sess_close(slp);
             slp = NULL;
         }
+        if (create_user_from_session(slp->session) != SNMPERR_SUCCESS) {
+            slp->session->s_snmp_errno = SNMPERR_UNKNOWN_USER_NAME;
+            DEBUGMSGTL(("snmp_api",
+                        "_sess_open(): failed(2) to create a new user from session\n"));
+            return 0;
+        }
     }
 
     return (void *) slp;
@@ -1626,6 +1639,18 @@ create_user_from_session(netsnmp_session
     u_char *cp;
 
     /*
+     * - don't create-another/copy-into user for this session by default
+     * - bail now (no error) if we don't have an engineID
+     */
+    if (SNMP_FLAGS_USER_CREATED == (session->flags & SNMP_FLAGS_USER_CREATED) ||
+        session->securityModel != SNMP_SEC_MODEL_USM ||
+        session->version != SNMP_VERSION_3 ||
+        session->securityEngineIDLen == 0)
+        return SNMPERR_SUCCESS;
+
+    session->flags |= SNMP_FLAGS_USER_CREATED;
+
+    /*
      * now that we have the engineID, create an entry in the USM list
      * for this user using the information in the session 
      */
@@ -4711,6 +4743,16 @@ _sess_async_send(void *sessp,
             return 0; /* s_snmp_errno already set */
     }
 
+    /*
+     * check to see if we need to create a v3 user from the session info
+     */
+    if (create_user_from_session(session) != SNMPERR_SUCCESS) {
+        session->s_snmp_errno = SNMPERR_UNKNOWN_USER_NAME;  /* XX?? */
+        DEBUGMSGTL(("snmp_api",
+                    "snmp_sess_open(): failed(2) to create a new user from session\n"));
+        return 0;
+    }
+
     if ((pktbuf = malloc(2048)) == NULL) {
         DEBUGMSGTL(("sess_async_send",
                     "couldn't malloc initial packet buffer\n"));
Index: include/net-snmp/library/snmp_api.h
===================================================================
RCS file: /cvsroot/net-snmp/net-snmp/include/net-snmp/library/snmp_api.h,v
retrieving revision 5.14
diff -u -p -r5.14 snmp_api.h
--- include/net-snmp/library/snmp_api.h	30 Aug 2005 00:24:45 -0000	5.14
+++ include/net-snmp/library/snmp_api.h	30 Nov 2005 21:04:59 -0000
@@ -394,7 +394,8 @@ typedef struct request_list {
 
 #define SNMP_DETAIL_SIZE        512
 
-#define SNMP_FLAGS_DONT_PROBE      0x100        /* don't probe for an engineID */
+#define SNMP_FLAGS_USER_CREATED    0x200      /* USM user has been created */
+#define SNMP_FLAGS_DONT_PROBE      0x100      /* don't probe for an engineID */
 #define SNMP_FLAGS_STREAM_SOCKET   0x80
 #define SNMP_FLAGS_LISTENING       0x40 /* Server stream sockets only */
 #define SNMP_FLAGS_SUBSESSION      0x20


Index: net-snmp.spec
===================================================================
RCS file: /cvs/dist/rpms/net-snmp/devel/net-snmp.spec,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- net-snmp.spec	9 Dec 2005 13:50:15 -0000	1.57
+++ net-snmp.spec	16 Dec 2005 09:09:55 -0000	1.58
@@ -3,7 +3,7 @@
 Summary: A collection of SNMP protocol tools and libraries.
 Name: net-snmp
 Version: 5.2.2
-Release: 3
+Release: 4
 License: BSDish
 Group: System Environment/Daemons
 URL: http://net-snmp.sourceforge.net/
@@ -30,6 +30,8 @@
 #net-snmp CVS
 Patch20: net-snmp-5.2.2-tcp-partial-packet.patch
 Patch21: net-snmp-5.2.2-ipaddr-size-64bit.patch
+Patch22: net-snmp-5.2.2-snmpv3-traps.patch
+Patch23: net-snmp-5.2.2-rh9-headers.patch
 
 Prereq: /sbin/chkconfig
 Obsoletes: ucd-snmp
@@ -131,6 +133,8 @@
 %patch19 -p1 -b .file_offset
 %patch20 -p0 -b .tcp-packet
 %patch21 -p0 -b .ip_addr
+%patch22 -p0 -b .traps
+%patch23 -p0 -b .rh9
 
 # Do this patch with a perl hack...
 perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@@ -313,6 +317,10 @@
 %{_libdir}/*.a
 
 %changelog
+* Fri Dec 16 2005 Radek Vokal <rvokal at redhat.com> - 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 <rvokal at redhat.com> - 5.2.2-3
 - fix ipaddr return type on 64bit machines 
 




More information about the fedora-cvs-commits mailing list