Class: HrrRbSftp::Protocol::Version3::Packet::SSH_FXP_SYMLINK
- Inherits:
-
Object
- Object
- HrrRbSftp::Protocol::Version3::Packet::SSH_FXP_SYMLINK
- Includes:
- Common::Packetable
- Defined in:
- lib/hrr_rb_sftp/protocol/version3/packet/020_ssh_fxp_symlink.rb
Constant Summary collapse
- TYPE =
20
- FORMAT =
[ [DataType::Byte, :"type" ], [DataType::Uint32, :"request-id"], [DataType::String, :"linkpath" ], [DataType::String, :"targetpath"], ]
Instance Attribute Summary
Attributes included from Loggable
Instance Method Summary collapse
Methods included from Common::Packetable
Methods included from Loggable
#log_debug, #log_error, #log_fatal, #log_info, #log_warn
Instance Method Details
#respond_to(request) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/hrr_rb_sftp/protocol/version3/packet/020_ssh_fxp_symlink.rb', line 17 def respond_to request begin File.symlink request[:"targetpath"], request[:"linkpath"] { :"type" => Packet::SSH_FXP_STATUS::TYPE, :"request-id" => request[:"request-id"], :"code" => Packet::SSH_FXP_STATUS::SSH_FX_OK, :"error message" => "Success", :"language tag" => "", } rescue Errno::EACCES { :"type" => Packet::SSH_FXP_STATUS::TYPE, :"request-id" => request[:"request-id"], :"code" => Packet::SSH_FXP_STATUS::SSH_FX_PERMISSION_DENIED, :"error message" => "Permission denied", :"language tag" => "", } rescue Errno::EEXIST { :"type" => Packet::SSH_FXP_STATUS::TYPE, :"request-id" => request[:"request-id"], :"code" => Packet::SSH_FXP_STATUS::SSH_FX_FAILURE, :"error message" => "File exists", :"language tag" => "", } rescue => e log_error { [e.backtrace[0], ": ", e., " (", e.class.to_s, ")\n\t", e.backtrace[1..-1].join("\n\t")].join } { :"type" => Packet::SSH_FXP_STATUS::TYPE, :"request-id" => request[:"request-id"], :"code" => Packet::SSH_FXP_STATUS::SSH_FX_FAILURE, :"error message" => e., :"language tag" => "", } end end |