diff options
author | Micael Karlberg <[email protected]> | 2010-12-07 13:46:13 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2010-12-07 13:46:13 +0100 |
commit | aa7bbf1ec743389c1b3a461fa40a858800ae5049 (patch) | |
tree | c3ad3930019c3c229cc13f65cf6e7f6b4dcd7a9a /lib/snmp/src | |
parent | ada2a055fd183082bcefd5e4b94477959e75ebee (diff) | |
download | otp-aa7bbf1ec743389c1b3a461fa40a858800ae5049.tar.gz otp-aa7bbf1ec743389c1b3a461fa40a858800ae5049.tar.bz2 otp-aa7bbf1ec743389c1b3a461fa40a858800ae5049.zip |
[agent] When calling snmp_view_based_acm_mib:reconfigure/1 on a running node,
the vacmAccessTable whas not properly cleaned.
This means that if some entries in the vacm.conf file was removed
compared to the "current" config), while others where modified
and/or added, the removed entrie(s) would still exist in the vacmAccessTable.
Diffstat (limited to 'lib/snmp/src')
-rw-r--r-- | lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 2 | ||||
-rw-r--r-- | lib/snmp/src/agent/snmpa_vacm.erl | 8 | ||||
-rw-r--r-- | lib/snmp/src/app/snmp.appup.src | 12 |
3 files changed, 20 insertions, 2 deletions
diff --git a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl index 657207b36e..5e188c74c5 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -181,6 +181,8 @@ init_tabs(Sec2Group, Access, View) -> snmpa_local_db:table_delete(db(vacmSecurityToGroupTable)), snmpa_local_db:table_create(db(vacmSecurityToGroupTable)), init_sec2group_table(Sec2Group), + ?vdebug("create vacm access table",[]), + snmpa_vacm:cleanup(), init_access_table(Access), ?vdebug("create vacm view-tree-family table",[]), snmpa_local_db:table_delete(db(vacmViewTreeFamilyTable)), diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 2eacea4301..91cecfcd1e 100644 --- a/lib/snmp/src/agent/snmpa_vacm.erl +++ b/lib/snmp/src/agent/snmpa_vacm.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1999-2009. All Rights Reserved. +%% Copyright Ericsson AB 1999-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -21,7 +21,7 @@ -export([get_mib_view/5]). -export([init/1, init/2, backup/1]). -export([delete/1, get_row/1, get_next_row/1, insert/1, insert/2, - dump_table/0]). + cleanup/0, dump_table/0]). -include("SNMPv2-TC.hrl"). -include("SNMP-VIEW-BASED-ACM-MIB.hrl"). @@ -256,6 +256,10 @@ delete(Key) -> ets:delete(snmpa_vacm, Key), dump_table(). + +cleanup() -> + ets:delete_all_objects(snmpa_vacm). + dump_table(true) -> dump_table(); dump_table(_) -> diff --git a/lib/snmp/src/app/snmp.appup.src b/lib/snmp/src/app/snmp.appup.src index 2375e3df70..fafbf79bb7 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -22,6 +22,12 @@ %% ----- U p g r a d e ------------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, @@ -66,6 +72,12 @@ %% ------D o w n g r a d e --------------------------------------------------- [ + {"4.18", + [ + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, + {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, [snmpa_vacm]} + ] + }, {"4.17.1", [ {load_module, snmp_community_mib, soft_purge, soft_purge, []}, |