Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hostnames not included in site_config #8

Closed
mmilbrath opened this issue May 6, 2012 · 4 comments
Closed

hostnames not included in site_config #8

mmilbrath opened this issue May 6, 2012 · 4 comments

Comments

@mmilbrath
Copy link

Looks like only host/ranges and not host/hosts are included in the site configuration. When making changes and saving back to the instance, any configured host elements are lost. Also the host element appears to have changed from 'hostname' to just 'host' as least on Community version 5.2.3

diff --git a/lib/nexpose/site.rb b/lib/nexpose/site.rb
index 5d87686..3d8e129 100644
--- a/lib/nexpose/site.rb
+++ b/lib/nexpose/site.rb
@@ -502,6 +502,9 @@ module Nexpose
s.elements.each('Hosts/range') do |r|
@hosts.push(IPRange.new(r.attributes['from'], r.attributes['to']))
end

  •    s.elements.each('Hosts/host') do |r|
    
  •      @hosts.push(HostName.new(r.text))
    
  •    end
            s.elements.each('ScanConfig') do |c|
                @scanConfig = ScanConfig.new(c.attributes['configID'],
                                             c.attributes['name'],
    

    @@ -848,7 +851,7 @@ module Nexpose
    include Sanitize

    def to_xml
    
  •       "<hostname>#{replace_entities(hostname)}</hostname>"
    
  •       "<host>#{replace_entities(hostname)}</host>"
    end
    

    end

@bperry-r7
Copy link
Contributor

Do you have a code example you were using to reproduce this? Something small and concise if possible.

@bperry-r7
Copy link
Contributor

Ok, fixing the issue, will update the gem.

@bperry-r7
Copy link
Contributor

Fix pushed, gem updated and pushed as well.

@mmilbrath
Copy link
Author

Thanks, is there a reason you did not incorporate the processing of
the hosts when SiteConfig is read from the server? Attached is an
example that I believe should work but doesn't because the hostnames
from response are not processed.

Regards
--Michael

On Tue, May 8, 2012 at 4:31 PM, bperry-r7
reply@reply.github.com
wrote:

Fix pushed, gem updated and pushed as well.


Reply to this email directly or view it on GitHub:
#8 (comment)

Michael D. Milbrath
E-mail: m.milbrath@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants