Skip to content

Commit

Permalink
Merge branch 'maint-r15' into maint
Browse files Browse the repository at this point in the history
Conflicts:
	erts/vsn.mk
  • Loading branch information
bmk committed Feb 6, 2012
2 parents ab2ba6f + 0c9547c commit 2d97f0e
Show file tree
Hide file tree
Showing 10 changed files with 379 additions and 75 deletions.
2 changes: 1 addition & 1 deletion erts/vsn.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# %CopyrightBegin%
#
# Copyright Ericsson AB 1997-2011. All Rights Reserved.
# Copyright Ericsson AB 1997-2012. 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
Expand Down
58 changes: 58 additions & 0 deletions lib/snmp/doc/src/notes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,64 @@
</header>


<section>
<title>SNMP Development Toolkit 4.21.7</title>
<p>Version 4.21.7 supports code replacement in runtime from/to
version 4.21.6, 4.21.5, 4.21.4, 4.21.3, 4.21.2, 4.21.1, 4.21, 4.20.1 and
4.20. </p>

<section>
<title>Improvements and new features</title>
<p>-</p>

<!--
<list type="bulleted">
<item>
<p>[agent] DoS attack using GET-BULK with large value of
MaxRepetitions.
A preventive method has been implementing by simply
limit the number of varbinds that can be included in
a Get-BULK response message. This is specified by the
new config option,
<seealso marker="snmp_app#agent_gb_max_vbs">gb_max_vbs</seealso>.
</p>
<p>Own Id: OTP-9700</p>
</item>
</list>
-->

</section>

<section>
<title>Reported Fixed Bugs and Malfunctions</title>
<!--
<p>-</p>
-->

<list type="bulleted">
<item>
<p>[agent] Simultaneous
<seealso marker="snmpa#backup">snmpa:backup/1,2</seealso>
calls can interfere.
The master agent did not check if a backup was already in
progress when a backup request was accepted. </p>
<p>Own Id: OTP-9884</p>
<p>Aux Id: Seq 11995</p>
</item>

</list>

</section>

<section>
<title>Incompatibilities</title>
<p>-</p>
</section>

</section> <!-- 4.21.7 -->


<section>
<title>SNMP Development Toolkit 4.21.6</title>
<p>Version 4.21.6 supports code replacement in runtime from/to
Expand Down
22 changes: 14 additions & 8 deletions lib/snmp/doc/src/snmpa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
<year>2004</year><year>2011</year>
<year>2004</year><year>2012</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
Expand Down Expand Up @@ -198,12 +198,18 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
<type>
<v>BackupDir = string()</v>
<v>Agent = pid() | atom()</v>
<v>Reason = backup_in_progress | term()</v>
</type>
<desc>
<p>Backup persistent/permanent data handled by the agent
(such as local-db, mib-data and vacm). </p>
<p>Data stored by mnesia is not handled. </p>
<p>BackupDir cannot be identical to DbDir. </p>
<p>Simultaneous backup calls are <em>not</em> allowed.
That is, two different processes cannot simultaneously
successfully call this function. One of them will be first,
and succeed. The second will fail with the error reason
<c>backup_in_progress</c>. </p>

<marker id="info"></marker>
</desc>
Expand All @@ -217,13 +223,13 @@ notification_delivery_info() = #snmpa_notification_delivery_info{}
</type>
<desc>
<p>Returns a list (a dictionary) containing information about
the agent. Information includes loaded MIBs, registered
sub-agents, some information about the memory allocation. </p>
<p>As of version 4.4 the format of the info has been changed.
To convert the info to the old format, call the
<seealso marker="#old_info_format">old_info_format</seealso>
function. </p>

the agent. Information includes loaded MIBs, registered
sub-agents, some information about the memory allocation. </p>
<p>As of version 4.4 the format of the info has been changed.
To convert the info to the old format, call the
<seealso marker="#old_info_format">old_info_format</seealso>
function. </p>
<marker id="old_info_format"></marker>
</desc>
</func>
Expand Down
9 changes: 7 additions & 2 deletions lib/snmp/src/agent/snmpa_agent.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,8 @@ handle_call(info, _From, S) ->
handle_call(get_net_if, _From, S) ->
{reply, get(net_if), S};

handle_call({backup, BackupDir}, From, S) ->
%% Only accept a backup request if there is none already in progress
handle_call({backup, BackupDir}, From, #state{backup = undefined} = S) ->
?vlog("backup: ~p", [BackupDir]),
Pid = self(),
V = get(verbosity),
Expand All @@ -1279,7 +1280,11 @@ handle_call({backup, BackupDir}, From, S) ->
end),
?vtrace("backup server: ~p", [BackupServer]),
{noreply, S#state{backup = {BackupServer, From}}};


handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};

handle_call(dump_mibs, _From, S) ->
Reply = snmpa_mib:dump(get(mibserver)),
{reply, Reply, S};
Expand Down
10 changes: 9 additions & 1 deletion lib/snmp/src/agent/snmpa_local_db.erl
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,11 @@ handle_call({match, Name, Db, Pattern}, _From, State) ->
L1 = match(Db, Name, Pattern, State),
{reply, lists:delete([undef], L1), State};

handle_call({backup, BackupDir}, From, #state{dets = Dets} = State) ->
%% This check (that there is no backup already in progress) is also
%% done in the master agent process, but just in case a user issues
%% a backup call to this process directly, we add a similar check here.
handle_call({backup, BackupDir}, From,
#state{backup = undefined, dets = Dets} = State) ->
?vlog("backup: ~p",[BackupDir]),
Pid = self(),
V = get(verbosity),
Expand All @@ -511,6 +515,10 @@ handle_call({backup, BackupDir}, From, #state{dets = Dets} = State) ->
{reply, Error, State}
end;

handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};

handle_call(dump, _From, #state{dets = Dets} = State) ->
?vlog("dump",[]),
dets_sync(Dets),
Expand Down
14 changes: 11 additions & 3 deletions lib/snmp/src/agent/snmpa_mib.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1996-2010. All Rights Reserved.
%% Copyright Ericsson AB 1996-2012. 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
Expand Down Expand Up @@ -552,8 +552,12 @@ handle_call({dump, File}, _From, #state{data = Data} = State) ->
Reply = snmpa_mib_data:dump(Data, File),
{reply, Reply, State};

handle_call({backup, BackupDir}, From, #state{data = Data} = State) ->
?vlog("backup to ~s",[BackupDir]),
%% This check (that there is no backup already in progress) is also
%% done in the master agent process, but just in case a user issues
%% a backup call to this process directly, we add a similar check here.
handle_call({backup, BackupDir}, From,
#state{backup = undefined, data = Data} = State) ->
?vlog("backup to ~s", [BackupDir]),
Pid = self(),
V = get(verbosity),
case file:read_file_info(BackupDir) of
Expand All @@ -576,6 +580,10 @@ handle_call({backup, BackupDir}, From, #state{data = Data} = State) ->
{reply, Error, State}
end;

handle_call({backup, _BackupDir}, From, #state{backup = Backup} = S) ->
?vinfo("backup already in progress: ~p", [Backup]),
{reply, {error, backup_in_progress}, S};

handle_call(stop, _From, State) ->
?vlog("stop",[]),
{stop, normal, ok, State};
Expand Down
2 changes: 1 addition & 1 deletion lib/snmp/src/agent/snmpa_mpd.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
%% Copyright Ericsson AB 1997-2011. All Rights Reserved.
%% Copyright Ericsson AB 1997-2012. 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
Expand Down
Loading

0 comments on commit 2d97f0e

Please sign in to comment.