abiquo-installer-tests 20120104 → 20121023.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +11 -7
- data/bin/abiquo-installer-tests +68 -43
- data/tests/1.8.5/abiquo_ciab.rb +21 -0
- data/tests/1.8.5/abiquo_kvm.rb +25 -0
- data/tests/1.8.5/abiquo_lvmiscsi.rb +17 -0
- data/tests/1.8.5/abiquo_monolithic.rb +12 -0
- data/tests/1.8.5/abiquo_nfs_repository.rb +23 -0
- data/tests/1.8.5/abiquo_platform.rb +39 -0
- data/tests/1.8.5/abiquo_remote_services.rb +115 -0
- data/tests/1.8.5/abiquo_server.rb +63 -0
- data/tests/1.8.5/abiquo_v2v.rb +37 -0
- data/tests/1.8.5/abiquo_vbox.rb +27 -0
- data/tests/1.8.5/abiquo_xen.rb +27 -0
- data/tests/2.0/abiquo_ciab.rb +9 -0
- data/tests/2.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.0/abiquo_kvm.rb +5 -23
- data/tests/2.0/abiquo_monolithic.rb +12 -1
- data/tests/2.0/abiquo_platform.rb +2 -2
- data/tests/2.0/abiquo_remote_services.rb +15 -38
- data/tests/2.0/abiquo_server.rb +7 -1
- data/tests/2.0/abiquo_v2v.rb +42 -0
- data/tests/2.0/abiquo_vbox.rb +5 -25
- data/tests/2.0/abiquo_xen.rb +5 -25
- data/tests/2.2.0/abiquo_ciab.rb +30 -0
- data/tests/2.2.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.2.0/abiquo_kvm.rb +7 -0
- data/tests/2.2.0/abiquo_lvmiscsi.rb +17 -0
- data/tests/2.2.0/abiquo_monolithic.rb +23 -0
- data/tests/2.2.0/abiquo_nfs_repository.rb +23 -0
- data/tests/2.2.0/abiquo_platform.rb +35 -0
- data/tests/2.2.0/abiquo_remote_services.rb +96 -0
- data/tests/2.2.0/abiquo_server.rb +95 -0
- data/tests/2.2.0/abiquo_v2v.rb +79 -0
- data/tests/2.2.0/abiquo_vbox.rb +7 -0
- data/tests/2.2.0/abiquo_xen.rb +7 -0
- data/tests/2.3.0/abiquo_ciab.rb +30 -0
- data/tests/2.3.0/abiquo_community_hypervisor.rb +52 -0
- data/tests/2.3.0/abiquo_kvm.rb +7 -0
- data/tests/2.3.0/abiquo_lvmiscsi.rb +17 -0
- data/tests/2.3.0/abiquo_monolithic.rb +23 -0
- data/tests/2.3.0/abiquo_nfs_repository.rb +23 -0
- data/tests/2.3.0/abiquo_platform.rb +35 -0
- data/tests/2.3.0/abiquo_remote_services.rb +96 -0
- data/tests/2.3.0/abiquo_server.rb +95 -0
- data/tests/2.3.0/abiquo_v2v.rb +79 -0
- data/tests/2.3.0/abiquo_vbox.rb +7 -0
- data/tests/2.3.0/abiquo_xen.rb +7 -0
- data/tests/abiquo_postinst_test.rb +12 -1
- data/vendor/net-scp-1.0.4/CHANGELOG.rdoc +29 -0
- data/vendor/net-scp-1.0.4/Manifest +17 -0
- data/vendor/net-scp-1.0.4/README.rdoc +98 -0
- data/vendor/net-scp-1.0.4/Rakefile +83 -0
- data/vendor/net-scp-1.0.4/lib/net/scp.rb +432 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/download.rb +150 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/errors.rb +5 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/upload.rb +142 -0
- data/vendor/net-scp-1.0.4/lib/net/scp/version.rb +18 -0
- data/vendor/net-scp-1.0.4/lib/uri/open-scp.rb +18 -0
- data/vendor/net-scp-1.0.4/lib/uri/scp.rb +35 -0
- data/vendor/net-scp-1.0.4/net-scp.gemspec +34 -0
- data/vendor/net-scp-1.0.4/setup.rb +1331 -0
- data/vendor/net-scp-1.0.4/test/common.rb +153 -0
- data/vendor/net-scp-1.0.4/test/test_all.rb +3 -0
- data/vendor/net-scp-1.0.4/test/test_download.rb +170 -0
- data/vendor/net-scp-1.0.4/test/test_scp.rb +60 -0
- data/vendor/net-scp-1.0.4/test/test_upload.rb +269 -0
- data/vendor/net-sftp-2.0.5/CHANGELOG.rdoc +49 -0
- data/vendor/net-sftp-2.0.5/Manifest +55 -0
- data/vendor/net-sftp-2.0.5/README.rdoc +96 -0
- data/vendor/net-sftp-2.0.5/Rakefile +30 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp.rb +70 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/constants.rb +187 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/errors.rb +39 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/dir.rb +93 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/download.rb +364 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/file.rb +176 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/file_factory.rb +60 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/operations/upload.rb +387 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/packet.rb +21 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol.rb +32 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/attributes.rb +315 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/base.rb +268 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/01/name.rb +43 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/02/base.rb +31 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/03/base.rb +35 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/attributes.rb +152 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/base.rb +94 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/04/name.rb +67 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/05/base.rb +66 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/06/attributes.rb +107 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/06/base.rb +63 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/protocol/base.rb +50 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/request.rb +91 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/response.rb +76 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/session.rb +952 -0
- data/vendor/net-sftp-2.0.5/lib/net/sftp/version.rb +18 -0
- data/vendor/net-sftp-2.0.5/net-sftp.gemspec +34 -0
- data/vendor/net-sftp-2.0.5/setup.rb +1331 -0
- data/vendor/net-sftp-2.0.5/test/common.rb +172 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_attributes.rb +97 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_base.rb +210 -0
- data/vendor/net-sftp-2.0.5/test/protocol/01/test_name.rb +27 -0
- data/vendor/net-sftp-2.0.5/test/protocol/02/test_base.rb +26 -0
- data/vendor/net-sftp-2.0.5/test/protocol/03/test_base.rb +27 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_attributes.rb +148 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_base.rb +74 -0
- data/vendor/net-sftp-2.0.5/test/protocol/04/test_name.rb +53 -0
- data/vendor/net-sftp-2.0.5/test/protocol/05/test_base.rb +62 -0
- data/vendor/net-sftp-2.0.5/test/protocol/06/test_attributes.rb +124 -0
- data/vendor/net-sftp-2.0.5/test/protocol/06/test_base.rb +51 -0
- data/vendor/net-sftp-2.0.5/test/protocol/test_base.rb +42 -0
- data/vendor/net-sftp-2.0.5/test/test_all.rb +7 -0
- data/vendor/net-sftp-2.0.5/test/test_dir.rb +47 -0
- data/vendor/net-sftp-2.0.5/test/test_download.rb +252 -0
- data/vendor/net-sftp-2.0.5/test/test_file.rb +159 -0
- data/vendor/net-sftp-2.0.5/test/test_file_factory.rb +48 -0
- data/vendor/net-sftp-2.0.5/test/test_packet.rb +9 -0
- data/vendor/net-sftp-2.0.5/test/test_protocol.rb +17 -0
- data/vendor/net-sftp-2.0.5/test/test_request.rb +71 -0
- data/vendor/net-sftp-2.0.5/test/test_response.rb +53 -0
- data/vendor/net-sftp-2.0.5/test/test_session.rb +741 -0
- data/vendor/net-sftp-2.0.5/test/test_upload.rb +219 -0
- data/vendor/net-ssh-2.5.2/CHANGELOG.rdoc +295 -0
- data/vendor/net-ssh-2.5.2/LICENSE.rdoc +19 -0
- data/vendor/net-ssh-2.5.2/Manifest +132 -0
- data/vendor/net-ssh-2.5.2/README.rdoc +184 -0
- data/vendor/net-ssh-2.5.2/Rakefile +88 -0
- data/vendor/net-ssh-2.5.2/Rudyfile +96 -0
- data/vendor/net-ssh-2.5.2/THANKS.rdoc +19 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh.rb +223 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent.rb +23 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent/java_pageant.rb +85 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/agent/socket.rb +170 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/constants.rb +18 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/key_manager.rb +253 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/abstract.rb +60 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/hostbased.rb +75 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/keyboard_interactive.rb +70 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/password.rb +43 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/methods/publickey.rb +96 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/pageant.rb +264 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/authentication/session.rb +154 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/buffer.rb +350 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/buffered_io.rb +198 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/config.rb +207 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/channel.rb +630 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/constants.rb +33 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/session.rb +597 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/connection/term.rb +178 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/errors.rb +88 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/key_factory.rb +107 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/known_hosts.rb +141 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/loggable.rb +61 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/packet.rb +102 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/prompt.rb +93 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/command.rb +75 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/errors.rb +14 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/http.rb +94 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/socks4.rb +70 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/proxy/socks5.rb +142 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/ruby_compat.rb +51 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/service/forward.rb +298 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test.rb +89 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/channel.rb +129 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/extensions.rb +152 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/kex.rb +44 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/local_packet.rb +51 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/packet.rb +81 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/remote_packet.rb +38 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/script.rb +157 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/test/socket.rb +64 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/algorithms.rb +407 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/cipher_factory.rb +106 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/constants.rb +32 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/ctr.rb +95 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac.rb +45 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/abstract.rb +79 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/md5.rb +12 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/md5_96.rb +11 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/none.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/ripemd160.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha1.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha1_96.rb +11 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_256.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_256_96.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_512.rb +14 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/hmac/sha2_512_96.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/identity_cipher.rb +55 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex.rb +28 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group14_sha1.rb +44 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group1_sha1.rb +216 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha1.rb +80 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/diffie_hellman_group_exchange_sha256.rb +15 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp256.rb +93 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp384.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/kex/ecdh_sha2_nistp521.rb +13 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/key_expander.rb +26 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/openssl.rb +237 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/packet_stream.rb +235 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/server_version.rb +71 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/session.rb +278 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/transport/state.rb +206 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/lenient.rb +30 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/null.rb +12 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/verifiers/strict.rb +53 -0
- data/vendor/net-ssh-2.5.2/lib/net/ssh/version.rb +62 -0
- data/vendor/net-ssh-2.5.2/net-ssh.gemspec +172 -0
- data/vendor/net-ssh-2.5.2/setup.rb +1585 -0
- data/vendor/net-ssh-2.5.2/support/arcfour_check.rb +20 -0
- data/vendor/net-ssh-2.5.2/support/ssh_tunnel_bug.rb +65 -0
- data/vendor/net-ssh-2.5.2/test/README.txt +43 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/common.rb +28 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_abstract.rb +51 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_hostbased.rb +114 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_keyboard_interactive.rb +100 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_password.rb +52 -0
- data/vendor/net-ssh-2.5.2/test/authentication/methods/test_publickey.rb +148 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_agent.rb +205 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_key_manager.rb +218 -0
- data/vendor/net-ssh-2.5.2/test/authentication/test_session.rb +106 -0
- data/vendor/net-ssh-2.5.2/test/common.rb +107 -0
- data/vendor/net-ssh-2.5.2/test/configs/eqsign +3 -0
- data/vendor/net-ssh-2.5.2/test/configs/exact_match +8 -0
- data/vendor/net-ssh-2.5.2/test/configs/host_plus +10 -0
- data/vendor/net-ssh-2.5.2/test/configs/multihost +4 -0
- data/vendor/net-ssh-2.5.2/test/configs/nohost +19 -0
- data/vendor/net-ssh-2.5.2/test/configs/numeric_host +4 -0
- data/vendor/net-ssh-2.5.2/test/configs/wild_cards +14 -0
- data/vendor/net-ssh-2.5.2/test/connection/test_channel.rb +467 -0
- data/vendor/net-ssh-2.5.2/test/connection/test_session.rb +488 -0
- data/vendor/net-ssh-2.5.2/test/known_hosts/github +1 -0
- data/vendor/net-ssh-2.5.2/test/manual/test_forward.rb +223 -0
- data/vendor/net-ssh-2.5.2/test/start/test_transport.rb +28 -0
- data/vendor/net-ssh-2.5.2/test/test_all.rb +9 -0
- data/vendor/net-ssh-2.5.2/test/test_buffer.rb +426 -0
- data/vendor/net-ssh-2.5.2/test/test_buffered_io.rb +63 -0
- data/vendor/net-ssh-2.5.2/test/test_config.rb +120 -0
- data/vendor/net-ssh-2.5.2/test/test_key_factory.rb +121 -0
- data/vendor/net-ssh-2.5.2/test/test_known_hosts.rb +13 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_md5.rb +39 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_md5_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_none.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_ripemd160.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha1.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha1_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_256.rb +35 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_256_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_512.rb +35 -0
- data/vendor/net-ssh-2.5.2/test/transport/hmac/test_sha2_512_96.rb +25 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group14_sha1.rb +13 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group1_sha1.rb +146 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group_exchange_sha1.rb +92 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_diffie_hellman_group_exchange_sha256.rb +33 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp256.rb +161 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp384.rb +37 -0
- data/vendor/net-ssh-2.5.2/test/transport/kex/test_ecdh_sha2_nistp521.rb +37 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_algorithms.rb +330 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_cipher_factory.rb +441 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_hmac.rb +34 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_identity_cipher.rb +40 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_packet_stream.rb +1745 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_server_version.rb +78 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_session.rb +315 -0
- data/vendor/net-ssh-2.5.2/test/transport/test_state.rb +179 -0
- metadata +325 -78
@@ -0,0 +1,43 @@
|
|
1
|
+
module Net; module SFTP; module Protocol; module V01
|
2
|
+
|
3
|
+
# Represents a single named item on the remote server. This includes the
|
4
|
+
# name, attributes about the item, and the "longname", which is intended
|
5
|
+
# for use when displaying directory data, and has no specified format.
|
6
|
+
class Name
|
7
|
+
# The name of the item on the remote server.
|
8
|
+
attr_reader :name
|
9
|
+
|
10
|
+
# The display-ready name of the item, possibly with other attributes.
|
11
|
+
attr_reader :longname
|
12
|
+
|
13
|
+
# The Attributes object describing this item.
|
14
|
+
attr_reader :attributes
|
15
|
+
|
16
|
+
# Create a new Name object with the given name, longname, and attributes.
|
17
|
+
def initialize(name, longname, attributes)
|
18
|
+
@name, @longname, @attributes = name, longname, attributes
|
19
|
+
end
|
20
|
+
|
21
|
+
# Returns +true+ if the item appears to be a directory. It does this by
|
22
|
+
# examining the attributes. If there is insufficient information in the
|
23
|
+
# attributes, this will return nil, rather than a boolean.
|
24
|
+
def directory?
|
25
|
+
attributes.directory?
|
26
|
+
end
|
27
|
+
|
28
|
+
# Returns +true+ if the item appears to be a symlink. It does this by
|
29
|
+
# examining the attributes. If there is insufficient information in the
|
30
|
+
# attributes, this will return nil, rather than a boolean.
|
31
|
+
def symlink?
|
32
|
+
attributes.symlink?
|
33
|
+
end
|
34
|
+
|
35
|
+
# Returns +true+ if the item appears to be a regular file. It does this by
|
36
|
+
# examining the attributes. If there is insufficient information in the
|
37
|
+
# attributes, this will return nil, rather than a boolean.
|
38
|
+
def file?
|
39
|
+
attributes.file?
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
end; end; end; end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'net/sftp/protocol/01/base'
|
2
|
+
|
3
|
+
module Net; module SFTP; module Protocol; module V02
|
4
|
+
|
5
|
+
# Wraps the low-level SFTP calls for version 2 of the SFTP protocol.
|
6
|
+
#
|
7
|
+
# None of these protocol methods block--all of them return immediately,
|
8
|
+
# requiring the SSH event loop to be run while the server response is
|
9
|
+
# pending.
|
10
|
+
#
|
11
|
+
# You will almost certainly never need to use this driver directly. Please
|
12
|
+
# see Net::SFTP::Session for the recommended interface.
|
13
|
+
class Base < V01::Base
|
14
|
+
|
15
|
+
# Returns the protocol version implemented by this driver. (2, in this
|
16
|
+
# case)
|
17
|
+
def version
|
18
|
+
2
|
19
|
+
end
|
20
|
+
|
21
|
+
# Sends a FXP_RENAME packet to the server to request that the file or
|
22
|
+
# directory with the given +name+ (must be a full path) be changed to
|
23
|
+
# +new_name+ (which must also be a path). The +flags+ parameter is
|
24
|
+
# ignored in this version of the protocol.
|
25
|
+
def rename(name, new_name, flags=nil)
|
26
|
+
send_request(FXP_RENAME, :string, name, :string, new_name)
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end; end; end; end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'net/sftp/protocol/02/base'
|
2
|
+
|
3
|
+
module Net; module SFTP; module Protocol; module V03
|
4
|
+
|
5
|
+
# Wraps the low-level SFTP calls for version 3 of the SFTP protocol.
|
6
|
+
#
|
7
|
+
# None of these protocol methods block--all of them return immediately,
|
8
|
+
# requiring the SSH event loop to be run while the server response is
|
9
|
+
# pending.
|
10
|
+
#
|
11
|
+
# You will almost certainly never need to use this driver directly. Please
|
12
|
+
# see Net::SFTP::Session for the recommended interface.
|
13
|
+
class Base < V02::Base
|
14
|
+
|
15
|
+
# Returns the protocol version implemented by this driver. (3, in this
|
16
|
+
# case)
|
17
|
+
def version
|
18
|
+
3
|
19
|
+
end
|
20
|
+
|
21
|
+
# Sends a FXP_READLINK packet to the server to request that the target of
|
22
|
+
# the given symlink on the remote host (+path+) be returned.
|
23
|
+
def readlink(path)
|
24
|
+
send_request(FXP_READLINK, :string, path)
|
25
|
+
end
|
26
|
+
|
27
|
+
# Sends a FXP_SYMLINK packet to the server to request that a symlink at the
|
28
|
+
# given +path+ be created, pointing at +target+..
|
29
|
+
def symlink(path, target)
|
30
|
+
send_request(FXP_SYMLINK, :string, path, :string, target)
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
end; end; end; end
|
@@ -0,0 +1,152 @@
|
|
1
|
+
require 'net/sftp/protocol/01/attributes'
|
2
|
+
|
3
|
+
module Net; module SFTP; module Protocol; module V04
|
4
|
+
|
5
|
+
# A class representing the attributes of a file or directory on the server.
|
6
|
+
# It may be used to specify new attributes, or to query existing attributes.
|
7
|
+
# This particular class is specific to versions 4 and 5 of the SFTP
|
8
|
+
# protocol.
|
9
|
+
#
|
10
|
+
# To specify new attributes, just pass a hash as the argument to the
|
11
|
+
# constructor. The following keys are supported:
|
12
|
+
#
|
13
|
+
# * :type:: the type of the item (integer, one of the T_ constants)
|
14
|
+
# * :size:: the size of the item (integer)
|
15
|
+
# * :uid:: the user-id that owns the file (integer)
|
16
|
+
# * :gid:: the group-id that owns the file (integer)
|
17
|
+
# * :owner:: the name of the user that owns the file (string)
|
18
|
+
# * :group:: the name of the group that owns the file (string)
|
19
|
+
# * :permissions:: the permissions on the file (integer, e.g. 0755)
|
20
|
+
# * :atime:: the access time of the file (integer, seconds since epoch)
|
21
|
+
# * :atime_nseconds:: the nanosecond component of atime (integer)
|
22
|
+
# * :createtime:: the time at which the file was created (integer, seconds since epoch)
|
23
|
+
# * :createtime_nseconds:: the nanosecond component of createtime (integer)
|
24
|
+
# * :mtime:: the modification time of the file (integer, seconds since epoch)
|
25
|
+
# * :mtime_nseconds:: the nanosecond component of mtime (integer)
|
26
|
+
# * :acl:: an array of ACL entries for the item
|
27
|
+
# * :extended:: a hash of name/value pairs identifying extended info
|
28
|
+
#
|
29
|
+
# Likewise, when the server sends an Attributes object, all of the
|
30
|
+
# above attributes are exposed as methods (though not all will be set with
|
31
|
+
# non-nil values from the server).
|
32
|
+
class Attributes < V01::Attributes
|
33
|
+
|
34
|
+
F_ACCESSTIME = 0x00000008
|
35
|
+
F_CREATETIME = 0x00000010
|
36
|
+
F_MODIFYTIME = 0x00000020
|
37
|
+
F_ACL = 0x00000040
|
38
|
+
F_OWNERGROUP = 0x00000080
|
39
|
+
F_SUBSECOND_TIMES = 0x00000100
|
40
|
+
|
41
|
+
# A simple struct for representing a single entry in an Access Control
|
42
|
+
# List. (See Net::SFTP::Constants::ACE)
|
43
|
+
ACL = Struct.new(:type, :flag, :mask, :who)
|
44
|
+
|
45
|
+
class <<self
|
46
|
+
# The list of supported elements in the attributes structure as defined
|
47
|
+
# by v4 of the sftp protocol.
|
48
|
+
def elements #:nodoc:
|
49
|
+
@elements ||= [
|
50
|
+
[:type, :byte, 0],
|
51
|
+
[:size, :int64, V01::Attributes::F_SIZE],
|
52
|
+
[:owner, :string, F_OWNERGROUP],
|
53
|
+
[:group, :string, F_OWNERGROUP],
|
54
|
+
[:permissions, :long, V01::Attributes::F_PERMISSIONS],
|
55
|
+
[:atime, :int64, F_ACCESSTIME],
|
56
|
+
[:atime_nseconds, :long, F_ACCESSTIME | F_SUBSECOND_TIMES],
|
57
|
+
[:createtime, :int64, F_CREATETIME],
|
58
|
+
[:createtime_nseconds, :long, F_CREATETIME | F_SUBSECOND_TIMES],
|
59
|
+
[:mtime, :int64, F_MODIFYTIME],
|
60
|
+
[:mtime_nseconds, :long, F_MODIFYTIME | F_SUBSECOND_TIMES],
|
61
|
+
[:acl, :special, F_ACL],
|
62
|
+
[:extended, :special, V01::Attributes::F_EXTENDED]
|
63
|
+
]
|
64
|
+
end
|
65
|
+
|
66
|
+
private
|
67
|
+
|
68
|
+
# A helper method for parsing the ACL entry in an Attributes struct.
|
69
|
+
def parse_acl(buffer)
|
70
|
+
acl_buf = Net::SSH::Buffer.new(buffer.read_string)
|
71
|
+
acl = []
|
72
|
+
acl_buf.read_long.times do
|
73
|
+
acl << ACL.new(acl_buf.read_long, acl_buf.read_long, acl_buf.read_long, acl_buf.read_string)
|
74
|
+
end
|
75
|
+
acl
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# The type of the item on the remote server. Must be one of the T_* constants.
|
80
|
+
attr_accessor :type
|
81
|
+
|
82
|
+
# The owner of the item on the remote server, as a string.
|
83
|
+
attr_writer :owner
|
84
|
+
|
85
|
+
# The group of the item on the remote server, as a string.
|
86
|
+
attr_writer :group
|
87
|
+
|
88
|
+
# The nanosecond component of the access time.
|
89
|
+
attr_accessor :atime_nseconds
|
90
|
+
|
91
|
+
# The creation time of the remote item, in seconds since the epoch.
|
92
|
+
attr_accessor :createtime
|
93
|
+
|
94
|
+
# The nanosecond component of the creation time.
|
95
|
+
attr_accessor :createtime_nseconds
|
96
|
+
|
97
|
+
# The nanosecond component of the modification time.
|
98
|
+
attr_accessor :mtime_nseconds
|
99
|
+
|
100
|
+
# The array of access control entries for this item.
|
101
|
+
attr_accessor :acl
|
102
|
+
|
103
|
+
# Create a new Attributes instance with the given attributes. The
|
104
|
+
# following keys are supported:
|
105
|
+
#
|
106
|
+
# * :type:: the type of the item (integer, one of the T_ constants)
|
107
|
+
# * :size:: the size of the item (integer)
|
108
|
+
# * :uid:: the user-id that owns the file (integer)
|
109
|
+
# * :gid:: the group-id that owns the file (integer)
|
110
|
+
# * :owner:: the name of the user that owns the file (string)
|
111
|
+
# * :group:: the name of the group that owns the file (string)
|
112
|
+
# * :permissions:: the permissions on the file (integer, e.g. 0755)
|
113
|
+
# * :atime:: the access time of the file (integer, seconds since epoch)
|
114
|
+
# * :atime_nseconds:: the nanosecond component of atime (integer)
|
115
|
+
# * :createtime:: the time at which the file was created (integer, seconds since epoch)
|
116
|
+
# * :createtime_nseconds:: the nanosecond component of createtime (integer)
|
117
|
+
# * :mtime:: the modification time of the file (integer, seconds since epoch)
|
118
|
+
# * :mtime_nseconds:: the nanosecond component of mtime (integer)
|
119
|
+
# * :acl:: an array of ACL entries for the item
|
120
|
+
# * :extended:: a hash of name/value pairs identifying extended info
|
121
|
+
#
|
122
|
+
# All of them default to +nil+ if omitted, except for +type+, which defaults
|
123
|
+
# to T_REGULAR.
|
124
|
+
def initialize(attributes={})
|
125
|
+
super
|
126
|
+
attributes[:type] ||= T_REGULAR
|
127
|
+
end
|
128
|
+
|
129
|
+
private
|
130
|
+
|
131
|
+
# Perform protocol-version-specific preparations for serialization.
|
132
|
+
def prepare_serialization!
|
133
|
+
# force the group/owner to be translated from uid/gid, if those keys
|
134
|
+
# were given on instantiation
|
135
|
+
owner
|
136
|
+
group
|
137
|
+
end
|
138
|
+
|
139
|
+
# Performs protocol-version-specific encoding of the access control
|
140
|
+
# list, if one exists.
|
141
|
+
def encode_acl(buffer)
|
142
|
+
acl_buf = Net::SSH::Buffer.from(:long, acl.length)
|
143
|
+
acl.each do |item|
|
144
|
+
acl_buf.write_long item.type, item.flag, item.mask
|
145
|
+
acl_buf.write_string item.who
|
146
|
+
end
|
147
|
+
buffer.write_string(acl_buf.to_s)
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
end ; end ; end ; end
|
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'net/sftp/protocol/03/base'
|
2
|
+
require 'net/sftp/protocol/04/attributes'
|
3
|
+
require 'net/sftp/protocol/04/name'
|
4
|
+
|
5
|
+
module Net; module SFTP; module Protocol; module V04
|
6
|
+
|
7
|
+
# Wraps the low-level SFTP calls for version 4 of the SFTP protocol. Also
|
8
|
+
# implements the updated FXP_NAME packet parsing as mandated by v4 of the
|
9
|
+
# protocol.
|
10
|
+
#
|
11
|
+
# None of these protocol methods block--all of them return immediately,
|
12
|
+
# requiring the SSH event loop to be run while the server response is
|
13
|
+
# pending.
|
14
|
+
#
|
15
|
+
# You will almost certainly never need to use this driver directly. Please
|
16
|
+
# see Net::SFTP::Session for the recommended interface.
|
17
|
+
class Base < V03::Base
|
18
|
+
|
19
|
+
# Returns the protocol version implemented by this driver. (4, in this
|
20
|
+
# case)
|
21
|
+
def version
|
22
|
+
4
|
23
|
+
end
|
24
|
+
|
25
|
+
# As of v4 of the SFTP protocol, the "longname" member was removed from the
|
26
|
+
# FXP_NAME structure. This method is essentially the same as the previous
|
27
|
+
# implementation, but omits longname.
|
28
|
+
def parse_name_packet(packet)
|
29
|
+
names = []
|
30
|
+
|
31
|
+
packet.read_long.times do
|
32
|
+
filename = packet.read_string
|
33
|
+
attrs = attribute_factory.from_buffer(packet)
|
34
|
+
names << name_factory.new(filename, attrs)
|
35
|
+
end
|
36
|
+
|
37
|
+
{ :names => names }
|
38
|
+
end
|
39
|
+
|
40
|
+
# Sends a FXP_STAT packet to the server for the given +path+, and with the
|
41
|
+
# given +flags+. If +flags+ is nil, it defaults to F_SIZE | F_PERMISSIONS |
|
42
|
+
# F_ACCESSTIME | F_CREATETIME | F_MODIFYTIME | F_ACL | F_OWNERGROUP |
|
43
|
+
# F_SUBSECOND_TIMES | F_EXTENDED (see Net::SFTP::Protocol::V04::Attributes
|
44
|
+
# for those constants).
|
45
|
+
def stat(path, flags=nil)
|
46
|
+
send_request(FXP_STAT, :string, path, :long, flags || DEFAULT_FLAGS)
|
47
|
+
end
|
48
|
+
|
49
|
+
# Sends a FXP_LSTAT packet to the server for the given +path+, and with the
|
50
|
+
# given +flags+. If +flags+ is nil, it defaults to F_SIZE | F_PERMISSIONS |
|
51
|
+
# F_ACCESSTIME | F_CREATETIME | F_MODIFYTIME | F_ACL | F_OWNERGROUP |
|
52
|
+
# F_SUBSECOND_TIMES | F_EXTENDED (see Net::SFTP::Protocol::V04::Attributes
|
53
|
+
# for those constants).
|
54
|
+
def lstat(path, flags=nil)
|
55
|
+
send_request(FXP_LSTAT, :string, path, :long, flags || DEFAULT_FLAGS)
|
56
|
+
end
|
57
|
+
|
58
|
+
# Sends a FXP_FSTAT packet to the server for the given +path+, and with the
|
59
|
+
# given +flags+. If +flags+ is nil, it defaults to F_SIZE | F_PERMISSIONS |
|
60
|
+
# F_ACCESSTIME | F_CREATETIME | F_MODIFYTIME | F_ACL | F_OWNERGROUP |
|
61
|
+
# F_SUBSECOND_TIMES | F_EXTENDED (see Net::SFTP::Protocol::V04::Attributes
|
62
|
+
# for those constants).
|
63
|
+
def fstat(handle, flags=nil)
|
64
|
+
send_request(FXP_FSTAT, :string, handle, :long, flags || DEFAULT_FLAGS)
|
65
|
+
end
|
66
|
+
|
67
|
+
protected
|
68
|
+
|
69
|
+
# The default flags used if the +flags+ parameter is nil for any of the
|
70
|
+
# #stat, #lstat, or #fstat operations.
|
71
|
+
DEFAULT_FLAGS = Attributes::F_SIZE |
|
72
|
+
Attributes::F_PERMISSIONS |
|
73
|
+
Attributes::F_ACCESSTIME |
|
74
|
+
Attributes::F_CREATETIME |
|
75
|
+
Attributes::F_MODIFYTIME |
|
76
|
+
Attributes::F_ACL |
|
77
|
+
Attributes::F_OWNERGROUP |
|
78
|
+
Attributes::F_SUBSECOND_TIMES |
|
79
|
+
Attributes::F_EXTENDED
|
80
|
+
|
81
|
+
# Returns the Attributes class used by this version of the protocol
|
82
|
+
# (Net::SFTP::Protocol::V04::Attributes, in this case)
|
83
|
+
def attribute_factory
|
84
|
+
V04::Attributes
|
85
|
+
end
|
86
|
+
|
87
|
+
# Returns the Name class used by this version of the protocol
|
88
|
+
# (Net::SFTP::Protocol::V04::Name, in this case)
|
89
|
+
def name_factory
|
90
|
+
V04::Name
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
end; end; end; end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
module Net; module SFTP; module Protocol; module V04
|
2
|
+
|
3
|
+
# Represents a single named item on the remote server. This includes the
|
4
|
+
# name, and attributes about the item, and the "longname".
|
5
|
+
#
|
6
|
+
# For backwards compatibility with the format and interface of the Name
|
7
|
+
# structure from previous protocol versions, this also exposes a #longname
|
8
|
+
# method, which returns a string that can be used to display this item in
|
9
|
+
# a directory listing.
|
10
|
+
class Name
|
11
|
+
# The name of the item on the remote server.
|
12
|
+
attr_reader :name
|
13
|
+
|
14
|
+
# Attributes instance describing this item.
|
15
|
+
attr_reader :attributes
|
16
|
+
|
17
|
+
# Create a new Name object with the given name and attributes.
|
18
|
+
def initialize(name, attributes)
|
19
|
+
@name, @attributes = name, attributes
|
20
|
+
end
|
21
|
+
|
22
|
+
# Returns +true+ if the item is a directory.
|
23
|
+
def directory?
|
24
|
+
attributes.directory?
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns +true+ if the item is a symlink.
|
28
|
+
def symlink?
|
29
|
+
attributes.symlink?
|
30
|
+
end
|
31
|
+
|
32
|
+
# Returns +true+ if the item is a regular file.
|
33
|
+
def file?
|
34
|
+
attributes.file?
|
35
|
+
end
|
36
|
+
|
37
|
+
# Returns a string representing this file, in a format similar to that
|
38
|
+
# used by the unix "ls" utility.
|
39
|
+
def longname
|
40
|
+
@longname ||= begin
|
41
|
+
longname = if directory?
|
42
|
+
"d"
|
43
|
+
elsif symlink?
|
44
|
+
"l"
|
45
|
+
else
|
46
|
+
"-"
|
47
|
+
end
|
48
|
+
|
49
|
+
longname << (attributes.permissions & 0400 != 0 ? "r" : "-")
|
50
|
+
longname << (attributes.permissions & 0200 != 0 ? "w" : "-")
|
51
|
+
longname << (attributes.permissions & 0100 != 0 ? "x" : "-")
|
52
|
+
longname << (attributes.permissions & 0040 != 0 ? "r" : "-")
|
53
|
+
longname << (attributes.permissions & 0020 != 0 ? "w" : "-")
|
54
|
+
longname << (attributes.permissions & 0010 != 0 ? "x" : "-")
|
55
|
+
longname << (attributes.permissions & 0004 != 0 ? "r" : "-")
|
56
|
+
longname << (attributes.permissions & 0002 != 0 ? "w" : "-")
|
57
|
+
longname << (attributes.permissions & 0001 != 0 ? "x" : "-")
|
58
|
+
|
59
|
+
longname << (" %-8s %-8s %8d " % [attributes.owner, attributes.group, attributes.size])
|
60
|
+
|
61
|
+
longname << Time.at(attributes.mtime).strftime("%b %e %H:%M ")
|
62
|
+
longname << name
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end; end; end; end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'net/sftp/protocol/04/base'
|
2
|
+
|
3
|
+
module Net; module SFTP; module Protocol; module V05
|
4
|
+
|
5
|
+
# Wraps the low-level SFTP calls for version 5 of the SFTP protocol.
|
6
|
+
#
|
7
|
+
# None of these protocol methods block--all of them return immediately,
|
8
|
+
# requiring the SSH event loop to be run while the server response is
|
9
|
+
# pending.
|
10
|
+
#
|
11
|
+
# You will almost certainly never need to use this driver directly. Please
|
12
|
+
# see Net::SFTP::Session for the recommended interface.
|
13
|
+
class Base < V04::Base
|
14
|
+
# Returns the protocol version implemented by this driver. (5, in this
|
15
|
+
# case)
|
16
|
+
def version
|
17
|
+
5
|
18
|
+
end
|
19
|
+
|
20
|
+
# Sends a FXP_RENAME packet to the server to request that the file or
|
21
|
+
# directory with the given +name+ (must be a full path) be changed to
|
22
|
+
# +new_name+ (which must also be a path). The +flags+ parameter must be
|
23
|
+
# either +nil+ or 0 (the default), or some combination of the
|
24
|
+
# Net::SFTP::Constants::RenameFlags constants.
|
25
|
+
def rename(name, new_name, flags=nil)
|
26
|
+
send_request(FXP_RENAME, :string, name, :string, new_name, :long, flags || 0)
|
27
|
+
end
|
28
|
+
|
29
|
+
# Sends a FXP_OPEN packet to the server and returns the packet identifier.
|
30
|
+
# The +flags+ parameter is either an integer (in which case it must be
|
31
|
+
# a combination of the IO constants) or a string (in which case it must
|
32
|
+
# be one of the mode strings that IO::open accepts). The +options+
|
33
|
+
# parameter is a hash that is used to construct a new Attribute object,
|
34
|
+
# to pass as part of the FXP_OPEN request.
|
35
|
+
def open(path, flags, options)
|
36
|
+
flags = normalize_open_flags(flags)
|
37
|
+
|
38
|
+
sftp_flags, desired_access = if flags & (IO::WRONLY | IO::RDWR) != 0
|
39
|
+
open = if flags & (IO::CREAT | IO::EXCL) == (IO::CREAT | IO::EXCL)
|
40
|
+
FV5::CREATE_NEW
|
41
|
+
elsif flags & (IO::CREAT | IO::TRUNC) == (IO::CREAT | IO::TRUNC)
|
42
|
+
FV5::CREATE_TRUNCATE
|
43
|
+
elsif flags & IO::CREAT == IO::CREAT
|
44
|
+
FV5::OPEN_OR_CREATE
|
45
|
+
else
|
46
|
+
FV5::OPEN_EXISTING
|
47
|
+
end
|
48
|
+
access = ACE::Mask::WRITE_DATA | ACE::Mask::WRITE_ATTRIBUTES
|
49
|
+
access |= ACE::Mask::READ_DATA | ACE::Mask::READ_ATTRIBUTES if (flags & IO::RDWR) == IO::RDWR
|
50
|
+
if flags & IO::APPEND == IO::APPEND
|
51
|
+
open |= FV5::APPEND_DATA
|
52
|
+
access |= ACE::Mask::APPEND_DATA
|
53
|
+
end
|
54
|
+
[open, access]
|
55
|
+
else
|
56
|
+
[FV5::OPEN_EXISTING, ACE::Mask::READ_DATA | ACE::Mask::READ_ATTRIBUTES]
|
57
|
+
end
|
58
|
+
|
59
|
+
attributes = attribute_factory.new(options)
|
60
|
+
|
61
|
+
send_request(FXP_OPEN, :string, path, :long, desired_access, :long, sftp_flags, :raw, attributes.to_s)
|
62
|
+
end
|
63
|
+
|
64
|
+
end
|
65
|
+
|
66
|
+
end; end; end; end
|