>>>>> "WH" == Wes Hardaker <[EMAIL PROTECTED]> writes:

WH> The 5.4.1 code:

Same problem + a similar problems = new patch:

Index: apps/snmptrapd_ds.h
===================================================================
--- apps/snmptrapd_ds.h (revision 16710)
+++ apps/snmptrapd_ds.h (working copy)
@@ -4,6 +4,8 @@
 /* these must not conflict with agent's DS booleans */
 #define NETSNMP_DS_APP_NUMERIC_IP       16
 #define NETSNMP_DS_APP_NO_AUTHORIZATION 17
+#define NETSNMP_DS_DROPFAILEDAUTHNOTIFS 18
+#define NETSNMP_DS_SYSLOGTRAP           19

 /*
  * NB: The NETSNMP_DS_APP_NO_AUTHORIZATION definition is repeated
Index: apps/snmptrapd.c
===================================================================
--- apps/snmptrapd.c    (revision 16710)
+++ apps/snmptrapd.c    (working copy)
@@ -137,9 +137,7 @@
 #endif

 char           *logfile = 0;
-int             SyslogTrap = 0;
 int             Event = 0;
-int             dropauth = 0;
 int             reconfig = 0;
 char            ddefault_port[] = "udp:162";   /* Default default port */
 char           *default_port = ddefault_port;
@@ -514,7 +512,8 @@
 parse_config_doNotLogTraps(const char *token, char *cptr)
 {
   if (atoi(cptr) > 0)
-    SyslogTrap++;
+      netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+                             NETSNMP_DS_SYSLOGTRAP, 1)
 }

 void
@@ -618,7 +617,8 @@
 parse_config_ignoreAuthFailure(const char *token, char *cptr)
 {
   if (netsnmp_ds_parse_boolean(cptr) == 1)
-    dropauth = 1;
+      ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+                     NETSNMP_DS_DROPFAILEDAUTHNOTIFS, 1);
 }

 void
@@ -776,7 +776,8 @@
             break;

         case 'a':
-            dropauth = 1;
+            ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+                           NETSNMP_DS_DROPFAILEDAUTHNOTIFS, 1);
             break;

         case 'A':
@@ -996,7 +997,8 @@
             break;

         case 't':
-            SyslogTrap++;
+            netsnmp_ds_set_boolean(NETSNMP_DS_APPLICATION_ID,
+                                   NETSNMP_DS_SYSLOGTRAP, 1)
             break;

 #if HAVE_UNISTD_H
Index: apps/snmptrapd_handlers.c
===================================================================
--- apps/snmptrapd_handlers.c   (revision 16710)
+++ apps/snmptrapd_handlers.c   (working copy)
@@ -585,11 +585,11 @@
     u_char         *rbuf = NULL;
     size_t          r_len = 64, o_len = 0;
     int             trunc = 0;
-    extern int      SyslogTrap;

     DEBUGMSGTL(( "snmptrapd", "syslog_handler\n"));

-    if (SyslogTrap)
+    if (netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+                               NETSNMP_DS_SYSLOGTRAP))
         return NETSNMPTRAPD_HANDLER_OK;

     if ((rbuf = (u_char *) calloc(r_len, 1)) == NULL) {
@@ -668,7 +668,6 @@
     u_char         *rbuf = NULL;
     size_t          r_len = 64, o_len = 0;
     int             trunc = 0;
-    extern int      dropauth;

     DEBUGMSGTL(( "snmptrapd", "print_handler\n"));

@@ -676,7 +675,9 @@
      *  Don't bother logging authentication failures
      *  XXX - can we handle this via suitable handler entries instead?
      */
-    if (pdu->trap_type == SNMP_TRAP_AUTHFAIL && dropauth)
+    if (pdu->trap_type == SNMP_TRAP_AUTHFAIL &&
+        netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
+                               NETSNMP_DS_DROPFAILEDAUTHNOTIFS)
         return NETSNMPTRAPD_HANDLER_OK;

     if ((rbuf = (u_char *) calloc(r_len, 1)) == NULL) {

-- 
Wes Hardaker
Sparta, Inc.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to