Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-5293

IIS : regexes for name properties are more restrictive than iis itself

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: iis
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Epic Link:
    • Team:
      Windows
    • Sprint:
      Windows Kanban
    • Method Found:
      Needs Assessment
    • QA Risk Assessment:
      Needs Assessment

      Description

      v4.0

      This regex:

      ^[a-zA-Z0-9\-\_'\s]+$ 
      

      used in ...

      ./lib/puppet/type/iis_application.rb (:applicationpool)
      ./lib/puppet/type/iis_application_pool.rb (:name)
      ./lib/puppet/type/iis_site.rb (:name)

      is more restrictive than IIS itself, preventing the management of resources containing non-matching characters.

      PS C:\Users\Administrator> New-WebSite -Name "Test.Site" -Port 80 -HostHeader "Test" -PhysicalPath "c:\"
       
      Name             ID   State      Physical Path                  Bindings
      ----             --   -----      -------------                  --------
      Test.Site        2310 Started    c:\                            http *:80:Test
      

      Also, the associated fail commands interpolate the wrong variable (here, name instead of value) ...

        newparam(:name, :namevar => true) do
          desc "The Name of the IIS site. Used for uniqueness. Will set the target to this value if target is unset."
       
          validate do |value|
            if value.nil? or value.empty?
              raise ArgumentError, "A non-empty name must be specified."
            end
            fail("#{name} is not a valid web site name") unless value =~ /^[a-zA-Z0-9\-\_'\s]+$/
          end
        end
      

      Error: Failed to apply catalog: Parameter name failed on Iis_site[test.site]: name is not a valid web site name at ...
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              james.pogran James Pogran
              Reporter:
              tom.kishel Thomas Kishel
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support