[SNMP4J] Agent VACM question

Frank Fock fock at agentpp.com
Sat Dec 9 01:40:36 CET 2006


Hi Jothi,

Setting the error status on a request completes it
as a side effect. So I do not understand why
completing it explicitly should change anything.
Have you tried it? What version of SNMP4J-Agent
are you using?

Have you set up the SNMP-COMMUNITY-MIB?

Best regards,
Frank

Jothi P Neelamegam wrote:
> Hi,
> 
> If I create a group with null writeview (I do not want members of this 
> group to have any write access at all ) and then try to do a set 
> operation with a member of this group, I get a time out instead of an 
> "Access denied" error.
> 
> Here is a sample code snippet:
> 
> In test agent,
> vacm.addGroup (v2c,"myuser", "mygroup", ...);
> vacm.addAccess(new OctetString("mygroup"),..,..,..,
>     new OctetString("fullReadView"),
>     null,  // null write view
>     ...)
> 
> Now, when I do
> snmpset -c myuser parameters
> 
> I get a timeout.
> 
> On exploring, a simple modification to CommandProcessor.java can fix this:
> 
> Currently, in processReqeuest
> 
> processRequest {
>     if (viewName == null)
>     {
>         //This is reached
>         setAuthorizationError(req, VACM.VACM_NO_SUCH_VIEW);
>     }
>     else
>     {
>         // Do processing
>     }
>     finalizeRequest()
> }
> 
> And
> finalizeRequest
> {
>     if (req.isComplete()) {    // Request is not complete as we have
>                                       auth error, so no response is sent.
>         //send response
>     }
> }
> 
> If the code is modified either (in processRequest, after 
> setAuthorizationError)
> 1. to mark the request as complete  or
> 2. sendResponse and return
> 
> we can handle this problem.
> 
> Thanks
> Jothi
> 
> 
> 
> Jothi P Neelamegam
> Verari Systems Pvt. Ltd. Bangalore, India
> Work: +91 (80) 26346485, 26557998
> http://verarisoft.com http://verari.com
> --------------------------------------------------------------------------
> The information contained in this communication may be confidential and is
> intended only for the use of the recipient(s) named above.  If the reader
> of this communication is not the intended recipient(s), you are hereby
> notified that any dissemination, distribution, or copying of this
> communication, or any of its contents, is strictly prohibited.  If you are
> not a named recipient or received this communication by mistake, please
> notify the sender and delete the communication and all copies of it.
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list