Hello community,

here is the log from the commit of package yast2-network for openSUSE:Factory 
checked in at 2019-01-24 14:01:05
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-network.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network"

Thu Jan 24 14:01:05 2019 rev:399 rq:667971 version:4.1.34

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes      
2019-01-10 15:16:19.694748051 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-network.new.28833/yast2-network.changes   
2019-01-24 14:01:08.416207151 +0100
@@ -1,0 +2,36 @@
+Wed Jan 23 08:52:03 UTC 2019 - mfi...@suse.com
+
+- bnc#1122387
+  - do not crash with internal error when modifying /etc/hosts
+- 4.1.34 
+
+-------------------------------------------------------------------
+Tue Jan 22 09:27:44 UTC 2019 - mfi...@suse.com
+
+- bnc#1122517
+  - do not crash with internal error when cloning /etc/hosts
+- 4.1.33 
+
+-------------------------------------------------------------------
+Fri Jan 18 09:41:56 UTC 2019 - mfi...@suse.com
+
+- bnc#1122307
+  - do not crash with internal error when adding new device
+- 4.1.32 
+
+-------------------------------------------------------------------
+Fri Jan 18 09:40:00 CET 2019 - sch...@suse.de
+
+- AutoYaST write settings: Fixed crash while reading MAC address
+  (bsc#1121087).
+- 4.1.31
+
+-------------------------------------------------------------------
+Wed Jan 16 09:23:11 UTC 2019 - mfi...@suse.com
+
+- bnc#1121421
+  - do not crash with internal error when installing using
+    AutoYaST profile with networking section
+- 4.1.30 
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-4.1.29.tar.bz2

New:
----
  yast2-network-4.1.34.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.NA9gNS/_old  2019-01-24 14:01:09.468205952 +0100
+++ /var/tmp/diff_new_pack.NA9gNS/_new  2019-01-24 14:01:09.472205948 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.1.29
+Version:        4.1.34
 Release:        0
 BuildArch:      noarch
 

++++++ yast2-network-4.1.29.tar.bz2 -> yast2-network-4.1.34.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/package/yast2-network.changes 
new/yast2-network-4.1.34/package/yast2-network.changes
--- old/yast2-network-4.1.29/package/yast2-network.changes      2019-01-10 
10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/package/yast2-network.changes      2019-01-23 
11:43:01.000000000 +0100
@@ -1,4 +1,40 @@
 -------------------------------------------------------------------
+Wed Jan 23 08:52:03 UTC 2019 - mfi...@suse.com
+
+- bnc#1122387
+  - do not crash with internal error when modifying /etc/hosts
+- 4.1.34 
+
+-------------------------------------------------------------------
+Tue Jan 22 09:27:44 UTC 2019 - mfi...@suse.com
+
+- bnc#1122517
+  - do not crash with internal error when cloning /etc/hosts
+- 4.1.33 
+
+-------------------------------------------------------------------
+Fri Jan 18 09:41:56 UTC 2019 - mfi...@suse.com
+
+- bnc#1122307
+  - do not crash with internal error when adding new device
+- 4.1.32 
+
+-------------------------------------------------------------------
+Fri Jan 18 09:40:00 CET 2019 - sch...@suse.de
+
+- AutoYaST write settings: Fixed crash while reading MAC address
+  (bsc#1121087).
+- 4.1.31
+
+-------------------------------------------------------------------
+Wed Jan 16 09:23:11 UTC 2019 - mfi...@suse.com
+
+- bnc#1121421
+  - do not crash with internal error when installing using
+    AutoYaST profile with networking section
+- 4.1.30 
+
+-------------------------------------------------------------------
 Thu Jan 10 08:29:43 UTC 2019 - mfi...@suse.com
 
 - bnc#1111483
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/package/yast2-network.spec 
new/yast2-network-4.1.34/package/yast2-network.spec
--- old/yast2-network-4.1.29/package/yast2-network.spec 2019-01-10 
10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/package/yast2-network.spec 2019-01-23 
11:43:01.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.1.29
+Version:        4.1.34
 Release:        0
 BuildArch:      noarch
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/src/clients/host_auto.rb 
new/yast2-network-4.1.34/src/clients/host_auto.rb
--- old/yast2-network-4.1.29/src/clients/host_auto.rb   2019-01-10 
10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/src/clients/host_auto.rb   2019-01-23 
11:43:01.000000000 +0100
@@ -123,9 +123,13 @@
         @ret = Host.Write
         Progress.set(@progress_orig)
       elsif @func == "SetModified"
-        @ret = Host.SetModified
+        # SetModified always return(ed) true anyway
+        @ret = true
       elsif @func == "GetModified"
-        @ret = Host.GetModified
+        # When cloning the sequence of this client callbacks invocation is
+        # Read -> SetModified -> GetModified so it should return always true
+        # (bcs of SetModified)
+        @ret = true
       else
         Builtins.y2error("Unknown function: %1", @func)
         @ret = false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.1.29/src/include/network/services/host.rb 
new/yast2-network-4.1.34/src/include/network/services/host.rb
--- old/yast2-network-4.1.29/src/include/network/services/host.rb       
2019-01-10 10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/src/include/network/services/host.rb       
2019-01-23 11:43:01.000000000 +0100
@@ -69,6 +69,23 @@
       Popup.AnyQuestion("", text, Label.YesButton, Label.NoButton, :focus_no)
     end
 
+    # Encode canonical name and aliases using puny code
+    #
+    # @param canonical [String] canonical hostname
+    # @param aliases [Array<String>] space separated list of aliases
+    # @return [String] space separated list of hostnames encoded using puny 
codes
+    #                  canonical name is the first one
+    def encode_hosts_line(canonical, aliases)
+      encoded_aliases = !aliases.nil? ? Punycode.EncodePunycodes(aliases) : []
+      encoded_canonical = !canonical.nil? ? 
Punycode.EncodeDomainName(canonical) : ""
+
+      encoded = ""
+      encoded << encoded_canonical if !encoded_canonical.empty?
+      encoded << " " + encoded_aliases.join(" ") if !encoded_aliases.empty?
+
+      encoded
+    end
+
     # Main hosts dialog
     # @param [Boolean] standalone true if not run from another ycp client
     # @return dialog result
@@ -249,17 +266,13 @@
           UI.ChangeWidget(Id(:table), :Items, table_items)
           modified = true
         elsif ret == :next
-          # check_
           next if !modified
           Host.clear
 
           table_items.each do |row|
-            encoded_aliases = Punycode.EncodePunycodes([row.fetch(3, "")])
-            encoded_canonical = Punycode.EncodeDomainName(row.fetch(2, ""))
-            value = encoded_canonical + " " + encoded_aliases.join(" ")
-            key = row.fetch(1, "")
+            hostnames = encode_hosts_line(row[2], (row[3] || "").split)
 
-            Host.add_name(key, value)
+            Host.add_name(row[1] || "", hostnames)
           end
         else
           log.error("unexpected retcode: %1", ret)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/src/modules/Host.rb 
new/yast2-network-4.1.34/src/modules/Host.rb
--- old/yast2-network-4.1.29/src/modules/Host.rb        2019-01-10 
10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/src/modules/Host.rb        2019-01-23 
11:43:01.000000000 +0100
@@ -298,6 +298,9 @@
     # Function which returns if the settings were modified
     # @return [Boolean]  settings were modified
     def GetModified
+      # when importing AY profile @initial_hosts is not initialized
+      # bcs it would be the same as @hosts and modification would not be 
detected
+      return true if @hosts && @initial_hosts.nil?
       @hosts.hosts != @initial_hosts.hosts
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/src/modules/Lan.rb 
new/yast2-network-4.1.34/src/modules/Lan.rb
--- old/yast2-network-4.1.29/src/modules/Lan.rb 2019-01-10 10:06:06.000000000 
+0100
+++ new/yast2-network-4.1.34/src/modules/Lan.rb 2019-01-23 11:43:01.000000000 
+0100
@@ -183,7 +183,8 @@
             to:   "list <string>"
           )
         ) do |devname|
-          mac = ::File.read("/sys/class/net/#{devname}/address").chomp
+          address_file = "/sys/class/net/#{devname}/address"
+          mac = ::File.read(address_file).chomp if ::File.file?(address_file)
           Builtins.y2milestone("confname %1", mac)
           if !Builtins.haskey(link_status, mac)
             Builtins.y2error(
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/src/modules/LanItems.rb 
new/yast2-network-4.1.34/src/modules/LanItems.rb
--- old/yast2-network-4.1.29/src/modules/LanItems.rb    2019-01-10 
10:06:06.000000000 +0100
+++ new/yast2-network-4.1.34/src/modules/LanItems.rb    2019-01-23 
11:43:01.000000000 +0100
@@ -754,6 +754,8 @@
 
     def AddNew
       @current = @Items.to_h.size
+      # Items[@current] is expected to always exist
+      @Items[@current] = {}
       @operation = :add
 
       nil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.1.29/test/host_service_test.rb 
new/yast2-network-4.1.34/test/host_service_test.rb
--- old/yast2-network-4.1.29/test/host_service_test.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-network-4.1.34/test/host_service_test.rb  2019-01-23 
11:43:01.000000000 +0100
@@ -0,0 +1,32 @@
+#!/usr/bin/env rspec
+
+require_relative "test_helper"
+
+Yast.import "UI"
+
+class DummyHostService < Yast::Module
+  def initialize
+    Yast.include self, "network/services/host.rb"
+  end
+end
+
+describe "NetworkServicesHostInclude" do
+  subject { DummyHostService.new }
+
+  describe "#encode_hosts_line" do
+    it "encodes canonical name even aliases" do
+      canonical = "žížala.jůlinka.go.home"
+      aliases = "žížala jůlinka        earthworm"
+
+      result = subject.encode_hosts_line(canonical, aliases.split)
+
+      expect(result).to eql "xn--ala-qma83eb.xn--jlinka-3mb.go.home 
xn--ala-qma83eb xn--jlinka-3mb earthworm"
+    end
+
+    it "returns empty string when invalid arguments were passed" do
+      result = subject.encode_hosts_line(nil, nil)
+
+      expect(result).to be_empty
+    end
+  end
+end


Reply via email to