snmpm_config failes to read usm config

Vance Shipley vances@REDACTED
Fri Apr 15 11:19:44 CEST 2005


Folks,

I was finding that starting the snmp application after running 
snmp:config() was failing with the crash report below.  I tracked
it down to an extra {ok,Result} wrapped around the intended value.

The attached patch seems to fix it.

	-Vance


=CRASH REPORT==== 15-Apr-2005::00:04:05 ===
  crasher:
    pid: <0.90.0>
    registered_name: snmpm_config
    error_info: {function_clause,[{snmpm_config,
                                       init_usm_user_config,
                                       [{ok,{usm_user,
                                                "otpuser's engine",
                                                "frogman",
                                                "frogman",
                                                usmHMACSHAAuthProtocol,
                                                [1,
                                                 2,
                                                 3,
                                                 4,
                                                 5,
                                                 6,
                                                 7,
                                                 8,
                                                 9,
                                                 10,
                                                 11,
                                                 12,
                                                 13,
                                                 14,
                                                 15,
                                                 16,
                                                 17,
                                                 18,
                                                 19,
                                                 20],
                                                usmDESPrivProtocol,
                                                [10,
                                                 11,
                                                 12,
                                                 13,
                                                 14,
                                                 15,
                                                 16,
                                                 17,
                                                 18,
                                                 19,
                                                 20,
                                                 21,
                                                 22,
                                                 23,
                                                 24,
                                                 25]}}]},
                                   {snmpm_config,init_usm_users_config,1},
                                   {snmpm_config,do_init,1},
                                   {snmpm_config,init,1},
                                   {gen_server,init_it,6},
                                   {proc_lib,init_p,5}]}
    initial_call: {gen,init_it,
                      [gen_server,
                       <0.89.0>,
                       <0.89.0>,
                       {local,snmpm_config},
                       snmpm_config,
                       [[{priority,normal},
                         {versions,[v3]},
                         {config,[{dir,"/home/otpuser/snmp/manager/conf/"},
                                  {verbosity,silence},
                                  {db_dir,"/home/otpuser/snmp/manager/db/"},
                                  {repair,true},
                                  {auto_save,5000}]},
                         {mibs,[]},
                         {server,[{timeout,30000},{verbosity,silence}]},
                         {note_store,[{timeout,30000},{verbosity,silence}]},
                         {net_if,[{module,snmpm_net_if},
                                  {verbosity,silence},
                                  {options,[{bind_to,false},{no_reuse,false}]}]}]],
                       []]}
    ancestors: [snmpm_supervisor,snmp_app_sup,<0.60.0>]
    messages: []
    links: [<0.67.0>,<0.89.0>]
    dictionary: [{sname,mconf},{verbosity,silence}]
    trap_exit: false
    status: running
    heap_size: 2584
    stack_size: 21
    reductions: 6480
  neighbours:

-------------- next part --------------
*** snmpm_config.erl    Thu Apr 14 22:48:00 2005
--- snmpm_config.erl.orig Thu Apr 14 22:51:58 2005
***************
*** 1354,1368 ****
  %% Identity-function
  check_usm_user_config({EngineId, Name, 
                       AuthP, AuthKey, 
                       PrivP, PrivKey}) ->
      User = {EngineId, Name, Name, AuthP, AuthKey, PrivP, PrivKey},
!     {ok, verify_usm_user(User)};
  check_usm_user_config({_EngineId, _Name, _SecName, 
                       _AuthP, _AuthKey, 
                       _PrivP, _PrivKey} = User) ->
!     {ok, verify_usm_user(User)};
  check_usm_user_config(User) ->
      error({bad_usm_config, User}).
  
  init_usm_users_config([]) ->
      ok;
--- 1354,1368 ----
  %% Identity-function
  check_usm_user_config({EngineId, Name, 
                       AuthP, AuthKey, 
                       PrivP, PrivKey}) ->
      User = {EngineId, Name, Name, AuthP, AuthKey, PrivP, PrivKey},
!     verify_usm_user(User);
  check_usm_user_config({_EngineId, _Name, _SecName, 
                       _AuthP, _AuthKey, 
                       _PrivP, _PrivKey} = User) ->
!     verify_usm_user(User);
  check_usm_user_config(User) ->
      error({bad_usm_config, User}).
  
  init_usm_users_config([]) ->
      ok;



More information about the erlang-patches mailing list