diff options
author | Hans Nilsson <[email protected]> | 2015-05-12 17:03:28 +0200 |
---|---|---|
committer | Hans Nilsson <[email protected]> | 2015-05-13 13:01:18 +0200 |
commit | 7aef211a66219b6fef9d0bdaf9b09be6c2e0a32f (patch) | |
tree | 11f438cff113ba9b6814711dbab8d7da5efc5564 /lib/ssh/src/ssh.erl | |
parent | efbfe9602983ff451b864e557bdf3733222b78ba (diff) | |
download | otp-7aef211a66219b6fef9d0bdaf9b09be6c2e0a32f.tar.gz otp-7aef211a66219b6fef9d0bdaf9b09be6c2e0a32f.tar.bz2 otp-7aef211a66219b6fef9d0bdaf9b09be6c2e0a32f.zip |
ssh: option for handling the SSH_MSG_DEBUG message's printouts
A fun could be given in the options that will be called whenever
the SSH_MSG_DEBUG message arrives. This enables the user to
format the printout or just discard it.
The default is changed to not print the message. In RFC4253
printing is a SHOULD, but our new default is to protect logs
from dos attacs.
Diffstat (limited to 'lib/ssh/src/ssh.erl')
-rw-r--r-- | lib/ssh/src/ssh.erl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl index d4b02a024e..71e7d77475 100644 --- a/lib/ssh/src/ssh.erl +++ b/lib/ssh/src/ssh.erl @@ -312,6 +312,8 @@ handle_option([{disconnectfun, _} = Opt | Rest], SocketOptions, SshOptions) -> handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]); handle_option([{failfun, _} = Opt | Rest], SocketOptions, SshOptions) -> handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]); +handle_option([{ssh_msg_debug_fun, _} = Opt | Rest], SocketOptions, SshOptions) -> + handle_option(Rest, SocketOptions, [handle_ssh_option(Opt) | SshOptions]); %%Backwards compatibility should not be underscore between ip and v6 in API handle_option([{ip_v6_disabled, Value} | Rest], SocketOptions, SshOptions) -> handle_option(Rest, SocketOptions, [handle_ssh_option({ipv6_disabled, Value}) | SshOptions]); @@ -417,6 +419,8 @@ handle_ssh_option({disconnectfun , Value} = Opt) when is_function(Value) -> Opt; handle_ssh_option({failfun, Value} = Opt) when is_function(Value) -> Opt; +handle_ssh_option({ssh_msg_debug_fun, Value} = Opt) when is_function(Value,4) -> + Opt; handle_ssh_option({ipv6_disabled, Value} = Opt) when is_boolean(Value) -> throw({error, {{ipv6_disabled, Opt}, option_no_longer_valid_use_inet_option_instead}}); |