diff options
author | Micael Karlberg <[email protected]> | 2011-02-25 13:54:07 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-02-25 13:54:07 +0100 |
commit | 931e775de52e6e335a10759c7fb3e0f8efea21d3 (patch) | |
tree | 79afd23e811719acaaf527707f9edf9a585de88d /lib/snmp/src | |
parent | 02b9003b697474ef6b7e07a6f7eebd6105d4497f (diff) | |
parent | ca6e87e84dae13b6ebe15ca67bf98a0245f25857 (diff) | |
download | otp-931e775de52e6e335a10759c7fb3e0f8efea21d3.tar.gz otp-931e775de52e6e335a10759c7fb3e0f8efea21d3.tar.bz2 otp-931e775de52e6e335a10759c7fb3e0f8efea21d3.zip |
[agent] When calling
snmp_view_based_acm_mib:snmp_view_based_acm_mib:reconfigure/1 on a
running node, the table vacmAccessTable was not properly cleaned.
This meant 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 table.
Merge branch 'bmk/snmp/vacmAccessTable_cleanup/OTP-8981' into bmk/snmp/snmp419_integration/OTP-9068
Conflicts:
lib/snmp/doc/src/notes.xml
lib/snmp/src/app/snmp.appup.src
lib/snmp/vsn.mk
Diffstat (limited to 'lib/snmp/src')
-rw-r--r-- | lib/snmp/src/agent/snmp_view_based_acm_mib.erl | 9 | ||||
-rw-r--r-- | lib/snmp/src/agent/snmpa_vacm.erl | 9 | ||||
-rw-r--r-- | lib/snmp/src/app/snmp.appup.src | 8 |
3 files changed, 20 insertions, 6 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 f4f89bf53e..3e5091a555 100644 --- a/lib/snmp/src/agent/snmp_view_based_acm_mib.erl +++ b/lib/snmp/src/agent/snmp_view_based_acm_mib.erl @@ -180,11 +180,18 @@ 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)), snmpa_local_db:table_create(db(vacmViewTreeFamilyTable)), - init_view_table(View). + init_view_table(View), + + ?vdebug("table(s) initiated",[]), + ok. init_sec2group_table([Row | T]) -> %% ?vtrace("init security-to-group table: " diff --git a/lib/snmp/src/agent/snmpa_vacm.erl b/lib/snmp/src/agent/snmpa_vacm.erl index 2eacea4301..892dc265f1 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,11 @@ delete(Key) -> ets:delete(snmpa_vacm, Key), dump_table(). + +cleanup() -> + ets:delete_all_objects(snmpa_vacm), + dump_table(). + 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 b2b2c0dd45..de0e5d6e14 100644 --- a/lib/snmp/src/app/snmp.appup.src +++ b/lib/snmp/src/app/snmp.appup.src @@ -24,7 +24,8 @@ [ {"4.18", [ - {load_module, snmp_misc, soft_purge, soft_purge, []}, + {load_module, snmp_misc, soft_purge, soft_purge, []}, + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmpa, soft_purge, soft_purge, [snmp_community_mib, snmp_framework_mib, @@ -43,7 +44,7 @@ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmpa_mib_lib]}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, - [snmpa_mib_lib]}, + [snmpa_mib_lib, snmpa_vacm]}, {load_module, snmpa_mib_lib, soft_purge, soft_purge, []} ] } @@ -55,6 +56,7 @@ {"4.18", [ {load_module, snmp_misc, soft_purge, soft_purge, []}, + {load_module, snmpa_vacm, soft_purge, soft_purge, []}, {load_module, snmpa, soft_purge, soft_purge, [snmp_community_mib, snmp_framework_mib, @@ -73,7 +75,7 @@ {load_module, snmp_user_based_sm_mib, soft_purge, soft_purge, [snmpa_mib_lib]}, {load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, - [snmpa_mib_lib]}, + [snmpa_mib_lib, snmpa_vacm]}, {load_module, snmpa_mib_lib, soft_purge, soft_purge, []} ] } |