Skip to content

Commit

Permalink
[agent] The SNMP ACM cache was not properly updated when
Browse files Browse the repository at this point in the history
changes where made to the VACM security-to-group, access and
view-tree-family tables.

OTP-9367

Merge branch 'bmk/snmp/agent/acm_cache_cleanup/OTP-9367' into bmk/snmp/snmp421_integration

Conflicts:
	lib/snmp/doc/src/notes.xml
	lib/snmp/src/app/snmp.appup.src
  • Loading branch information
bmk committed Jul 22, 2011
2 parents 7437a86 + 29ea8d4 commit 7ce465d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/snmp/doc/src/notes.xml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -85,6 +85,14 @@
<p>Own Id: OTP-9354</p> <p>Own Id: OTP-9354</p>
</item> </item>


<item>
<p>[agent] The SNMP ACM cache was not properly updated when
changes where made to the VACM security-to-group, access and
view-tree-family tables. </p>
<p>Own Id: OTP-9367</p>
<p>Aux Id: Seq 11858</p>
</item>

</list> </list>
</section> </section>


Expand Down
6 changes: 6 additions & 0 deletions lib/snmp/src/agent/snmp_view_based_acm_mib.erl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ add_sec2group(SecModel, SecName, GroupName) ->
Key = [Key1, length(Key2) | Key2], Key = [Key1, length(Key2) | Key2],
case table_cre_row(vacmSecurityToGroupTable, Key, Row) of case table_cre_row(vacmSecurityToGroupTable, Key, Row) of
true -> true ->
snmpa_agent:invalidate_ca_cache(),
{ok, Key}; {ok, Key};
false -> false ->
{error, create_failed} {error, create_failed}
Expand All @@ -260,6 +261,7 @@ add_sec2group(SecModel, SecName, GroupName) ->
delete_sec2group(Key) -> delete_sec2group(Key) ->
case table_del_row(vacmSecurityToGroupTable, Key) of case table_del_row(vacmSecurityToGroupTable, Key) of
true -> true ->
snmpa_agent:invalidate_ca_cache(),
ok; ok;
false -> false ->
{error, delete_failed} {error, delete_failed}
Expand All @@ -279,6 +281,7 @@ add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) ->
Key3 = [SM, SL], Key3 = [SM, SL],
Key = Key1 ++ Key2 ++ Key3, Key = Key1 ++ Key2 ++ Key3,
snmpa_vacm:insert([{Key, Row}], false), snmpa_vacm:insert([{Key, Row}], false),
snmpa_agent:invalidate_ca_cache(),
{ok, Key}; {ok, Key};
{error, Reason} -> {error, Reason} ->
{error, Reason}; {error, Reason};
Expand All @@ -287,6 +290,7 @@ add_access(GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV) ->
end. end.


delete_access(Key) -> delete_access(Key) ->
snmpa_agent:invalidate_ca_cache(),
snmpa_vacm:delete(Key). snmpa_vacm:delete(Key).




Expand All @@ -299,6 +303,7 @@ add_view_tree_fam(ViewIndex, SubTree, Status, Mask) ->
Key = [length(Key1) | Key1] ++ [length(Key2) | Key2], Key = [length(Key1) | Key1] ++ [length(Key2) | Key2],
case table_cre_row(vacmViewTreeFamilyTable, Key, Row) of case table_cre_row(vacmViewTreeFamilyTable, Key, Row) of
true -> true ->
snmpa_agent:invalidate_ca_cache(),
{ok, Key}; {ok, Key};
false -> false ->
{error, create_failed} {error, create_failed}
Expand All @@ -312,6 +317,7 @@ add_view_tree_fam(ViewIndex, SubTree, Status, Mask) ->
delete_view_tree_fam(Key) -> delete_view_tree_fam(Key) ->
case table_del_row(vacmViewTreeFamilyTable, Key) of case table_del_row(vacmViewTreeFamilyTable, Key) of
true -> true ->
snmpa_agent:invalidate_ca_cache(),
ok; ok;
false -> false ->
{error, delete_failed} {error, delete_failed}
Expand Down
6 changes: 6 additions & 0 deletions lib/snmp/src/app/snmp.appup.src
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
[ [
{"4.20.1", {"4.20.1",
[ [
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmpm, soft_purge, soft_purge, {load_module, snmpm, soft_purge, soft_purge,
[snmpm_server, snmpm_config, snmp_config]}, [snmpm_server, snmpm_config, snmp_config]},
{load_module, snmp_conf, soft_purge, soft_purge, []}, {load_module, snmp_conf, soft_purge, soft_purge, []},
Expand All @@ -43,6 +44,7 @@
}, },
{"4.20", {"4.20",
[ [
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]}, {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
{load_module, snmpm, soft_purge, soft_purge, {load_module, snmpm, soft_purge, soft_purge,
[snmpm_server, snmpm_config, snmp_config]}, [snmpm_server, snmpm_config, snmp_config]},
Expand Down Expand Up @@ -85,6 +87,7 @@
[snmp_conf, snmpa_mpd, snmp_target_mib]}, [snmp_conf, snmpa_mpd, snmp_target_mib]},
{load_module, snmpa_conf, soft_purge, soft_purge, {load_module, snmpa_conf, soft_purge, soft_purge,
[snmp_config, snmp_notification_mib]}, [snmp_config, snmp_notification_mib]},
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmp_notification_mib, soft_purge, soft_purge, {load_module, snmp_notification_mib, soft_purge, soft_purge,
[snmp_conf, snmp_target_mib]}, [snmp_conf, snmp_target_mib]},
{load_module, snmp_community_mib, soft_purge, soft_purge, []}, {load_module, snmp_community_mib, soft_purge, soft_purge, []},
Expand All @@ -108,6 +111,7 @@
[ [
{"4.20.1", {"4.20.1",
[ [
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmpm, soft_purge, soft_purge, {load_module, snmpm, soft_purge, soft_purge,
[snmpm_server, snmpm_config, snmp_config]}, [snmpm_server, snmpm_config, snmp_config]},
{load_module, snmp_conf, soft_purge, soft_purge, []}, {load_module, snmp_conf, soft_purge, soft_purge, []},
Expand All @@ -127,6 +131,7 @@
}, },
{"4.20", {"4.20",
[ [
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]}, {load_module, snmp_target_mib, soft_purge, soft_purge, [snmp_conf]},
{load_module, snmpm, soft_purge, soft_purge, {load_module, snmpm, soft_purge, soft_purge,
[snmpm_server, snmpm_config, snmp_config]}, [snmpm_server, snmpm_config, snmp_config]},
Expand Down Expand Up @@ -169,6 +174,7 @@
[snmp_conf, snmpa_mpd, snmp_target_mib]}, [snmp_conf, snmpa_mpd, snmp_target_mib]},
{load_module, snmpa_conf, soft_purge, soft_purge, {load_module, snmpa_conf, soft_purge, soft_purge,
[snmp_config, snmp_notification_mib]}, [snmp_config, snmp_notification_mib]},
{load_module, snmp_view_based_acm_mib, soft_purge, soft_purge, []},
{load_module, snmp_notification_mib, soft_purge, soft_purge, {load_module, snmp_notification_mib, soft_purge, soft_purge,
[snmp_conf, snmp_target_mib]}, [snmp_conf, snmp_target_mib]},
{load_module, snmp_community_mib, soft_purge, soft_purge, []}, {load_module, snmp_community_mib, soft_purge, soft_purge, []},
Expand Down

0 comments on commit 7ce465d

Please sign in to comment.