Hello community, here is the log from the commit of package yast2-network for openSUSE:Factory checked in at 2014-08-05 10:24:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-network (Old) and /work/SRC/openSUSE:Factory/.yast2-network.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-network" Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes 2014-07-23 22:05:41.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-network.new/yast2-network.changes 2014-08-05 10:24:26.000000000 +0200 @@ -1,0 +2,29 @@ +Mon Aug 4 06:22:20 UTC 2014 - mfilka@suse.com + +- bnc#889359 + - Re-enable Add button in Overview dialog during installation +- 3.1.75 + +------------------------------------------------------------------- +Mon Aug 4 05:36:41 UTC 2014 - mfilka@suse.com + +- bnc#884517 + - fixed proposal when virtual machine proposal is selected + - /etc/hosts do not contain incorrect 0.0.0.0 entry +- 3.1.74 + +------------------------------------------------------------------- +Fri Aug 1 14:15:49 UTC 2014 - ancor@suse.com + +- Avoid confusing firewall proposals by hidding the details (ssh + and vnc ports) when the firewall is disabled (bnc#886554). +- 3.1.73 + +------------------------------------------------------------------- +Fri Aug 1 08:21:36 UTC 2014 - ancor@suse.com + +- Don't propose to enable the firewall if SuSEFirewall is not + selected for installation (bnc#881250) +- 3.1.72 + +------------------------------------------------------------------- @@ -19 +48 @@ -- 3.1.89 +- 3.1.69 Old: ---- yast2-network-3.1.71.tar.bz2 New: ---- yast2-network-3.1.75.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-network.spec ++++++ --- /var/tmp/diff_new_pack.IjbVgg/_old 2014-08-05 10:24:27.000000000 +0200 +++ /var/tmp/diff_new_pack.IjbVgg/_new 2014-08-05 10:24:27.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.71 +Version: 3.1.75 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-network-3.1.71.tar.bz2 -> yast2-network-3.1.75.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/.yardopts new/yast2-network-3.1.75/.yardopts --- old/yast2-network-3.1.71/.yardopts 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.75/.yardopts 2014-08-04 15:03:43.000000000 +0200 @@ -0,0 +1,6 @@ +--no-private +--protected +--markup markdown +--output-dir doc/autodocs +--readme README.md +src/**/*.rb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/package/yast2-network.changes new/yast2-network-3.1.75/package/yast2-network.changes --- old/yast2-network-3.1.71/package/yast2-network.changes 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/package/yast2-network.changes 2014-08-04 15:03:43.000000000 +0200 @@ -1,4 +1,33 @@ ------------------------------------------------------------------- +Mon Aug 4 06:22:20 UTC 2014 - mfilka@suse.com + +- bnc#889359 + - Re-enable Add button in Overview dialog during installation +- 3.1.75 + +------------------------------------------------------------------- +Mon Aug 4 05:36:41 UTC 2014 - mfilka@suse.com + +- bnc#884517 + - fixed proposal when virtual machine proposal is selected + - /etc/hosts do not contain incorrect 0.0.0.0 entry +- 3.1.74 + +------------------------------------------------------------------- +Fri Aug 1 14:15:49 UTC 2014 - ancor@suse.com + +- Avoid confusing firewall proposals by hidding the details (ssh + and vnc ports) when the firewall is disabled (bnc#886554). +- 3.1.73 + +------------------------------------------------------------------- +Fri Aug 1 08:21:36 UTC 2014 - ancor@suse.com + +- Don't propose to enable the firewall if SuSEFirewall is not + selected for installation (bnc#881250) +- 3.1.72 + +------------------------------------------------------------------- Tue Jul 22 14:30:00 CEST 2014 - locilka@suse.com - Using new ServicesProposal library to set the sshd service status @@ -16,7 +45,7 @@ - Do not restart network if the installation has been started via a SSH connection. (bnc#885640) -- 3.1.89 +- 3.1.69 ------------------------------------------------------------------- Fri Jul 11 08:52:08 UTC 2014 - mfilka@suse.com diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/package/yast2-network.spec new/yast2-network-3.1.75/package/yast2-network.spec --- old/yast2-network-3.1.71/package/yast2-network.spec 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/package/yast2-network.spec 2014-08-04 15:03:43.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-network -Version: 3.1.71 +Version: 3.1.75 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/clients/firewall_stage1_proposal.rb new/yast2-network-3.1.75/src/clients/firewall_stage1_proposal.rb --- old/yast2-network-3.1.71/src/clients/firewall_stage1_proposal.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/clients/firewall_stage1_proposal.rb 2014-08-04 15:03:43.000000000 +0200 @@ -49,101 +49,20 @@ Yast.import "Linuxrc" Yast.import "PackagesProposal" Yast.import "ProductControl" - Yast.import "ProductFeatures" Yast.import "SuSEFirewall4Network" Yast.import "SuSEFirewallProposal" Yast.import "Wizard" - # run this only once - if !SuSEFirewallProposal.GetProposalInitialized - # variables from control file - Builtins.y2milestone( - "Default firewall values: enable_firewall=%1, enable_ssh=%2 enable_sshd=%3", - ProductFeatures.GetBooleanFeature("globals", "enable_firewall"), - ProductFeatures.GetBooleanFeature("globals", "firewall_enable_ssh"), - ProductFeatures.GetBooleanFeature("globals", "enable_sshd") - ) - - SuSEFirewall4Network.SetEnabled1stStage( - ProductFeatures.GetBooleanFeature("globals", "enable_firewall") - ) - - # we're installing over SSH, propose opening SSH port (bnc#535206) - if Linuxrc.usessh - SuSEFirewall4Network.SetSshEnabled1stStage(true) - SuSEFirewall4Network.SetSshdEnabled(true) - else - SuSEFirewall4Network.SetSshEnabled1stStage( - ProductFeatures.GetBooleanFeature("globals", "firewall_enable_ssh") - ) - SuSEFirewall4Network.SetSshdEnabled( - ProductFeatures.GetBooleanFeature("globals", "enable_sshd") - ) - end - - # we're installing over VNC, propose opening VNC port (bnc#734264) - SuSEFirewall4Network.SetVncEnabled1stStage(true) if Linuxrc.vnc - - SuSEFirewallProposal.SetProposalInitialized(true) - end - - @func = Convert.to_string(WFM.Args(0)) @param = Convert.to_map(WFM.Args(1)) @ret = {} - if @func == "MakeProposal" - # Summary is visible only if installing over VNC - # and if firewall is enabled - otherwise port could not be blocked - vnc_proposal_element = "" - if Linuxrc.vnc && SuSEFirewall4Network.Enabled1stStage - vnc_proposal = SuSEFirewall4Network.EnabledVnc1stStage ? - _("VNC ports will be open (<a href="%s">close</a>)") % - LINK_DISABLE_VNC - : _("VNC ports will be blocked (<a href="%s">open</a>)") % - LINK_ENABLE_VNC - vnc_proposal_element = "<li>#{vnc_proposal}</li>" - end - - firewall_proposal = SuSEFirewall4Network.Enabled1stStage ? - _( - "Firewall will be enabled (<a href="%s">disable</a>)" - ) % LINK_DISABLE_FIREWALL - : - _( - "Firewall will be disabled (<a href="%s">enable</a>)" - ) % LINK_ENABLE_FIREWALL - - ssh_proposal = SuSEFirewall4Network.EnabledSsh1stStage ? - _( - "SSH port will be open (<a href="%s">block</a>)" - ) % LINK_BLOCK_SSH_PORT - : - _( - "SSH port will be blocked (<a href="%s">open</a>)" - ) % LINK_OPEN_SSH_PORT - - sshd_proposal = SuSEFirewall4Network.EnabledSshd ? - _( - "SSH service will be enabled (<a href="%s">disable</a>)" - ) % LINK_DISABLE_SSHD - : - _( - "SSH service will be disabled (<a href="%s">enable</a>)" - ) % LINK_ENABLE_SSHD - - - - - @output = "<ul>\n<li>#{firewall_proposal}</li>\n" + - "<li>#{ssh_proposal}</li>\n" + - "<li>#{sshd_proposal}</li>\n" + - vnc_proposal_element + - "</ul>\n" + # Don't override users settings + SuSEFirewall4Network.prepare_proposal unless SuSEFirewallProposal.GetChangedByUser @ret = { - "preformatted_proposal" => @output, + "preformatted_proposal" => preformatted_proposal, "warning_level" => :warning, "links" => [ LINK_ENABLE_FIREWALL, @@ -368,6 +287,58 @@ Wizard.CloseDialog Convert.to_symbol(dialog_ret) end + + private + + def preformatted_proposal + + firewall_proposal = SuSEFirewall4Network.Enabled1stStage ? + _( + "Firewall will be enabled (<a href="%s">disable</a>)" + ) % LINK_DISABLE_FIREWALL + : + _( + "Firewall will be disabled (<a href="%s">enable</a>)" + ) % LINK_ENABLE_FIREWALL + + sshd_proposal = SuSEFirewall4Network.EnabledSshd ? + _( + "SSH service will be enabled (<a href="%s">disable</a>)" + ) % LINK_DISABLE_SSHD + : + _( + "SSH service will be disabled (<a href="%s">enable</a>)" + ) % LINK_ENABLE_SSHD + + vnc_fw_proposal = nil + ssh_fw_proposal = nil + # It only makes sense to show the blocked ports if firewall is + # enabled (bnc#886554) + if SuSEFirewall4Network.Enabled1stStage + # Display vnc port only if installing over VNC + if Linuxrc.vnc + vnc_fw_proposal = SuSEFirewall4Network.EnabledVnc1stStage ? + _("VNC ports will be open (<a href="%s">close</a>)") % + LINK_DISABLE_VNC + : _("VNC ports will be blocked (<a href="%s">open</a>)") % + LINK_ENABLE_VNC + end + + ssh_fw_proposal = SuSEFirewall4Network.EnabledSsh1stStage ? + _( + "SSH port will be open (<a href="%s">block</a>)" + ) % LINK_BLOCK_SSH_PORT + : + _( + "SSH port will be blocked (<a href="%s">open</a>)" + ) % LINK_OPEN_SSH_PORT + end + + # Filter proposals with content and sort them + proposals = [firewall_proposal, ssh_fw_proposal, sshd_proposal, vnc_fw_proposal].compact + "<ul>\n" + proposals.map {|prop| "<li>#{prop}</li>\n" }.join + "</ul>\n" + end + end unless defined? FirewallStage1ProposalClient end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/clients/lan_auto.rb new/yast2-network-3.1.75/src/clients/lan_auto.rb --- old/yast2-network-3.1.71/src/clients/lan_auto.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/clients/lan_auto.rb 2014-08-04 15:03:43.000000000 +0200 @@ -159,8 +159,6 @@ @ret = deep_copy(@autoyast) elsif @func == "Write" @progress_orig = Progress.set(false) - # Lan::PrepareForAutoinst(); - # Lan::Autoinstall(); @ret = Lan.WriteOnly if Ops.get(LanItems.autoinstall_settings, "strict_IP_check_timeout") != nil if Lan.isAnyInterfaceDown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/include/network/lan/bridge.rb new/yast2-network-3.1.75/src/include/network/lan/bridge.rb --- old/yast2-network-3.1.71/src/include/network/lan/bridge.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/include/network/lan/bridge.rb 2014-08-04 15:03:43.000000000 +0200 @@ -51,6 +51,9 @@ nil end + # Immediately updates device's ifcfg to be usable as bridge port. + # + # It mainly setups suitable BOOTPROTO an IP related values def configure_as_bridge_port(device) log.info("Adapt device #{device} as bridge port") @@ -58,9 +61,20 @@ # can be set to BOOTPROTO=none. No workaround with # BOOTPROTO=static required anymore NetworkInterfaces.Edit(device) + NetworkInterfaces.Current["IPADDR"] = "" NetworkInterfaces.Current["NETMASK"] = "" NetworkInterfaces.Current["BOOTPROTO"] = "none" + #take out PREFIXLEN from old configuration (BNC#735109) + NetworkInterfaces.Current["PREFIXLEN"] = "" + + # remove all aliases (bnc#590167) + aliases = NetworkInterfaces.Current["_aliases"] || {} + aliases.each do |alias_name, alias_ip| + NetworkInterfaces.DeleteAlias(device, alias_name) if alias_ip + end + NetworkInterfaces.Current["_aliases"] = {} + NetworkInterfaces.Commit NetworkInterfaces.Add end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/include/network/lan/complex.rb new/yast2-network-3.1.75/src/include/network/lan/complex.rb --- old/yast2-network-3.1.71/src/include/network/lan/complex.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/include/network/lan/complex.rb 2014-08-04 15:03:43.000000000 +0200 @@ -575,11 +575,7 @@ def overview_buttons ret = {} - # User should be able to configure existing devices during installation. - # This can be achieved via "Edit" button on automatically detected - # devices. Advanced configuration should be postponed to installed system. - # Therefor adding devices is not available during installation - ret[:add] = Label.AddButton if !Mode.installation + ret[:add] = Label.AddButton ret[:edit] = Label.EditButton ret[:delete] = Label.DeleteButton diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/modules/Lan.rb new/yast2-network-3.1.75/src/modules/Lan.rb --- old/yast2-network-3.1.71/src/modules/Lan.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/modules/Lan.rb 2014-08-04 15:03:43.000000000 +0200 @@ -42,7 +42,6 @@ Yast.import "DNS" Yast.import "NetHwDetection" Yast.import "Host" - Yast.import "Hostname" Yast.import "IP" Yast.import "Map" Yast.import "Mode" @@ -53,21 +52,18 @@ Yast.import "ProductFeatures" Yast.import "Routing" Yast.import "Progress" - Yast.import "Service" Yast.import "String" - Yast.import "Summary" Yast.import "SuSEFirewall4Network" Yast.import "FileUtils" Yast.import "PackageSystem" Yast.import "LanItems" Yast.import "ModuleLoading" Yast.import "Linuxrc" - Yast.import "Stage" Yast.import "LanUdevAuto" - Yast.import "Label" Yast.include self, "network/complex.rb" Yast.include self, "network/runtime.rb" + Yast.include self, "network/lan/bridge.rb" #------------- # GLOBAL DATA @@ -891,29 +887,6 @@ nm_default && nm_installed end - # Create minimal ifcfgs for the case when NetworkManager is used: - # NM does not need them but yast2-firewall and SuSEfirewall2 do - # Avoid existing ifcfg from network installation - def ProposeNMInterfaces - Builtins.y2milestone("Minimal ifcfgs for NM") - Builtins.foreach(LanItems.Items) do |number, lanitem| - if IsNotEmpty( - Ops.get_string(Convert.to_map(lanitem), ["hwinfo", "dev_name"], "") - ) - LanItems.current = number - if !LanItems.IsCurrentConfigured - Builtins.y2milestone( - "Nothing already configured start proposing %1 (NM)", - LanItems.getCurrentItem - ) - LanItems.ProposeItem - end - end - end - - nil - end - def IfcfgsToSkipVirtualizedProposal skipped = [] Builtins.foreach(LanItems.Items) do |current, config| @@ -1049,28 +1022,8 @@ "ETHTOOLS_OPTIONS" ) if NetworkInterfaces.Commit - NetworkInterfaces.Add - NetworkInterfaces.Edit(ifcfg) - Ops.set(old_config, "BOOTPROTO", "static") - Ops.set(old_config, "IPADDR", "0.0.0.0/32") - # remove all aliases (bnc#590167) - Builtins.foreach( - Ops.get_map(NetworkInterfaces.Current, "_aliases", {}) - ) do |a, v| - if v != nil - NetworkInterfaces.DeleteAlias(NetworkInterfaces.Name, a) - end - end - #take out PREFIXLEN from old configuration (BNC#735109) - Ops.set(old_config, "PREFIXLEN", "") - Ops.set(old_config, "_aliases", {}) - Builtins.y2milestone( - "Old Config with apllied changes %1\n%2", - ifcfg, - old_config - ) - NetworkInterfaces.Current = deep_copy(old_config) - NetworkInterfaces.Commit + # reconfigure existing device as newly created bridge's port + configure_as_bridge_port(ifcfg) Ops.set(LanItems.Items, [current, "ifcfg"], new_ifcfg) LanItems.modified = true @@ -1087,215 +1040,8 @@ nil end - # Propose interface configuration - # @return true if something was proposed - def ProposeInterfaces - Builtins.y2milestone("Hardware=%1", LanItems.Hardware) - - Builtins.y2milestone("NetworkConfig::Config=%1", NetworkConfig.Config) - Builtins.y2milestone("NetworkConfig::DHCP=%1", NetworkConfig.DHCP) - - # test if we have any virtualization installed - if !LanItems.nm_proposal_valid - if UseNetworkManager() - NetworkService.use_network_manager - else - NetworkService.use_netconfig - end - - LanItems.nm_proposal_valid = true - end - - if NetworkService.is_network_manager - ProposeNMInterfaces() - - LanItems.modified = true # #144139 workaround - Builtins.y2milestone("NM proposal") - return true - end - # Something is already configured -> do nothing - configured = false - Builtins.foreach(LanItems.Items) do |number, lanitem| - LanItems.current = number - if LanItems.IsCurrentConfigured - Builtins.y2milestone("Something already configured: don't propose.") - configured = true - raise Break - end - end - return false if configured - - - Builtins.foreach(LanItems.Items) do |number, lanitem| - if IsNotEmpty( - Ops.get_string(Convert.to_map(lanitem), ["hwinfo", "dev_name"], "") - ) - LanItems.current = number - link = Ops.get_boolean( - LanItems.getCurrentItem, - ["hwinfo", "link"], - false - ) - if Ops.get_string(LanItems.getCurrentItem, ["hwinfo", "type"], "") == "wlan" - Builtins.y2warning("Will not propose wlan interfaces") - else - if !link - Builtins.y2warning( - "item number %1 has link:false detected", - number - ) - elsif !LanItems.IsCurrentConfigured && link - Builtins.y2milestone( - "Nothing already configured - start proposing" - ) - LanItems.ProposeItem - raise Break - end - end - end - end - - Builtins.y2milestone("NetworkConfig::Config=%1", NetworkConfig.Config) - Builtins.y2milestone("NetworkConfig::DHCP=%1", NetworkConfig.DHCP) - - true - end - - # Propose the hostname - # See also DNS::Read - # @return true if something was proposed - def ProposeHostname - if DNS.proposal_valid - # the standalone hostname dialog did the job already - return false - end - - true - end - - # Propose configuration for routing and resolver - # @return true if something was proposed - def ProposeRoutesAndResolver - if LanItems.bootproto == "static" && LanItems.ipaddr != "" && - LanItems.ipaddr != nil - ProposeHostname() - end - true - end - - # Propose a configuration - # @return true if something was proposed - def Propose - NetworkInterfaces.CleanCacheRead - LanItems.Read - ProposeInterfaces() && ProposeRoutesAndResolver() - end - # Create a configuration for autoyast # @return true if something was proposed - def Autoinstall - Builtins.y2milestone("Hardware=%1", LanItems.Hardware) - tosel = nil - - # Some HW found -> use it for proposal - if Ops.greater_than(Builtins.size(LanItems.Hardware), 0) && - Ops.greater_than( - Builtins.size( - Ops.get_list(LanItems.autoinstall_settings, "interfaces", []) - ), - 0 - ) - Builtins.foreach( - Ops.get_list(LanItems.autoinstall_settings, "interfaces", []) - ) do |interface| - devs = NetworkInterfaces.List("") - Builtins.y2milestone("devs: %1", devs) - tosel = nil - Add() - tosel = LanItems.FindMatchingDevice(interface) - Builtins.y2milestone("tosel=%1", tosel) - # Read module data from autoyast - aymodule = LanItems.GetModuleForInterface( - Ops.get(interface, "device", ""), - Ops.get_list(LanItems.autoinstall_settings, "modules", []) - ) - if tosel != nil - Ops.set( - tosel, - "module", - Ops.get_string(aymodule, "module", "") != "" ? - Ops.get_string(aymodule, "module", "") : - Ops.get_string(tosel, "module", "") - ) - Ops.set( - tosel, - "options", - Ops.get_string(aymodule, "options", "") != "" ? - Ops.get_string(aymodule, "options", "") : - Ops.get_string(tosel, "options", "") - ) - - LanItems.SelectHWMap(tosel) - else - Builtins.y2milestone( - "No hardware, no install.inf -> no autoinstallation possible." - ) - next false - end - # The uppercasing is also done in lan_auto::FromAY - # but the output goes to "devices" whereas here - # we use "interfaces". FIXME. - newk = nil - interface = Builtins.mapmap(interface) do |k, v| - newk = Builtins.toupper(k) - { newk => v } - end - defaults = Builtins.union( - LanItems.SysconfigDefaults, - LanItems.GetDefaultsForHW - ) - # Set interface variables - LanItems.SetDeviceVars(interface, defaults) - Builtins.y2debug( - "ipaddr,bootproto=%1,%2", - LanItems.ipaddr, - LanItems.bootproto - ) - if LanItems.bootproto == "static" && LanItems.ipaddr != "" && - LanItems.ipaddr != nil - Builtins.y2milestone("static configuration") - - if LanItems.netmask == nil || LanItems.netmask == "" - LanItems.netmask = "255.255.255.0" - end - end - LanItems.Commit - end - else - Builtins.y2milestone( - "no interface configuration, taking it from install.inf" - ) - ProposeInterfaces() - end - - # #153426 - using ProposeInterfaces instead of Propose omitted these - # if they are nonempty, Import has already taken care of them. - if Ops.get_list(LanItems.autoinstall_settings, ["routing", "routes"], []) == [] - Builtins.y2milestone("gateway from install.inf") - # Routing::ReadFromGateway (InstallInf["gateway"]:""); - end - if Ops.get_list(LanItems.autoinstall_settings, ["dns", "nameservers"], []) == [] - Builtins.y2milestone("nameserver from install.inf") - # DNS::ReadNameserver (InstallInf["nameserver"]:""); - end - if Ops.get_string(LanItems.autoinstall_settings, ["dns", "hostname"], "") == "" - ProposeHostname() - end - - true - end - - # Check if any device is configured with DHCP. # @return true if any DHCP device is configured def AnyDHCPDevice @@ -1317,13 +1063,6 @@ ) end - - def PrepareForAutoinst - # ReadInstallInf(); - LanItems.ReadHw - deep_copy(LanItems.Hardware) - end - # @return [Array] of packages needed when writing the config def Packages pkgs = [] @@ -1435,12 +1174,7 @@ publish :function => :SummaryGeneral, :type => "list ()" publish :function => :Add, :type => "boolean ()" publish :function => :Delete, :type => "boolean ()" - publish :function => :ProposeInterfaces, :type => "boolean ()" - publish :function => :ProposeRoutesAndResolver, :type => "boolean ()" - publish :function => :Propose, :type => "boolean ()" - publish :function => :Autoinstall, :type => "boolean ()" publish :function => :AnyDHCPDevice, :type => "boolean ()" - publish :function => :PrepareForAutoinst, :type => "list <map> ()" publish :function => :Packages, :type => "list <string> ()" publish :function => :AutoPackages, :type => "map ()" publish :function => :HaveXenBridge, :type => "boolean ()" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/modules/LanItems.rb new/yast2-network-3.1.75/src/modules/LanItems.rb --- old/yast2-network-3.1.71/src/modules/LanItems.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/modules/LanItems.rb 2014-08-04 15:03:43.000000000 +0200 @@ -24,6 +24,19 @@ require "yast" module Yast + # Does way too many things. + # + # 1. Aggregates data about network interfaces, both configured + # and unconfigured, in {#Items}, which see. + # + # 2. Provides direct access to individual items of ifcfg files. + # For example BOOTPROTO and STARTMODE are accessible in + # {#bootproto} and {#startmode} (set via {#SetDeviceVars} + # via {#Select} or {#SetItem}). + # + # 3. ... + # + class LanItemsClass < Module attr_reader :ipoib_modes attr_accessor :ipoib_mode @@ -1460,7 +1473,7 @@ end # Select the hardware component - # @param hw the component + # @param hardware the component def SelectHWMap(hardware) hardware = deep_copy(hardware) sel = SelectHardwareMap(hardware) @@ -2315,7 +2328,7 @@ DeleteItem() end - # Deletes the {current} item and its configuration + # Deletes the {#current} item and its configuration def DeleteItem return if @current < 0 return if @Items.nil? || @Items.empty? @@ -2549,73 +2562,101 @@ result end - publish :variable => :Items, :type => "map <integer, any>" - publish :variable => :Hardware, :type => "list <map>" - publish :variable => :udev_net_rules, :type => "map <string, any>" - publish :variable => :driver_options, :type => "map <string, any>" - publish :variable => :autoinstall_settings, :type => "map" - publish :variable => :modified, :type => "boolean" - publish :variable => :operation, :type => "symbol" - publish :variable => :force_restart, :type => "boolean" - publish :variable => :description, :type => "string" - publish :variable => :type, :type => "string" - publish :variable => :device, :type => "string" - publish :variable => :alias, :type => "string" - publish :variable => :current, :type => "integer" - publish :variable => :hotplug, :type => "string" - publish :variable => :Requires, :type => "list <string>" - publish :variable => :bootproto, :type => "string" - publish :variable => :ipaddr, :type => "string" - publish :variable => :remoteip, :type => "string" - publish :variable => :netmask, :type => "string" - publish :variable => :set_default_route, :type => "boolean" - publish :variable => :prefix, :type => "string" - publish :variable => :startmode, :type => "string" - publish :variable => :ifplugd_priority, :type => "string" - publish :variable => :mtu, :type => "string" - publish :variable => :ethtool_options, :type => "string" - publish :variable => :wl_mode, :type => "string" - publish :variable => :wl_essid, :type => "string" - publish :variable => :wl_nwid, :type => "string" - publish :variable => :wl_auth_mode, :type => "string" - publish :variable => :wl_wpa_psk, :type => "string" - publish :variable => :wl_key_length, :type => "string" - publish :variable => :wl_key, :type => "list <string>" - publish :variable => :wl_default_key, :type => "integer" - publish :variable => :wl_nick, :type => "string" - publish :variable => :bond_slaves, :type => "list <string>" - publish :variable => :bond_option, :type => "string" - publish :variable => :vlan_etherdevice, :type => "string" - publish :variable => :vlan_id, :type => "string" - publish :variable => :bridge_ports, :type => "string" - publish :variable => :wl_wpa_eap, :type => "map <string, any>" - publish :variable => :wl_channel, :type => "string" - publish :variable => :wl_frequency, :type => "string" - publish :variable => :wl_bitrate, :type => "string" - publish :variable => :wl_accesspoint, :type => "string" - publish :variable => :wl_power, :type => "boolean" - publish :variable => :wl_ap_scanmode, :type => "string" - publish :variable => :wl_auth_modes, :type => "list <string>" - publish :variable => :wl_enc_modes, :type => "list <string>" - publish :variable => :wl_channels, :type => "list <string>" - publish :variable => :wl_bitrates, :type => "list <string>" - publish :variable => :qeth_portname, :type => "string" - publish :variable => :qeth_portnumber, :type => "string" - publish :variable => :chan_mode, :type => "string" - publish :variable => :qeth_options, :type => "string" - publish :variable => :ipa_takeover, :type => "boolean" - publish :variable => :iucv_user, :type => "string" - publish :variable => :qeth_layer2, :type => "boolean" - publish :variable => :qeth_macaddress, :type => "string" - publish :variable => :qeth_chanids, :type => "string" - publish :variable => :lcs_timeout, :type => "string" - publish :variable => :aliases, :type => "map" - publish :variable => :tunnel_set_owner, :type => "string" - publish :variable => :tunnel_set_group, :type => "string" - publish :variable => :proposal_valid, :type => "boolean" - publish :variable => :nm_proposal_valid, :type => "boolean" - publish :variable => :nm_name, :type => "string" - publish :variable => :nm_name_old, :type => "string" + private + + # This helper allows YARD to extract DSL-defined attributes. + # Unfortunately YARD has problems with the Capitalized ones, + # so those must be done manually. + # @!macro [attach] publish_variable + # @!attribute $1 + # @return [$2] + def self.publish_variable(name, type) + publish :variable => name, :type => type + end + + public + + # @attribute Items + # @return [Hash<Integer, Hash<String, Object> >] + # Each item, indexed by an Integer in a Hash, aggregates several aspects + # of a network interface. These aspects are in the inner Hash + # which mostly has other hashes as values: + # + # - ifcfg: String, just a foreign key for NetworkInterfaces#Select + # - hwinfo: Hash, detected hardware information + # - udev: Hash, udev naming rules + publish_variable :Items , "map <integer, any>" + # @attribute Hardware + publish_variable :Hardware , "list <map>" + publish_variable :udev_net_rules , "map <string, any>" + publish_variable :driver_options , "map <string, any>" + publish_variable :autoinstall_settings , "map" + publish_variable :modified , "boolean" + publish_variable :operation , "symbol" + publish_variable :force_restart , "boolean" + publish_variable :description , "string" + publish_variable :type , "string" + publish_variable :device , "string" + publish_variable :alias , "string" + # the index into {#Items} + publish_variable :current , "integer" + publish_variable :hotplug , "string" + # @attribute Requires + publish_variable :Requires , "list <string>" + publish_variable :bootproto , "string" + publish_variable :ipaddr , "string" + publish_variable :remoteip , "string" + publish_variable :netmask , "string" + publish_variable :set_default_route , "boolean" + publish_variable :prefix , "string" + publish_variable :startmode , "string" + publish_variable :ifplugd_priority , "string" + publish_variable :mtu , "string" + publish_variable :ethtool_options , "string" + publish_variable :wl_mode , "string" + publish_variable :wl_essid , "string" + publish_variable :wl_nwid , "string" + publish_variable :wl_auth_mode , "string" + publish_variable :wl_wpa_psk , "string" + publish_variable :wl_key_length , "string" + publish_variable :wl_key , "list <string>" + publish_variable :wl_default_key , "integer" + publish_variable :wl_nick , "string" + publish_variable :bond_slaves , "list <string>" + publish_variable :bond_option , "string" + publish_variable :vlan_etherdevice , "string" + publish_variable :vlan_id , "string" + publish_variable :bridge_ports , "string" + publish_variable :wl_wpa_eap , "map <string, any>" + publish_variable :wl_channel , "string" + publish_variable :wl_frequency , "string" + publish_variable :wl_bitrate , "string" + publish_variable :wl_accesspoint , "string" + publish_variable :wl_power , "boolean" + publish_variable :wl_ap_scanmode , "string" + publish_variable :wl_auth_modes , "list <string>" + publish_variable :wl_enc_modes , "list <string>" + publish_variable :wl_channels , "list <string>" + publish_variable :wl_bitrates , "list <string>" + publish_variable :qeth_portname , "string" + publish_variable :qeth_portnumber , "string" + publish_variable :chan_mode , "string" + publish_variable :qeth_options , "string" + publish_variable :ipa_takeover , "boolean" + publish_variable :iucv_user , "string" + publish_variable :qeth_layer2 , "boolean" + publish_variable :qeth_macaddress , "string" + publish_variable :qeth_chanids , "string" + publish_variable :lcs_timeout , "string" + publish_variable :aliases , "map" + publish_variable :tunnel_set_owner , "string" + publish_variable :tunnel_set_group , "string" + publish_variable :proposal_valid , "boolean" + publish_variable :nm_proposal_valid , "boolean" + publish_variable :nm_name , "string" + publish_variable :nm_name_old , "string" + # @attribute SysconfigDefaults + publish_variable :SysconfigDefaults , "map <string, string>" publish :function => :GetLanItem, :type => "map (integer)" publish :function => :getCurrentItem, :type => "map ()" publish :function => :IsItemConfigured, :type => "boolean (integer)" @@ -2657,7 +2698,6 @@ publish :function => :GetDefaultsForHW, :type => "map ()" publish :function => :SetDefaultsForHW, :type => "void ()" publish :function => :SetDeviceVars, :type => "void (map, map)" - publish :variable => :SysconfigDefaults, :type => "map <string, string>" publish :function => :Select, :type => "boolean (string)" publish :function => :Commit, :type => "boolean ()" publish :function => :Rollback, :type => "boolean ()" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/src/modules/SuSEFirewall4Network.rb new/yast2-network-3.1.75/src/modules/SuSEFirewall4Network.rb --- old/yast2-network-3.1.71/src/modules/SuSEFirewall4Network.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/src/modules/SuSEFirewall4Network.rb 2014-08-04 15:03:43.000000000 +0200 @@ -35,6 +35,9 @@ module Yast class SuSEFirewall4NetworkClass < Module + + include Yast::Logger + def main textdomain "network" @@ -42,6 +45,9 @@ Yast.import "SuSEFirewallProposal" Yast.import "Stage" Yast.import "ServicesProposal" + Yast.import "Linuxrc" + Yast.import "ProductFeatures" + Yast.import "Pkg" @firewall_enabled_1st_stage = false @ssh_enabled_1st_stage = false @@ -70,6 +76,38 @@ SuSEFirewall.GetEnableService && SuSEFirewall.GetStartService end + # Sets the values of the initial proposal based on the product features, + # the packages selected for installation and the installation method + def prepare_proposal + # variables from control file + default_firewall = ProductFeatures.GetBooleanFeature("globals", "enable_firewall") + default_fw_ssh = ProductFeatures.GetBooleanFeature("globals", "firewall_enable_ssh") + default_sshd = ProductFeatures.GetBooleanFeature("globals", "enable_sshd") + + log.info "Default firewall values: enable_firewall=#{default_firewall}, "\ + "enable_ssh=#{default_fw_ssh}, enable_sshd=#{default_sshd}" + + # Enabling SuSEFirewall only makes sense if it's going to be + # installed (bnc#881250) + if Pkg.IsSelected(SuSEFirewall.FIREWALL_PACKAGE) + SuSEFirewall4Network.SetEnabled1stStage(default_firewall) + else + SuSEFirewall4Network.SetEnabled1stStage(false) + end + + # we're installing over SSH, propose opening SSH port (bnc#535206) + if Linuxrc.usessh + SuSEFirewall4Network.SetSshEnabled1stStage(true) + SuSEFirewall4Network.SetSshdEnabled(true) + else + SuSEFirewall4Network.SetSshEnabled1stStage(default_fw_ssh) + SuSEFirewall4Network.SetSshdEnabled(default_sshd) + end + + # we're installing over VNC, propose opening VNC port (bnc#734264) + SuSEFirewall4Network.SetVncEnabled1stStage(true) if Linuxrc.vnc + end + # Function returns list of items for combo box with all known # firewall zones. # There's also an item for "" (no zone or fw off). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/test/firewall_stage1_proposal_test.rb new/yast2-network-3.1.75/test/firewall_stage1_proposal_test.rb --- old/yast2-network-3.1.71/test/firewall_stage1_proposal_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-network-3.1.75/test/firewall_stage1_proposal_test.rb 2014-08-04 15:03:43.000000000 +0200 @@ -0,0 +1,48 @@ +#!/usr/bin/env rspec + +ENV["Y2DIR"] = File.expand_path("../../src", __FILE__) + +require "yast" + +module Yast + extend Yast::I18n + Yast::textdomain "network" + + import "SuSEFirewall4Network" + import "SuSEFirewallProposal" + import "WFM" + + describe "FirewallStage1ProposalClient" do + describe "MakeProposal" do + + before(:each) do + # Ensure a fixed proposal + SuSEFirewallProposal.SetChangedByUser(true) + SuSEFirewall4Network.SetSshEnabled1stStage(true) + end + + let(:proposal) { + Yast::WFM.CallFunction("firewall_stage1_proposal", ["MakeProposal"])["preformatted_proposal"] + } + let(:ssh_string) { + Yast::_("SSH port will be open (<a href="%s">block</a>)") % "firewall--disable_ssh_port_in_proposal" + } + + context "when firewall is enabled" do + before { SuSEFirewall4Network.SetEnabled1stStage(true) } + + it "displays ssh port settings" do + expect(proposal).to include ssh_string + end + end + + context "when firewall is disabled" do + before { SuSEFirewall4Network.SetEnabled1stStage(false) } + + it "hides ssh port settings" do + expect(proposal).not_to include ssh_string + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-network-3.1.71/test/suse_firewall_4_network_test.rb new/yast2-network-3.1.75/test/suse_firewall_4_network_test.rb --- old/yast2-network-3.1.71/test/suse_firewall_4_network_test.rb 2014-07-22 15:28:14.000000000 +0200 +++ new/yast2-network-3.1.75/test/suse_firewall_4_network_test.rb 2014-08-04 15:03:43.000000000 +0200 @@ -7,8 +7,23 @@ module Yast import "SuSEFirewall4Network" import "ServicesProposal" + import "Pkg" describe SuSEFirewall4Network do + before(:each) do + # By default, activate firewall and block ssh + allow(ProductFeatures).to receive(:GetBooleanFeature) do |*args| + case args[1] + when "enable_firewall" + true + when "firewall_enable_ssh" + false + when "enable_sshd" + true + end + end + end + describe "#SetSshdEnabled" do it "sets whether sshd service should be started and caches the information in ServicesProposal" do SuSEFirewall4Network.SetSshdEnabled(true) @@ -22,5 +37,31 @@ expect(ServicesProposal.disabled_services.include?('sshd')).to be_true end end + + describe "#prepare_proposal" do + context "when firewall package is selected for installation" do + before(:each) do + allow(Pkg).to receive(:IsSelected).and_return true + end + + it "proposes firewall and ssh port according to control file" do + SuSEFirewall4Network.prepare_proposal + expect(SuSEFirewall4Network.Enabled1stStage).to be_true + expect(SuSEFirewall4Network.EnabledSsh1stStage).to be_false + end + end + + context "when firewall package is not selected for installation" do + before(:each) do + allow(Pkg).to receive(:IsSelected).and_return false + end + + it "proposes disabled firewall and proposes ssh port according to control file" do + SuSEFirewall4Network.prepare_proposal + expect(SuSEFirewall4Network.Enabled1stStage).to be_false + expect(SuSEFirewall4Network.EnabledSsh1stStage).to be_false + end + end + end end end -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org