vagrant-unbundled 2.2.4.0 → 2.2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +44 -0
- data/Gemfile.lock +10 -10
- data/LICENSE +1 -1
- data/README.md +10 -0
- data/RELEASE.md +11 -25
- data/contrib/bash/completion.sh +1 -1
- data/lib/vagrant/action/builtin/mixin_synced_folders.rb +7 -1
- data/lib/vagrant/action/general/package.rb +18 -0
- data/lib/vagrant/action/runner.rb +1 -1
- data/lib/vagrant/action/warden.rb +1 -1
- data/lib/vagrant/batch_action.rb +14 -0
- data/lib/vagrant/box_collection.rb +1 -1
- data/lib/vagrant/bundler.rb +29 -8
- data/lib/vagrant/cli.rb +1 -1
- data/lib/vagrant/environment.rb +50 -5
- data/lib/vagrant/machine.rb +4 -1
- data/lib/vagrant/plugin/v2/trigger.rb +12 -3
- data/lib/vagrant/shared_helpers.rb +8 -0
- data/lib/vagrant/util/guest_inspection.rb +19 -0
- data/lib/vagrant/vagrantfile.rb +18 -14
- data/plugins/commands/box/command/update.rb +8 -2
- data/plugins/commands/cloud/box/create.rb +1 -1
- data/plugins/commands/cloud/box/delete.rb +1 -1
- data/plugins/commands/cloud/provider/create.rb +1 -1
- data/plugins/commands/cloud/provider/delete.rb +1 -1
- data/plugins/commands/cloud/provider/update.rb +1 -1
- data/plugins/commands/cloud/provider/upload.rb +1 -1
- data/plugins/commands/cloud/publish.rb +1 -1
- data/plugins/commands/cloud/search.rb +1 -1
- data/plugins/commands/cloud/version/create.rb +1 -1
- data/plugins/commands/cloud/version/delete.rb +1 -1
- data/plugins/commands/cloud/version/release.rb +1 -1
- data/plugins/commands/cloud/version/revoke.rb +1 -1
- data/plugins/commands/cloud/version/update.rb +1 -1
- data/plugins/commands/global-status/command.rb +11 -0
- data/plugins/commands/snapshot/command/list.rb +2 -1
- data/plugins/commands/snapshot/command/pop.rb +3 -1
- data/plugins/communicators/ssh/communicator.rb +0 -1
- data/plugins/guests/bsd/cap/{virtualbox.rb → mount_virtualbox_shared_folder.rb} +1 -1
- data/plugins/guests/bsd/plugin.rb +2 -2
- data/plugins/guests/coreos/cap/change_host_name.rb +24 -7
- data/plugins/guests/coreos/cap/configure_networks.rb +48 -64
- data/plugins/guests/freebsd/cap/configure_networks.rb +2 -2
- data/plugins/guests/freebsd/cap/mount_virtualbox_shared_folder.rb +76 -0
- data/plugins/guests/freebsd/plugin.rb +10 -0
- data/plugins/hosts/bsd/cap/nfs.rb +1 -1
- data/plugins/hosts/freebsd/cap/nfs.rb +1 -1
- data/plugins/hosts/void/cap/nfs.rb +1 -1
- data/plugins/kernel_v2/config/vm_trigger.rb +1 -1
- data/plugins/providers/docker/action/connect_networks.rb +77 -0
- data/plugins/providers/docker/action/destroy_network.rb +50 -0
- data/plugins/providers/docker/action/prepare_networks.rb +355 -0
- data/plugins/providers/docker/action.rb +9 -3
- data/plugins/providers/docker/driver/compose.rb +13 -1
- data/plugins/providers/docker/driver.rb +148 -4
- data/plugins/providers/docker/errors.rb +28 -0
- data/plugins/providers/docker/provider.rb +8 -0
- data/plugins/providers/virtualbox/cap.rb +1 -0
- data/plugins/provisioners/ansible/cap/guest/debian/ansible_install.rb +5 -5
- data/plugins/provisioners/ansible/cap/guest/fedora/ansible_install.rb +5 -5
- data/plugins/provisioners/ansible/cap/guest/pip/pip.rb +15 -2
- data/plugins/provisioners/ansible/cap/guest/redhat/ansible_install.rb +5 -5
- data/plugins/provisioners/ansible/cap/guest/ubuntu/ansible_install.rb +2 -2
- data/plugins/provisioners/ansible/config/guest.rb +3 -0
- data/plugins/provisioners/ansible/provisioner/guest.rb +5 -2
- data/plugins/provisioners/chef/cap/freebsd/chef_installed.rb +1 -1
- data/plugins/provisioners/chef/cap/linux/chef_installed.rb +1 -1
- data/plugins/provisioners/chef/cap/omnios/chef_installed.rb +1 -1
- data/plugins/provisioners/chef/cap/windows/chef_installed.rb +2 -2
- data/plugins/provisioners/chef/provisioner/base.rb +1 -1
- data/plugins/synced_folders/rsync/command/rsync_auto.rb +5 -1
- data/plugins/synced_folders/rsync/default_unix_cap.rb +1 -1
- data/plugins/synced_folders/rsync/helper.rb +8 -7
- data/plugins/synced_folders/smb/synced_folder.rb +21 -0
- data/templates/locales/en.yml +8 -4
- data/templates/locales/providers_docker.yml +70 -0
- data/templates/nfs/{exports_freebsd.erb → exports_bsd.erb} +0 -0
- data/vendor/bundle/ruby/2.6.0/bundler/gems/vagrant-spec-abfc34474d12/vagrant-spec.gemspec +3 -3
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bcrypt_pbkdf-1.0.1/bcrypt_pbkdf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bcrypt_pbkdf-1.0.1/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/bcrypt_pbkdf-1.0.1/gem_make.out +19 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/unf_ext-0.0.7.6/gem.build_complete +0 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/unf_ext-0.0.7.6/gem_make.out +16 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/unf_ext-0.0.7.6/mkmf.log +35 -0
- data/vendor/bundle/ruby/2.6.0/extensions/x86_64-linux/2.6.0/unf_ext-0.0.7.6/unf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/.travis.yml +8 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/CHANGELOG.md +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/COPYING +23 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/Gemfile +2 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/Gemfile.lock +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/README.md +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/Rakefile +56 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/bcrypt_pbkdf.gemspec +29 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/.sitearchdir.time +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/Makefile +265 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/bcrypt_pbkdf.c +169 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/bcrypt_pbkdf.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/bcrypt_pbkdf_ext.c +44 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/bcrypt_pbkdf_ext.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/bcrypt_pbkdf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/blf.h +90 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/blowfish.c +698 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/blowfish.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/crypto_api.h +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/crypto_hash_sha512.h +19 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/explicit_bzero.c +20 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/explicit_bzero.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/extconf.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/hash_sha512.c +320 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/hash_sha512.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/includes.h +27 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/sha2.h +13 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/util.h +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/ext/mri/utils.h +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/lib/bcrypt_pbkdf.rb +24 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/lib/bcrypt_pbkdf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/test/bcrypt_pnkdf/engine_test.rb +76 -0
- data/vendor/bundle/ruby/2.6.0/gems/bcrypt_pbkdf-1.0.1/test/test_helper.rb +2 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/.document +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/.gitignore +17 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/.travis.yml +21 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/CHANGELOG.md +219 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/Gemfile +4 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/LICENSE.txt +78 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/README.md +67 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/Rakefile +111 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/data/public_suffix_list.dat +12985 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/domain_name.gemspec +36 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb +8787 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib/domain_name/etld_data.rb.erb +11 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib/domain_name/punycode.rb +283 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib/domain_name/version.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/lib/domain_name.rb +297 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/test/helper.rb +17 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/test/test_domain_name-punycode.rb +97 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/test/test_domain_name.rb +317 -0
- data/vendor/bundle/ruby/2.6.0/gems/domain_name-0.5.20190701/tool/gen_etld_data.rb +63 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/.gitignore +11 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/COPYING +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/Changelog.md +23 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/Gemfile +2 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/README.md +22 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/Rakefile +11 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/VERSION +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/examples/gss_client.rb +26 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/examples/gss_iov_client.rb +55 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/examples/gss_iov_helpers.rb +74 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/examples/gss_iov_server.rb +67 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/examples/gss_server.rb +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/gssapi.gemspec +34 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/exceptions.rb +50 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/extensions.rb +40 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/heimdal.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/lib_gssapi.rb +414 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/lib_gssapi_loader.rb +80 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi/simple.rb +269 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/lib/gssapi.rb +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/preamble +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/test/spec/gssapi_simple_spec.rb +70 -0
- data/vendor/bundle/ruby/2.6.0/gems/gssapi-1.3.0/test/spec/test_buffer_spec.rb +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/Code-of-Conduct.md +73 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/Contributing.md +141 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/History.md +223 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/Licence.md +25 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/Manifest.txt +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/README.rdoc +200 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/Rakefile +284 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/type/columnar.rb +57 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/type.rb +587 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/_columnar.rb +136 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/cache.rb +58 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/columnar.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/container.rb +96 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/deprecations.rb +32 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/full.rb +19 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/loader.rb +146 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/logger.rb +39 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types/registry.rb +90 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime/types.rb +231 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/lib/mime-types.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/bad-fixtures/malformed +9 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/fixture/json.json +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/fixture/old-data +9 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/fixture/yaml.yaml +55 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/minitest_helper.rb +13 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_type.rb +610 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_types.rb +169 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_types_cache.rb +118 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_types_class.rb +159 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_types_lazy.rb +49 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-3.3/test/test_mime_types_loader.rb +32 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/Code-of-Conduct.md +75 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/Contributing.md +161 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/History.md +396 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/Licence.md +25 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/Manifest.txt +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/README.md +63 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/Rakefile +94 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime-types.json +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.content_type.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.docs.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.encoding.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.flags.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.friendly.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.pext.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.use_instead.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/data/mime.xrefs.column +2212 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/lib/mime/types/data.rb +21 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/lib/mime-types-data.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/application.yaml +16342 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/audio.yaml +1644 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/chemical.yaml +71 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/conference.yaml +9 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/drawing.yaml +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/font.yaml +65 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/image.yaml +1069 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/message.yaml +200 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/model.yaml +302 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/multipart.yaml +179 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/text.yaml +1046 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/video.yaml +1070 -0
- data/vendor/bundle/ruby/2.6.0/gems/mime-types-data-3.2019.0904/types/world.yaml +8 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/README.md +313 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/Rakefile +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/TODO +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/central_directory.rb +208 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/compressor.rb +9 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/constants.rb +63 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/crypto/encryption.rb +11 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/crypto/null_encryption.rb +43 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/crypto/traditional_encryption.rb +99 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/decompressor.rb +13 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/deflater.rb +34 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/dos_time.rb +48 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/entry.rb +688 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/entry_set.rb +86 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/errors.rb +17 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/generic.rb +43 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/ntfs.rb +90 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/old_unix.rb +44 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/universal_time.rb +47 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/unix.rb +37 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/zip64.rb +68 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field/zip64_placeholder.rb +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/extra_field.rb +101 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/file.rb +436 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/filesystem.rb +627 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/inflater.rb +66 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/input_stream.rb +173 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/ioextras/abstract_input_stream.rb +111 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/ioextras/abstract_output_stream.rb +43 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/ioextras.rb +36 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/null_compressor.rb +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/null_decompressor.rb +27 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/null_input_stream.rb +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/output_stream.rb +189 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/pass_thru_compressor.rb +23 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/pass_thru_decompressor.rb +40 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/streamable_directory.rb +15 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/streamable_stream.rb +56 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip/version.rb +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/lib/zip.rb +69 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/example.rb +81 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/example_filesystem.rb +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/example_recursive.rb +54 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/gtk_ruby_zip.rb +84 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/qtzip.rb +92 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/write_simple.rb +12 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/samples/zipfind.rb +66 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/basic_zip_file_test.rb +60 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/case_sensitivity_test.rb +69 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/central_directory_entry_test.rb +69 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/central_directory_test.rb +100 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/crypto/null_encryption_test.rb +57 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/crypto/traditional_encryption_test.rb +80 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/WarnInvalidDate.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/file1.txt +46 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/file1.txt.deflatedData +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/file2.txt +1504 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/globTest/foo/bar/baz/foo.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/globTest/foo.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/globTest/food.txt +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/globTest.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/gpbit3stored.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/mimetype +1 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/notzippedruby.rb +7 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/ntfs.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/oddExtraField.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/Makefile +10 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/README.md +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/absolute1.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/absolute2.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/dirsymlink.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/dirsymlink2a.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/dirsymlink2b.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/relative0.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/relative2.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/jwilk/symlink.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/relative1.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/tilde.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/tuzovakaoff/README.md +3 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/tuzovakaoff/absolutepath.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/path_traversal/tuzovakaoff/symlink.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/rubycode.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/rubycode2.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/test.xls +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/testDirectory.bin +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/zip64-sample.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/zipWithDirs.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/data/zipWithEncryption.zip +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/deflater_test.rb +65 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/encryption_test.rb +42 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/entry_set_test.rb +163 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/entry_test.rb +154 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/errors_test.rb +35 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/extra_field_test.rb +76 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/file_extract_directory_test.rb +54 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/file_extract_test.rb +83 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/file_permissions_test.rb +65 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/file_split_test.rb +57 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/file_test.rb +646 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/filesystem/dir_iterator_test.rb +58 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/filesystem/directory_test.rb +139 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/filesystem/file_mutating_test.rb +87 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/filesystem/file_nonmutating_test.rb +508 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/filesystem/file_stat_test.rb +64 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/gentestfiles.rb +126 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/inflater_test.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/input_stream_test.rb +182 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/ioextras/abstract_input_stream_test.rb +102 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/ioextras/abstract_output_stream_test.rb +106 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/ioextras/fake_io_test.rb +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/local_entry_test.rb +154 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/output_stream_test.rb +128 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/pass_thru_compressor_test.rb +30 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/pass_thru_decompressor_test.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/path_traversal_test.rb +141 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/samples/example_recursive_test.rb +37 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/settings_test.rb +95 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/test_helper.rb +234 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/unicode_file_names_and_comments_test.rb +62 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/zip64_full_test.rb +51 -0
- data/vendor/bundle/ruby/2.6.0/gems/rubyzip-1.2.4/test/zip64_support_test.rb +14 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/.document +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/.gitignore +19 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/.travis.yml +24 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/CHANGELOG.md +42 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/Gemfile +4 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/README.md +57 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/Rakefile +31 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/.sitearchdir.time +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/Makefile +265 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/extconf.rb +50 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/normalizer.hh +139 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/table.hh +13617 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/trie/char_stream.hh +150 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/trie/node.hh +25 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/trie/searcher.hh +194 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf/util.hh +24 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf.cc +75 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf.o +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/ext/unf_ext/unf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/lib/unf_ext/version.rb +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/lib/unf_ext.rb +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/lib/unf_ext.so +0 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/test/helper.rb +18 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/test/normalization-test.txt +112332 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/test/test_unf_ext.rb +41 -0
- data/vendor/bundle/ruby/2.6.0/gems/unf_ext-0.0.7.6/unf_ext.gemspec +42 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/LICENSE +202 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/README.md +276 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/bin/rwinrm +90 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/connection.rb +84 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/connection_opts.rb +90 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/exceptions.rb +88 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/http/response_handler.rb +127 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/http/transport.rb +462 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/http/transport_factory.rb +64 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/output.rb +58 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/create_pipeline.xml.erb +167 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/fragment.rb +68 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/init_runspace_pool.xml.erb +224 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message.rb +128 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/base.rb +47 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/error_record.rb +66 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/pipeline_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/pipeline_output.rb +48 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/pipeline_state.rb +38 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/runspacepool_host_call.rb +30 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/runspacepool_state.rb +37 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data/session_capability.rb +34 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_data.rb +40 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_defragmenter.rb +62 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_factory.rb +74 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/message_fragmenter.rb +58 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/powershell_output_decoder.rb +142 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/receive_response_reader.rb +95 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/session_capability.xml.erb +7 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/psrp/uuid.rb +39 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/shells/base.rb +187 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/shells/cmd.rb +63 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/shells/power_shell.rb +206 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/shells/retryable.rb +44 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/shells/shell_factory.rb +56 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/version.rb +5 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/base.rb +57 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/cleanup_command.rb +60 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/close_shell.rb +49 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/command.rb +100 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/command_output.rb +75 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/command_output_decoder.rb +54 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/configuration.rb +44 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/create_pipeline.rb +64 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/create_shell.rb +115 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/header.rb +213 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/init_runspace_pool.rb +96 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/iso8601_duration.rb +58 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/keep_alive.rb +66 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/receive_response_reader.rb +128 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/send_data.rb +66 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/soap.rb +49 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/wql_pull.rb +54 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/wql_query.rb +98 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm/wsmv/write_stdin.rb +86 -0
- data/vendor/bundle/ruby/2.6.0/gems/winrm-2.3.2/lib/winrm.rb +37 -0
- data/vendor/bundle/ruby/2.6.0/specifications/bcrypt_pbkdf-1.0.1.gemspec +49 -0
- data/vendor/bundle/ruby/2.6.0/specifications/domain_name-0.5.20190701.gemspec +46 -0
- data/vendor/bundle/ruby/2.6.0/specifications/gssapi-1.3.0.gemspec +36 -0
- data/vendor/bundle/ruby/2.6.0/specifications/mime-types-3.3.gemspec +84 -0
- data/vendor/bundle/ruby/2.6.0/specifications/mime-types-data-3.2019.0904.gemspec +60 -0
- data/vendor/bundle/ruby/2.6.0/specifications/rubyzip-1.2.4.gemspec +44 -0
- data/vendor/bundle/ruby/2.6.0/specifications/unf_ext-0.0.7.6.gemspec +51 -0
- data/vendor/bundle/ruby/2.6.0/specifications/winrm-2.3.2.gemspec +73 -0
- data/version.txt +1 -1
- metadata +365 -6
- data/templates/nfs/exports.erb +0 -5
@@ -0,0 +1,95 @@
|
|
1
|
+
# Copyright 2016 Matt Wrock <matt@mattwrock.com>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'nori'
|
16
|
+
require_relative 'powershell_output_decoder'
|
17
|
+
require_relative 'message_defragmenter'
|
18
|
+
|
19
|
+
module WinRM
|
20
|
+
module PSRP
|
21
|
+
# Class for reading powershell responses in Receive_Response messages
|
22
|
+
class ReceiveResponseReader < WSMV::ReceiveResponseReader
|
23
|
+
# Creates a new ReceiveResponseReader
|
24
|
+
# @param transport [HttpTransport] The WinRM SOAP transport
|
25
|
+
# @param logger [Logger] The logger to log diagnostic messages to
|
26
|
+
def initialize(transport, logger)
|
27
|
+
super
|
28
|
+
@output_decoder = PowershellOutputDecoder.new
|
29
|
+
end
|
30
|
+
|
31
|
+
# Reads PSRP messages sent in one or more receive response messages
|
32
|
+
# @param wsmv_message [WinRM::WSMV::Base] A wsmv message to send to endpoint
|
33
|
+
# @param wait_for_done_state whether to poll for a CommandState of Done
|
34
|
+
# @yield [Message] PSRP Message in response
|
35
|
+
# @yieldreturn [Array<Message>] All messages in response
|
36
|
+
def read_message(wsmv_message, wait_for_done_state = false)
|
37
|
+
messages = []
|
38
|
+
defragmenter = MessageDefragmenter.new
|
39
|
+
read_response(wsmv_message, wait_for_done_state) do |stream|
|
40
|
+
message = defragmenter.defragment(stream[:text])
|
41
|
+
next unless message
|
42
|
+
|
43
|
+
if block_given?
|
44
|
+
yield message
|
45
|
+
else
|
46
|
+
messages.push(message)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
messages unless block_given?
|
50
|
+
end
|
51
|
+
|
52
|
+
# Reads streams and returns decoded output
|
53
|
+
# @param wsmv_message [WinRM::WSMV::Base] A wsmv message to send to endpoint
|
54
|
+
# @yieldparam [string] standard out response text
|
55
|
+
# @yieldparam [string] standard error response text
|
56
|
+
# @yieldreturn [WinRM::Output] The command output
|
57
|
+
def read_output(wsmv_message)
|
58
|
+
with_output do |output|
|
59
|
+
read_message(wsmv_message, true) do |message|
|
60
|
+
exit_code = find_exit_code(message)
|
61
|
+
output.exitcode = exit_code if exit_code
|
62
|
+
decoded_text = @output_decoder.decode(message)
|
63
|
+
next unless decoded_text
|
64
|
+
|
65
|
+
out = { stream_type(message) => decoded_text }
|
66
|
+
output << out
|
67
|
+
yield [out[:stdout], out[:stderr]] if block_given?
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
private
|
73
|
+
|
74
|
+
def stream_type(message)
|
75
|
+
type = :stdout
|
76
|
+
case message.type
|
77
|
+
when WinRM::PSRP::Message::MESSAGE_TYPES[:error_record]
|
78
|
+
type = :stderr
|
79
|
+
when WinRM::PSRP::Message::MESSAGE_TYPES[:pipeline_host_call]
|
80
|
+
type = :stderr if message.data.include?('WriteError')
|
81
|
+
when WinRM::PSRP::Message::MESSAGE_TYPES[:pipeline_state]
|
82
|
+
type = :stderr if message.parsed_data.pipeline_state == WinRM::PSRP::MessageData::PipelineState::FAILED
|
83
|
+
end
|
84
|
+
type
|
85
|
+
end
|
86
|
+
|
87
|
+
def find_exit_code(message)
|
88
|
+
parsed = message.parsed_data
|
89
|
+
return nil unless parsed.is_a?(MessageData::PipelineHostCall)
|
90
|
+
|
91
|
+
parsed.method_parameters[:i32].to_i if parsed.method_identifier == 'SetShouldExit'
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module WinRM
|
16
|
+
module PSRP
|
17
|
+
# UUID helper methods
|
18
|
+
module UUID
|
19
|
+
# Format a UUID into a GUID compatible byte array for Windows
|
20
|
+
#
|
21
|
+
# https://msdn.microsoft.com/en-us/library/windows/desktop/aa373931(v=vs.85).aspx
|
22
|
+
# typedef struct _GUID {
|
23
|
+
# DWORD Data1;
|
24
|
+
# WORD Data2;
|
25
|
+
# WORD Data3;
|
26
|
+
# BYTE Data4[8];
|
27
|
+
# } GUID;
|
28
|
+
#
|
29
|
+
# @param uuid [String] Canonical hex format with hypens.
|
30
|
+
# @return [Array<byte>] UUID in a Windows GUID compatible byte array layout.
|
31
|
+
def uuid_to_windows_guid_bytes(uuid)
|
32
|
+
return [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] unless uuid
|
33
|
+
|
34
|
+
b = uuid.scan(/[0-9a-fA-F]{2}/).map { |x| x.to_i(16) }
|
35
|
+
b[0..3].reverse + b[4..5].reverse + b[6..7].reverse + b[8..15]
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,187 @@
|
|
1
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require_relative 'retryable'
|
16
|
+
require_relative '../http/transport'
|
17
|
+
require_relative '../wsmv/cleanup_command'
|
18
|
+
require_relative '../wsmv/close_shell'
|
19
|
+
require_relative '../wsmv/command'
|
20
|
+
require_relative '../wsmv/command_output'
|
21
|
+
require_relative '../wsmv/receive_response_reader'
|
22
|
+
require_relative '../wsmv/create_shell'
|
23
|
+
require_relative '../wsmv/soap'
|
24
|
+
|
25
|
+
module WinRM
|
26
|
+
module Shells
|
27
|
+
# Base class for remote shell
|
28
|
+
class Base
|
29
|
+
TOO_MANY_COMMANDS = '2150859174'.freeze
|
30
|
+
ERROR_OPERATION_ABORTED = '995'.freeze
|
31
|
+
SHELL_NOT_FOUND = '2150858843'.freeze
|
32
|
+
|
33
|
+
FAULTS_FOR_RESET = [
|
34
|
+
'2150858843', # Shell has been closed
|
35
|
+
'2147943418', # Error reading registry key
|
36
|
+
TOO_MANY_COMMANDS, # Maximum commands per user exceeded
|
37
|
+
].freeze
|
38
|
+
|
39
|
+
include Retryable
|
40
|
+
|
41
|
+
# Create a new Cmd shell
|
42
|
+
# @param connection_opts [ConnectionOpts] The WinRM connection options
|
43
|
+
# @param transport [HttpTransport] The WinRM SOAP transport
|
44
|
+
# @param logger [Logger] The logger to log diagnostic messages to
|
45
|
+
# @param shell_opts [Hash] Options targeted for the created shell
|
46
|
+
def initialize(connection_opts, transport, logger, shell_opts = {})
|
47
|
+
@connection_opts = connection_opts
|
48
|
+
@transport = transport
|
49
|
+
@logger = logger
|
50
|
+
@shell_opts = shell_opts
|
51
|
+
end
|
52
|
+
|
53
|
+
# @return [String] shell id of the currently opn shell or nil if shell is closed
|
54
|
+
attr_reader :shell_id
|
55
|
+
|
56
|
+
# @return [String] uri that SOAP calls use to identify shell type
|
57
|
+
attr_reader :shell_uri
|
58
|
+
|
59
|
+
# @return [ConnectionOpts] connection options of the shell
|
60
|
+
attr_reader :connection_opts
|
61
|
+
|
62
|
+
# @return [WinRM::HTTP::HttpTransport] transport used to talk with endpoint
|
63
|
+
attr_reader :transport
|
64
|
+
|
65
|
+
# @return [Logger] logger used for diagnostic messages
|
66
|
+
attr_reader :logger
|
67
|
+
|
68
|
+
# @return [Hash] Options targeted for the created shell
|
69
|
+
attr_reader :shell_opts
|
70
|
+
|
71
|
+
# Runs the specified command with optional arguments
|
72
|
+
# @param command [String] The command or executable to run
|
73
|
+
# @param arguments [Array] The optional command arguments
|
74
|
+
# @param block [&block] The optional callback for any realtime output
|
75
|
+
# @yieldparam [string] standard out response text
|
76
|
+
# @yieldparam [string] standard error response text
|
77
|
+
# @yieldreturn [WinRM::Output] The command output
|
78
|
+
def run(command, arguments = [], &block)
|
79
|
+
with_command_shell(command, arguments) do |shell, cmd|
|
80
|
+
response_reader.read_output(command_output_message(shell, cmd), &block)
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Closes the shell if one is open
|
85
|
+
def close
|
86
|
+
return unless shell_id
|
87
|
+
|
88
|
+
begin
|
89
|
+
self.class.close_shell(connection_opts, transport, shell_id)
|
90
|
+
rescue WinRMWSManFault => e
|
91
|
+
raise unless [ERROR_OPERATION_ABORTED, SHELL_NOT_FOUND].include?(e.fault_code)
|
92
|
+
end
|
93
|
+
remove_finalizer
|
94
|
+
@shell_id = nil
|
95
|
+
end
|
96
|
+
|
97
|
+
protected
|
98
|
+
|
99
|
+
def send_command(_command, _arguments)
|
100
|
+
raise NotImplementedError
|
101
|
+
end
|
102
|
+
|
103
|
+
def response_reader
|
104
|
+
raise NotImplementedError
|
105
|
+
end
|
106
|
+
|
107
|
+
def open_shell
|
108
|
+
raise NotImplementedError
|
109
|
+
end
|
110
|
+
|
111
|
+
def out_streams
|
112
|
+
raise NotImplementedError
|
113
|
+
end
|
114
|
+
|
115
|
+
def command_output_message(shell_id, command_id)
|
116
|
+
cmd_out_opts = {
|
117
|
+
shell_id: shell_id,
|
118
|
+
command_id: command_id,
|
119
|
+
shell_uri: shell_uri,
|
120
|
+
out_streams: out_streams
|
121
|
+
}
|
122
|
+
WinRM::WSMV::CommandOutput.new(connection_opts, cmd_out_opts)
|
123
|
+
end
|
124
|
+
|
125
|
+
def with_command_shell(command, arguments = [])
|
126
|
+
tries ||= 2
|
127
|
+
|
128
|
+
open unless shell_id
|
129
|
+
command_id = send_command(command, arguments)
|
130
|
+
logger.debug("[WinRM] creating command_id: #{command_id} on shell_id #{shell_id}")
|
131
|
+
yield shell_id, command_id
|
132
|
+
rescue WinRMWSManFault => e
|
133
|
+
raise unless FAULTS_FOR_RESET.include?(e.fault_code) && (tries -= 1) > 0
|
134
|
+
|
135
|
+
reset_on_error(e)
|
136
|
+
retry
|
137
|
+
ensure
|
138
|
+
cleanup_command(command_id) if command_id
|
139
|
+
end
|
140
|
+
|
141
|
+
private
|
142
|
+
|
143
|
+
def reset_on_error(error)
|
144
|
+
close if error.fault_code == TOO_MANY_COMMANDS
|
145
|
+
logger.debug('[WinRM] opening new shell since the current one was deleted')
|
146
|
+
@shell_id = nil
|
147
|
+
end
|
148
|
+
|
149
|
+
def cleanup_command(command_id)
|
150
|
+
logger.debug("[WinRM] cleaning up command_id: #{command_id} on shell_id #{shell_id}")
|
151
|
+
cleanup_msg = WinRM::WSMV::CleanupCommand.new(
|
152
|
+
connection_opts,
|
153
|
+
shell_uri: shell_uri,
|
154
|
+
shell_id: shell_id,
|
155
|
+
command_id: command_id
|
156
|
+
)
|
157
|
+
transport.send_request(cleanup_msg.build)
|
158
|
+
rescue WinRMWSManFault => e
|
159
|
+
raise unless [ERROR_OPERATION_ABORTED, SHELL_NOT_FOUND].include?(e.fault_code)
|
160
|
+
rescue WinRMHTTPTransportError => t
|
161
|
+
# dont let the cleanup raise so we dont lose any errors from the command
|
162
|
+
logger.info("[WinRM] #{t.status_code} returned in cleanup with error: #{t.message}")
|
163
|
+
end
|
164
|
+
|
165
|
+
def open
|
166
|
+
close
|
167
|
+
retryable(connection_opts[:retry_limit], connection_opts[:retry_delay]) do
|
168
|
+
logger.debug("[WinRM] opening remote shell on #{connection_opts[:endpoint]}")
|
169
|
+
@shell_id = open_shell
|
170
|
+
end
|
171
|
+
logger.debug("[WinRM] remote shell created with shell_id: #{shell_id}")
|
172
|
+
add_finalizer
|
173
|
+
end
|
174
|
+
|
175
|
+
def add_finalizer
|
176
|
+
ObjectSpace.define_finalizer(
|
177
|
+
self,
|
178
|
+
self.class.finalize(connection_opts, transport, shell_id)
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
182
|
+
def remove_finalizer
|
183
|
+
ObjectSpace.undefine_finalizer(self)
|
184
|
+
end
|
185
|
+
end
|
186
|
+
end
|
187
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require_relative 'base'
|
16
|
+
|
17
|
+
module WinRM
|
18
|
+
module Shells
|
19
|
+
# Proxy to a remote cmd.exe shell
|
20
|
+
class Cmd < Base
|
21
|
+
include WinRM::WSMV::SOAP
|
22
|
+
class << self
|
23
|
+
def finalize(connection_opts, transport, shell_id)
|
24
|
+
proc { Cmd.close_shell(connection_opts, transport, shell_id) }
|
25
|
+
end
|
26
|
+
|
27
|
+
def close_shell(connection_opts, transport, shell_id)
|
28
|
+
msg = WinRM::WSMV::CloseShell.new(connection_opts, shell_id: shell_id)
|
29
|
+
transport.send_request(msg.build)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
protected
|
34
|
+
|
35
|
+
def send_command(command, arguments)
|
36
|
+
cmd_msg = WinRM::WSMV::Command.new(
|
37
|
+
connection_opts,
|
38
|
+
shell_id: shell_id,
|
39
|
+
command: command,
|
40
|
+
arguments: arguments
|
41
|
+
)
|
42
|
+
resp_doc = transport.send_request(cmd_msg.build)
|
43
|
+
command_id = REXML::XPath.first(resp_doc, "//*[local-name() = 'CommandId']").text
|
44
|
+
logger.debug("[WinRM] Command created for #{command} with id: #{command_id}")
|
45
|
+
command_id
|
46
|
+
end
|
47
|
+
|
48
|
+
def response_reader
|
49
|
+
@response_reader ||= WinRM::WSMV::ReceiveResponseReader.new(transport, logger)
|
50
|
+
end
|
51
|
+
|
52
|
+
def open_shell
|
53
|
+
msg = WinRM::WSMV::CreateShell.new(connection_opts, shell_opts)
|
54
|
+
resp_doc = transport.send_request(msg.build)
|
55
|
+
REXML::XPath.first(resp_doc, "//*[@Name='ShellId']").text
|
56
|
+
end
|
57
|
+
|
58
|
+
def out_streams
|
59
|
+
%w[stdout stderr]
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
@@ -0,0 +1,206 @@
|
|
1
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
require 'securerandom'
|
16
|
+
require_relative 'base'
|
17
|
+
require_relative '../psrp/message_fragmenter'
|
18
|
+
require_relative '../psrp/receive_response_reader'
|
19
|
+
require_relative '../wsmv/configuration'
|
20
|
+
require_relative '../wsmv/create_pipeline'
|
21
|
+
require_relative '../wsmv/send_data'
|
22
|
+
require_relative '../wsmv/init_runspace_pool'
|
23
|
+
require_relative '../wsmv/keep_alive'
|
24
|
+
|
25
|
+
module WinRM
|
26
|
+
module Shells
|
27
|
+
# Proxy to a remote PowerShell instance
|
28
|
+
class Powershell < Base
|
29
|
+
include WinRM::WSMV::SOAP
|
30
|
+
|
31
|
+
class << self
|
32
|
+
def finalize(connection_opts, transport, shell_id)
|
33
|
+
proc { Powershell.close_shell(connection_opts, transport, shell_id) }
|
34
|
+
end
|
35
|
+
|
36
|
+
def close_shell(connection_opts, transport, shell_id)
|
37
|
+
msg = WinRM::WSMV::CloseShell.new(
|
38
|
+
connection_opts,
|
39
|
+
shell_id: shell_id,
|
40
|
+
shell_uri: WinRM::WSMV::Header::RESOURCE_URI_POWERSHELL
|
41
|
+
)
|
42
|
+
transport.send_request(msg.build)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# Create a new powershell shell
|
47
|
+
# @param connection_opts [ConnectionOpts] The WinRM connection options
|
48
|
+
# @param transport [HttpTransport] The WinRM SOAP transport
|
49
|
+
# @param logger [Logger] The logger to log diagnostic messages to
|
50
|
+
def initialize(connection_opts, transport, logger)
|
51
|
+
super
|
52
|
+
@shell_uri = WinRM::WSMV::Header::RESOURCE_URI_POWERSHELL
|
53
|
+
end
|
54
|
+
|
55
|
+
# Runs the specified command
|
56
|
+
# @param command [String] The powershell script to run
|
57
|
+
# @param block [&block] The optional callback for any realtime output
|
58
|
+
# @yield [Message] PSRP Message in response
|
59
|
+
# @yieldreturn [Array<Message>] All messages in response
|
60
|
+
def send_pipeline_command(command, &block)
|
61
|
+
with_command_shell(command) do |shell, cmd|
|
62
|
+
response_reader.read_message(command_output_message(shell, cmd), true, &block)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# calculate the maimum fragment size so that they will be as large as possible yet
|
67
|
+
# no greater than the max_envelope_size_kb on the end point. To calculate this
|
68
|
+
# threshold, we:
|
69
|
+
# - determine the maximum number of bytes accepted on the endpoint
|
70
|
+
# - subtract the non-fragment characters in the SOAP envelope
|
71
|
+
# - determine the number of bytes that could be base64 encded to the above length
|
72
|
+
# - subtract the fragment header bytes (ids, length, etc)
|
73
|
+
def max_fragment_blob_size
|
74
|
+
@max_fragment_blob_size ||= begin
|
75
|
+
fragment_header_length = 21
|
76
|
+
|
77
|
+
begin
|
78
|
+
max_fragment_bytes = (max_envelope_size_kb * 1024) - empty_pipeline_envelope.length
|
79
|
+
base64_deflated(max_fragment_bytes) - fragment_header_length
|
80
|
+
rescue WinRMWSManFault => e
|
81
|
+
# A non administrator user will encounter an access denied
|
82
|
+
# error attempting to query winrm configuration.
|
83
|
+
# we will assin a small default and adjust to a protocol
|
84
|
+
# appropriate max length when that info is available
|
85
|
+
raise unless e.fault_code == '5'
|
86
|
+
|
87
|
+
WinRM::PSRP::MessageFragmenter::DEFAULT_BLOB_LENGTH
|
88
|
+
rescue WinRMSoapFault
|
89
|
+
WinRM::PSRP::MessageFragmenter::DEFAULT_BLOB_LENGTH
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
protected
|
95
|
+
|
96
|
+
def response_reader
|
97
|
+
@response_reader ||= WinRM::PSRP::ReceiveResponseReader.new(transport, logger)
|
98
|
+
end
|
99
|
+
|
100
|
+
def send_command(command, _arguments)
|
101
|
+
command_id = SecureRandom.uuid.to_s.upcase
|
102
|
+
command += "\r\nif (!$?) { if($LASTEXITCODE) { exit $LASTEXITCODE } else { exit 1 } }"
|
103
|
+
message = PSRP::MessageFactory.create_pipeline_message(@runspace_id, command_id, command)
|
104
|
+
fragmenter.fragment(message) do |fragment|
|
105
|
+
command_args = [connection_opts, shell_id, command_id, fragment]
|
106
|
+
if fragment.start_fragment
|
107
|
+
resp_doc = transport.send_request(WinRM::WSMV::CreatePipeline.new(*command_args).build)
|
108
|
+
command_id = REXML::XPath.first(resp_doc, "//*[local-name() = 'CommandId']").text
|
109
|
+
else
|
110
|
+
transport.send_request(WinRM::WSMV::SendData.new(*command_args).build)
|
111
|
+
end
|
112
|
+
end
|
113
|
+
|
114
|
+
logger.debug("[WinRM] Command created for #{command} with id: #{command_id}")
|
115
|
+
command_id
|
116
|
+
end
|
117
|
+
|
118
|
+
def open_shell
|
119
|
+
@runspace_id = SecureRandom.uuid.to_s.upcase
|
120
|
+
runspace_msg = WinRM::WSMV::InitRunspacePool.new(
|
121
|
+
connection_opts,
|
122
|
+
@runspace_id,
|
123
|
+
open_shell_payload(@runspace_id)
|
124
|
+
)
|
125
|
+
resp_doc = transport.send_request(runspace_msg.build)
|
126
|
+
shell_id = REXML::XPath.first(resp_doc, "//*[@Name='ShellId']").text
|
127
|
+
wait_for_running(shell_id)
|
128
|
+
shell_id
|
129
|
+
end
|
130
|
+
|
131
|
+
def out_streams
|
132
|
+
%w[stdout]
|
133
|
+
end
|
134
|
+
|
135
|
+
private
|
136
|
+
|
137
|
+
def base64_deflated(inflated_length)
|
138
|
+
inflated_length / 4 * 3
|
139
|
+
end
|
140
|
+
|
141
|
+
def empty_pipeline_envelope
|
142
|
+
WinRM::WSMV::CreatePipeline.new(
|
143
|
+
connection_opts,
|
144
|
+
'00000000-0000-0000-0000-000000000000',
|
145
|
+
'00000000-0000-0000-0000-000000000000'
|
146
|
+
).build
|
147
|
+
end
|
148
|
+
|
149
|
+
def max_envelope_size_kb
|
150
|
+
@max_envelope_size_kb ||= begin
|
151
|
+
config_msg = WinRM::WSMV::Configuration.new(connection_opts)
|
152
|
+
msg = config_msg.build
|
153
|
+
resp_doc = transport.send_request(msg)
|
154
|
+
REXML::XPath.first(resp_doc, "//*[local-name() = 'MaxEnvelopeSizekb']").text.to_i
|
155
|
+
ensure
|
156
|
+
logger.debug("[WinRM] Endpoint doesn't support config request for MaxEnvelopsizekb")
|
157
|
+
end
|
158
|
+
# rubocop:enable Layout/RescueEnsureAlignment
|
159
|
+
end
|
160
|
+
|
161
|
+
def open_shell_payload(shell_id)
|
162
|
+
[
|
163
|
+
WinRM::PSRP::MessageFactory.session_capability_message(shell_id),
|
164
|
+
WinRM::PSRP::MessageFactory.init_runspace_pool_message(shell_id)
|
165
|
+
].map do |message|
|
166
|
+
fragmenter.fragment(message).bytes
|
167
|
+
end.flatten
|
168
|
+
end
|
169
|
+
|
170
|
+
def wait_for_running(shell_id)
|
171
|
+
state = WinRM::PSRP::MessageData::RunspacepoolState::OPENING
|
172
|
+
keepalive_msg = WinRM::WSMV::KeepAlive.new(connection_opts, shell_id)
|
173
|
+
|
174
|
+
# 2 is "openned". if we start issuing commands while in "openning" the runspace
|
175
|
+
# seems to hang
|
176
|
+
until state == WinRM::PSRP::MessageData::RunspacepoolState::OPENED
|
177
|
+
response_reader.read_message(keepalive_msg) do |message|
|
178
|
+
logger.debug("[WinRM] polling for pipeline state. message: #{message.inspect}")
|
179
|
+
parsed = message.parsed_data
|
180
|
+
case parsed
|
181
|
+
when WinRM::PSRP::MessageData::RunspacepoolState
|
182
|
+
state = parsed.runspace_state
|
183
|
+
when WinRM::PSRP::MessageData::SessionCapability
|
184
|
+
# if the user lacks admin privileges, we cannot query the MaxEnvelopeSizeKB
|
185
|
+
# on the server and will assign to a "best effort" default based on protocol version
|
186
|
+
if fragmenter.max_blob_length == WinRM::PSRP::MessageFragmenter::DEFAULT_BLOB_LENGTH
|
187
|
+
fragmenter.max_blob_length = default_protocol_envelope_size(parsed.protocol_version)
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|
191
|
+
end
|
192
|
+
end
|
193
|
+
|
194
|
+
# Powershell v2.0 has a protocol version of 2.1
|
195
|
+
# which defaults to a 150 MaxEnvelopeSizeKB
|
196
|
+
# later versions default to 500
|
197
|
+
def default_protocol_envelope_size(protocol_version)
|
198
|
+
protocol_version > '2.1' ? 512000 : 153600
|
199
|
+
end
|
200
|
+
|
201
|
+
def fragmenter
|
202
|
+
@fragmenter ||= WinRM::PSRP::MessageFragmenter.new(max_fragment_blob_size)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
end
|
206
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
# Copyright 2016 Shawn Neal <sneal@sneal.net>
|
2
|
+
# Copyright 2015 Matt Wrock <matt@mattwrock.com>
|
3
|
+
#
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
+
# you may not use this file except in compliance with the License.
|
6
|
+
# You may obtain a copy of the License at
|
7
|
+
#
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
9
|
+
#
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
+
# See the License for the specific language governing permissions and
|
14
|
+
# limitations under the License.
|
15
|
+
|
16
|
+
require_relative '../exceptions'
|
17
|
+
|
18
|
+
module WinRM
|
19
|
+
module Shells
|
20
|
+
# Shell mixin for retrying an operation
|
21
|
+
module Retryable
|
22
|
+
RETRYABLE_EXCEPTIONS = lambda do
|
23
|
+
[
|
24
|
+
Errno::EACCES, Errno::EADDRINUSE, Errno::ECONNREFUSED, Errno::ETIMEDOUT,
|
25
|
+
Errno::ECONNRESET, Errno::ENETUNREACH, Errno::EHOSTUNREACH, ::WinRM::WinRMWSManFault,
|
26
|
+
::WinRM::WinRMHTTPTransportError, ::WinRM::WinRMAuthorizationError,
|
27
|
+
HTTPClient::KeepAliveDisconnected, HTTPClient::ConnectTimeoutError
|
28
|
+
].freeze
|
29
|
+
end
|
30
|
+
|
31
|
+
# Retries the operation a specified number of times with a delay between
|
32
|
+
# @param retries [Integer] The number of times to retry
|
33
|
+
# @param delay [Integer] The number of seconds to wait between retry attempts
|
34
|
+
def retryable(retries, delay)
|
35
|
+
yield
|
36
|
+
rescue *RETRYABLE_EXCEPTIONS.call
|
37
|
+
raise unless (retries -= 1) > 0
|
38
|
+
|
39
|
+
sleep(delay)
|
40
|
+
retry
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|