Any help answering these questions would be greatly appreciated.   I am still 
unsure whether I configured things correctly to stop the "exit( )" routine from 
being called.

Thanks for any help.



--- On Thu, 6/11/09, Need Help <[email protected]> wrote:

From: Need Help <[email protected]>
Subject: Re: Removing "Exit()" routine calls
To: "net-snmp Coders" <[email protected]>
Date: Thursday, June 11, 2009, 11:48 AM

Questions:


1) Looking at the code I confirmed the following:

    NETSNMP_EXIT_ON_BAD_KLREAD is NOT defined

    NETSNMP_DS_AGENT_NO_ROOT_ACCESS = 2

Since "NETSNMP_EXIT_ON_BAD_KLREAD" is not defined, I can see how exit( ) is not 
being called.  

However, for "NETSNMP_DS_AGENT_NO_ROOT_ACCESS", do I need to change the value 
to be something other than "2" to stop the "exit( )" routine calls from 
occurring?  I can not tell if I need to make a change here.

2) You stated .... "If you are embedding the master agent within another 
application, you shouldn't be using the 'snmpd.c' code at all."

I am not sure "embedding" is the correct word to use or not.  Our build system 
was updated to perform 'configure', 'make' and 'make install' commands to build 
the NetSNMP code as part of our build system.   Not real sure what I need to do 
to make sure 'snmpd.c' is not being used.  Is it based on some option flag 
which should be used in the 'configure' command or possibly some setting I 
should put into the
 'snmpd.conf' file (ie: master agentx, etc..)?

3) Here is a list of other files which have 'exit( )' routine calls:

   net-snmp\agent\mibgroup\kernel_sunos5.c 
  net-snmp\agent\mibgroup\util_funcs.c 
  net-snmp\agent\mibgroup\agentx\master.c 
  net-snmp\agent\mibgroup\agentx\protocol.c 
  net-snmp\agent\mibgroup\disman\expression\expValueTable.c 
  net-snmp\agent\mibgroup\disman\nslookup\lookupCtlTable.c 
  net-snmp\agent\mibgroup\disman\ping\pingCtlTable.c 
  net-snmp\agent\mibgroup\disman\traceroute\traceRouteCtlTable..c 
  net-snmp\agent\mibgroup\hardware\cpu\cpu_pcp.c 
  net-snmp\agent\mibgroup\hardware\cpu\cpu_sysinfo.c 
  
net-snmp\agent\mibgroup\ip-mib\ipv4InterfaceTable\ipv4InterfaceTable_subagent.c 
  net-snmp\agent\mibgroup\Rmon\event.c 
  net-snmp\agent\mibgroup\ucd-snmp\proc.c 
  
  net-snmp\apps\encode_keychange.c
 
  net-snmp\apps\snmpbulkget.c 
  net-snmp\apps\snmpbulkwalk.c 
  net-snmp\apps\snmpdelta.c 
  net-snmp\apps\snmpdf.c 
  net-snmp\apps\snmpget.c 
  net-snmp\apps\snmpgetnext.c 
  net-snmp\apps\snmpset.c 
  net-snmp\apps\snmpstatus.c 
  net-snmp\apps\snmptable.c 
  net-snmp\apps\snmptest.c 
  net-snmp\apps\snmptranslate.c 
  net-snmp\apps\snmptrap.c 
  net-snmp\apps\snmptrapd.c 
  net-snmp\apps\snmptrapd_handlers.c 
  net-snmp\apps\snmpusm.c 
  net-snmp\apps\snmpvacm.c 
  net-snmp\apps\snmpwalk.c 
  net-snmp\apps\snmpnetstat\if.c 
  net-snmp\apps\snmpnetstat\main.c 
  
  net-snmp\snmplib\int64.c 
  net-snmp\snmplib\mib.c 
  net-snmp\snmplib\snmpSTDDomain.c 
  net-snmp\snmplib\system.c 
  
  net-snmp\testing\etimetest.c 
 
 net-snmp\testing\keymanagetest.c 
  net-snmp\testing\misctest.c 
  net-snmp\testing\scapitest.c 
  net-snmp\testing\T.c 

Shall I be concerned about removing the 'exit( )' routine calls from any of 
these files?




--- On Thu, 6/11/09, Dave Shield <[email protected]> wrote:

From: Dave Shield <[email protected]>
Subject: Re: Removing "Exit()" routine calls
To: "Need Help" <[email protected]>
Cc: "net-snmp Coders" <[email protected]>
Date: Thursday, June 11, 2009, 12:44 AM

2009/6/10 Need Help <[email protected]>:
>         However, I just noticed there are many calls to
 the "exit( )"
> routine used throughout the master agent code.

If you look more closely, these "exit()" routines only occur
in three files:

   -  auto_nlist.c
   -  kernel.c
   -  snmpd.c

The third of these is the wrapper structure for the Net-SNMP
standalone agent application.   The code for the core of the
master agent is in the file 'snmp_agent.c' - which doesn't
call 'exit()' at all.

If you are embedding the master agent within another
application, you shouldn't be using the 'snmpd.c' code at all.


As for the other two files, all of the occurances of 'exit()' are
already protected by suitable tests - either the run-time boolean
flag NETSNMP_DS_AGENT_NO_ROOT_ACCESS, or the
compile-time definition NETSNMP_EXIT_ON_BAD_KLREAD


If you configure things correctly, none of these should ever
 be
called - regardless of whether the kernel information is accessible
or not.

Dave



      
-----Inline Attachment Follows-----

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
-----Inline Attachment Follows-----

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders



      
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to