]> git.pld-linux.org Git - packages/cacti-spine.git/blob - snmp_v3_fix.patch
- add 3 official patches
[packages/cacti-spine.git] / snmp_v3_fix.patch
1 --- 0.8.7e/configure.ac 2009-06-28 21:45:02.000000000 -0400
2 +++ ../branches/0.8.7/configure.ac      2009-08-18 20:51:30.000000000 -0400
3 @@ -351,6 +351,21 @@
4    AC_MSG_RESULT([no])
5  fi
6  
7 +# ****************** Force Net-SNMP Version Checks ***********************
8 +# If we should use the system popen or nifty popen
9 +AC_MSG_CHECKING(whether to verify net-snmp library vs header versions)
10 +AC_ARG_ENABLE(strict-snmp,
11 +    [  --enable-strict-snmp    Enable checking of Net-SNMP library vs header versions  (default: disabled)],
12 +    [ ENABLED_SNMP_VERSION=$enableval ],
13 +    [ ENABLED_SNMP_VERSION=no ]
14 +    )
15 +if test "$ENABLED_SNMP_VERSION" = "yes"; then
16 +  AC_MSG_RESULT([yes])
17 +  AC_DEFINE(VERIFY_PACKAGE_VERSION, 1, If we are going to force Net-SNMP library and header versons to be the same)
18 +else
19 +  AC_MSG_RESULT([no])
20 +fi
21 +
22  # ****************** gethostbyname_r Check ***********************
23  # Linux Variant
24  AC_MSG_CHECKING([for glibc gethostbyname_r])
25 --- 0.8.7e/snmp.c       2009-06-28 21:45:02.000000000 -0400
26 +++ ../branches/0.8.7/snmp.c    2009-08-18 20:51:30.000000000 -0400
27 @@ -91,7 +91,7 @@
28         netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_PRINT_BARE_VALUE, 1);
29         netsnmp_ds_set_boolean(NETSNMP_DS_LIBRARY_ID, NETSNMP_DS_LIB_NUMERIC_TIMETICKS, 1);
30  
31 -       #ifdef PACKAGE_VERSION
32 +       #if defined(VERIFY_PACKAGE_VERSION) && defined(PACKAGE_VERSION)
33                 /* check that the headers we compiled with match the library we linked with -
34                    apparently not defined in UCD-SNMP...
35                 */
36 @@ -215,24 +215,22 @@
37                 session.securityName         = snmp_username;
38                 session.securityNameLen      = strlen(session.securityName);
39  
40 +               if (snmp_context && strlen(snmp_context)) {
41                 session.contextName          = snmp_context;
42                 session.contextNameLen       = strlen(session.contextName);
43 +               }
44  
45                 session.securityAuthKeyLen   = USM_AUTH_KU_LEN;
46  
47 -               /* set the engineBoots and engineTime to null so that they are discovered */
48 -               session.engineBoots          = 0;
49 -               session.engineTime           = 0;
50 -
51                 /* set the authentication protocol */
52                 if (strcmp(snmp_auth_protocol, "MD5") == 0) {
53                         /* set the authentication method to MD5 */
54 -                       session.securityAuthProto    = snmp_duplicate_objid(usmHMACMD5AuthProtocol, OIDSIZE(usmHMACMD5AuthProtocol));
55 -                       session.securityAuthProtoLen = OIDSIZE(usmHMACMD5AuthProtocol);
56 +                       session.securityAuthProto    = snmp_duplicate_objid(usmHMACMD5AuthProtocol, USM_AUTH_PROTO_MD5_LEN);
57 +                       session.securityAuthProtoLen = USM_AUTH_PROTO_MD5_LEN;
58                 }else{
59                         /* set the authentication method to SHA1 */
60 -                       session.securityAuthProto    = snmp_duplicate_objid(usmHMACSHA1AuthProtocol, OIDSIZE(usmHMACSHA1AuthProtocol));
61 -                       session.securityAuthProtoLen = OIDSIZE(usmHMACSHA1AuthProtocol);
62 +                       session.securityAuthProto    = snmp_duplicate_objid(usmHMACSHA1AuthProtocol, USM_AUTH_PROTO_SHA_LEN);
63 +                       session.securityAuthProtoLen = USM_AUTH_PROTO_SHA_LEN;
64                 }
65  
66                 /* set the authentication key to the hashed version. The password must me at least 8 char */
67 @@ -255,16 +253,16 @@
68                         session.securityLevel        = SNMP_SEC_LEVEL_AUTHNOPRIV;
69                 }else{
70                         if (strcmp(snmp_priv_protocol, "DES") == 0) {
71 -                               session.securityPrivProto    = snmp_duplicate_objid(usmDESPrivProtocol, OIDSIZE(usmDESPrivProtocol));
72 -                               session.securityPrivProtoLen = OIDSIZE(usmDESPrivProtocol);
73 +                               session.securityPrivProto    = snmp_duplicate_objid(usmDESPrivProtocol, USM_PRIV_PROTO_DES_LEN);
74 +                               session.securityPrivProtoLen = USM_PRIV_PROTO_DES_LEN;
75                                 session.securityPrivKeyLen   = USM_PRIV_KU_LEN;
76  
77                                 /* set the security level to authenticate, and encrypted */
78                                 session.securityLevel        = SNMP_SEC_LEVEL_AUTHPRIV;
79                         }else{
80 -                               #if defined(usmAESPrivProtocol) && SNMP_DEFAULT_PRIV_PROTO == usmAESPrivProtocol
81 -                               session.securityPrivProto    = snmp_duplicate_objid(usmAESPrivProtocol, OIDSIZE(usmAESPrivProtocol));
82 -                               session.securityPrivProtoLen = OIDSIZE(usmAESPrivProtocol);
83 +                               #if defined(USM_PRIV_PROTO_AES_LEN)
84 +                               session.securityPrivProto    = snmp_duplicate_objid(usmAESPrivProtocol, USM_PRIV_PROTO_AES_LEN);
85 +                               session.securityPrivProtoLen = USM_PRIV_PROTO_AES_LEN;
86                                 session.securityPrivKeyLen   = USM_PRIV_KU_LEN;
87                                 #else
88                                 session.securityPrivProto    = snmp_duplicate_objid(usmAES128PrivProtocol, OIDSIZE(usmAES128PrivProtocol));
This page took 0.026531 seconds and 3 git commands to generate.