Sha256: 2e4af5e41440413fe6a9fe9942c45c0bc0a2ca37f1a1ea34ece1af1327c44ab2

Contents?: true

Size: 398 Bytes

Versions: 44

Compression:

Stored size: 398 Bytes

Contents

module MCollective
  module Validator
    class ShellsafeValidator
      def self.validate(validator)
        raise ValidatorError, "value should be a String" unless validator.is_a?(String)

        ['`', '$', ';', '|', '&&', '>', '<'].each do |chr|
          raise ValidatorError, "value should not have #{chr} in it" if validator.match(Regexp.escape(chr))
        end
      end
    end
  end
end

Version data entries

44 entries across 44 versions & 3 rubygems

Version Path
mcollective-client-2.12.5 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.6 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.5 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.4 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.3 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.2 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-2.20.0 lib/mcollective/validator/shellsafe_validator.rb
choria-mcorpc-support-0.0.1 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.12.4 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.12.3 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.12.1 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.12.0 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.10.6 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.11.4 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.11.3 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.11.2 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.11.1 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.11.0 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.10.4 lib/mcollective/validator/shellsafe_validator.rb
mcollective-client-2.10.3 lib/mcollective/validator/shellsafe_validator.rb