diff options
author | Ingela Anderton Andin <[email protected]> | 2016-07-01 10:04:52 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2016-07-01 10:04:52 +0200 |
commit | 1697cdea341e7d54e754e5f85e091c8bb68fb6c7 (patch) | |
tree | a917a06a386fe31a29a86adc6bf68eb1a6261fcf /lib/snmp/src/agent/snmpa_conf.erl | |
parent | 7c91a9c8d4a05ab254b89a6b1d700ff794017579 (diff) | |
parent | e47c8f1d52f89cc9b6a9237ee4d481c06b24b466 (diff) | |
download | otp-1697cdea341e7d54e754e5f85e091c8bb68fb6c7.tar.gz otp-1697cdea341e7d54e754e5f85e091c8bb68fb6c7.tar.bz2 otp-1697cdea341e7d54e754e5f85e091c8bb68fb6c7.zip |
Merge branch 'goertzenator/snmpstring/PR-1100/OTP-13706' into maint
* goertzenator/snmpstring/PR-1100/OTP-13706:
add snmp_agent_conf_test to modules.mk
Fix ERL-164 for agent, vacm, and usm config files
snmp tests demonstrating ERL-164, no string escaping for SNMP config files
Diffstat (limited to 'lib/snmp/src/agent/snmpa_conf.erl')
-rw-r--r-- | lib/snmp/src/agent/snmpa_conf.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/snmp/src/agent/snmpa_conf.erl b/lib/snmp/src/agent/snmpa_conf.erl index 94325a8ed6..fc5116dac9 100644 --- a/lib/snmp/src/agent/snmpa_conf.erl +++ b/lib/snmp/src/agent/snmpa_conf.erl @@ -154,7 +154,7 @@ do_write_agent_conf(Fd, {intAgentMaxPacketSize = Tag, Val} ) -> do_write_agent_conf(Fd, {snmpEngineMaxMessageSize = Tag, Val} ) -> io:format(Fd, "{~w, ~w}.~n", [Tag, Val]); do_write_agent_conf(Fd, {snmpEngineID = Tag, Val} ) -> - io:format(Fd, "{~w, \"~s\"}.~n", [Tag, Val]); + io:format(Fd, "{~w, ~p}.~n", [Tag, Val]); do_write_agent_conf(_Fd, Crap) -> error({bad_agent_config, Crap}). @@ -758,9 +758,9 @@ do_write_usm_conf( PrivP, PrivKeyC, OwnPrivKeyC, Public, AuthKey, PrivKey}) -> io:format(Fd, "{", []), - io:format(Fd, "\"~s\", ", [EngineID]), - io:format(Fd, "\"~s\", ", [UserName]), - io:format(Fd, "\"~s\", ", [SecName]), + io:format(Fd, "~p, ", [EngineID]), + io:format(Fd, "~p, ", [UserName]), + io:format(Fd, "~p, ", [SecName]), io:format(Fd, "~w, ", [Clone]), io:format(Fd, "~w, ", [AuthP]), do_write_usm2(Fd, AuthKeyC, ", "), @@ -859,15 +859,15 @@ do_write_vacm_conf( {vacmSecurityToGroup, SecModel, SecName, GroupName}) -> io:format( - Fd, "{vacmSecurityToGroup, ~w, \"~s\", \"~s\"}.~n", + Fd, "{vacmSecurityToGroup, ~w, ~p, ~p}.~n", [SecModel, SecName, GroupName]); do_write_vacm_conf( Fd, {vacmAccess, GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV}) -> io:format( - Fd, "{vacmAccess, \"~s\", \"~s\", ~w, ~w, ~w, " - "\"~s\", \"~s\", \"~s\"}.~n", + Fd, "{vacmAccess, ~p, ~p, ~w, ~w, ~w, " + "~p, ~p, ~p}.~n", [GroupName, Prefix, SecModel, SecLevel, Match, RV, WV, NV]); do_write_vacm_conf( @@ -875,7 +875,7 @@ do_write_vacm_conf( {vacmViewTreeFamily, ViewIndex, ViewSubtree, ViewStatus, ViewMask}) -> io:format( - Fd, "{vacmViewTreeFamily, \"~s\", ~w, ~w, ~w}.~n", + Fd, "{vacmViewTreeFamily, ~p, ~w, ~w, ~w}.~n", [ViewIndex, ViewSubtree, ViewStatus, ViewMask]); do_write_vacm_conf(_Fd, Crap) -> error({bad_vacm_config, Crap}). |