[SNMP4J] Prevent access with VacmMIB

Frank Fock fock at agentpp.com
Tue May 9 23:12:12 CEST 2006


Hi Matthieu,

When the view name is a zero length string then access is not allowed
due to the following code in isAccessAllowed(..)

...
     if (viewName == null) {
       return VACM.VACM_NO_ACCESS_ENTRY;
     }
     if (viewName.length() == 0) {
       return VACM.VACM_NO_SUCH_VIEW;
     }
...

Best regards,
Frank

Matthieu Casanova wrote:
> Hi, I'm trying to configure the access to an snmp agent, and I'm adding
> access
> to VacmMIB.
> When calling method
> vacmMib.addAccess(....)
> I want to prevent write access. Javadoc says to use zero length OctetString
> for parameter writeView.
> So I give new OctetString().
> But when doing a SET on the agent, when processing the request, the agent
> calls  the method VacmMIB.getViewNameByGroup()
> that will return my empty OctetString. And because it's not null the access
> is allowed.
> It seems that giving null to the addAccess method works better.
> Is it a javadoc error or a problem in my code ?
> 
> Matthieu
> _______________________________________________
> 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