The bug describes how the view mask is lost when read from the snmpd
persistent file.

This patch fixes it (and removes some identity casts). The crucial
point is setting the viewMaskLen before calling read_octet_string.

Index: snmplib/vacm.c
===================================================================
--- snmplib/vacm.c      (revision 19758)
+++ snmplib/vacm.c      (working copy)
@@ -192,10 +192,10 @@
     vptr->viewStatus = view.viewStatus;
     vptr->viewStorageType = view.viewStorageType;
     vptr->viewType = view.viewType;
-    viewMask = (u_char *) vptr->viewMask;
+    viewMask = vptr->viewMask;
+    vptr->viewMaskLen = sizeof(vptr->viewMask);
     line =
-        read_config_read_octet_string(line, (u_char **) & viewMask,
-                                      &vptr->viewMaskLen);
+        read_config_read_octet_string(line, &viewMask, &vptr->viewMaskLen);
 }
 
 /*


This is relevant for all versions :-(

/Niels

-- 
Niels Baggesen -- @home -- Ã…rhus -- Denmark -- n...@users.sourceforge.net
   The purpose of computing is insight, not numbers  --  R W Hamming

------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months.  Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your 
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to