Hello community,

here is the log from the commit of package yast2-nis-client for 
openSUSE:Factory checked in at 2020-02-18 10:34:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-nis-client (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-nis-client.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-nis-client"

Tue Feb 18 10:34:09 2020 rev:70 rq:774153 version:4.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-nis-client/yast2-nis-client.changes        
2019-08-30 14:37:40.269459025 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-nis-client.new.26092/yast2-nis-client.changes 
    2020-02-18 10:34:12.612186085 +0100
@@ -1,0 +2,7 @@
+Fri Feb  7 16:09:20 UTC 2020 - José Iván López González <[email protected]>
+
+- Preserve NSS database sources when adding nis to nsswitch.conf
+  file (bsc#1162916).
+- 4.2.2
+
+-------------------------------------------------------------------

Old:
----
  yast2-nis-client-4.2.1.tar.bz2

New:
----
  yast2-nis-client-4.2.2.tar.bz2

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

Other differences:
------------------
++++++ yast2-nis-client.spec ++++++
--- /var/tmp/diff_new_pack.2bqUqC/_old  2020-02-18 10:34:13.260187407 +0100
+++ /var/tmp/diff_new_pack.2bqUqC/_new  2020-02-18 10:34:13.260187407 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-nis-client
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,7 +20,7 @@
 Summary:        YaST2 - Network Information Services (NIS, YP) Configuration
 License:        GPL-2.0-only
 Group:          System/YaST
-Version:        4.2.1
+Version:        4.2.2
 Release:        0
 Url:            https://github.com/yast/yast-nis-client
 

++++++ yast2-nis-client-4.2.1.tar.bz2 -> yast2-nis-client-4.2.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-nis-client-4.2.1/package/yast2-nis-client.changes 
new/yast2-nis-client-4.2.2/package/yast2-nis-client.changes
--- old/yast2-nis-client-4.2.1/package/yast2-nis-client.changes 2019-08-27 
19:39:53.000000000 +0200
+++ new/yast2-nis-client-4.2.2/package/yast2-nis-client.changes 2020-02-13 
13:40:42.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Fri Feb  7 16:09:20 UTC 2020 - José Iván López González <[email protected]>
+
+- Preserve NSS database sources when adding nis to nsswitch.conf
+  file (bsc#1162916).
+- 4.2.2
+
+-------------------------------------------------------------------
 Tue Aug 27 18:23:15 CEST 2019 - [email protected]
 
 - Set X-SuSE-YaST-AutoInstResource in desktop file (bsc#144894).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-nis-client-4.2.1/package/yast2-nis-client.spec 
new/yast2-nis-client-4.2.2/package/yast2-nis-client.spec
--- old/yast2-nis-client-4.2.1/package/yast2-nis-client.spec    2019-08-27 
19:39:53.000000000 +0200
+++ new/yast2-nis-client-4.2.2/package/yast2-nis-client.spec    2020-02-13 
13:40:42.000000000 +0100
@@ -18,7 +18,7 @@
 
 Name:           yast2-nis-client
 Summary:        YaST2 - Network Information Services (NIS, YP) Configuration
-Version:        4.2.1
+Version:        4.2.2
 Release:        0
 Url:            https://github.com/yast/yast-nis-client
 Group:          System/YaST
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-nis-client-4.2.1/src/modules/Nis.rb 
new/yast2-nis-client-4.2.2/src/modules/Nis.rb
--- old/yast2-nis-client-4.2.1/src/modules/Nis.rb       2019-08-27 
19:39:53.000000000 +0200
+++ new/yast2-nis-client-4.2.2/src/modules/Nis.rb       2020-02-13 
13:40:42.000000000 +0100
@@ -1024,8 +1024,9 @@
     end
 
     # Do we need compat? Is there a plus in any of the user databases?
-    # @return true/false
-    def HavePlus
+    #
+    # @return [Boolean]
+    def has_plus?
       files = ["/etc/passwd", "/etc/shadow", "/etc/group"]
       # find a file having a plus
       nil != Builtins.find(files) { |file| HasPlus(file) }
@@ -1053,12 +1054,14 @@
       true
     end
 
-    # Configures the name service switch for the user databases
-    # according to chosen settings
-    # @return success?
+    # Configures the name service switch for the user databases according to 
chosen settings
+    #
+    # @return [Boolean] true on success; false otherwise
     def WriteNssConf
       dbs = ["passwd", "group", "shadow"]
+
       nis_dbs = ["services", "netgroup", "aliases"]
+
       # Why bother with both compat and nis?
       # If there's no plus, we don't have to write passwd etc.
       # And it's supposed to be faster.
@@ -1066,59 +1069,75 @@
       # so we stick with compat.
       if @start
         # we want to switch to "compat"
-        Builtins.foreach(dbs) do |db|
+        dbs.each do |db|
           # what if a db is not mentioned?
           # We get [] meaning compat, so it's ok to make it explicit
           db_l = Nsswitch.ReadDb(db)
-          if !Builtins.contains(db_l, "compat")
+
+          if db_l.include?("compat")
             # remove "files" and "nis", if there;
-            db_l = Builtins.filter(db_l) { |s| s != "files" && s != "nis" }
+            db_l -= ["files", "nis"]
+
             # put "compat" and the rest;
-            db_l = Builtins.prepend(db_l, "compat")
+            db_l.prepend("compat")
+
             Nsswitch.WriteDb(db, db_l)
           end
+
           # *_compat may be set to nisplus, nuke it (#16168)
-          db_c = Ops.add(db, "_compat")
+          db_c = db + ["_compat"]
+
           Nsswitch.WriteDb(db_c, [])
         end
+
         Builtins.y2milestone("Writing pluses")
+
         WritePluses()
-        Builtins.foreach(nis_dbs) do |db|
+
+        nis_dbs.each do |db|
           db_l = Nsswitch.ReadDb(db)
-          if !Builtins.contains(db_l, "nis")
+
+          if !db_l.include?("nis")
             if db == "netgroup"
               db_l = ["nis"]
             else
-              db_l = ["files", "nis"]
+              db_l << "nis"
             end
+
             Nsswitch.WriteDb(db, db_l)
           end
         end # not start
       else
         Builtins.y2milestone("not writing pluses")
-        have_plus = HavePlus()
 
-        Builtins.foreach(dbs) do |db|
-          db_l = Nsswitch.ReadDb(db)
-          # remove "nis" if there;
-          db_l = Builtins.filter(db_l) { |s| s != "nis" }
-          # if nothing left, put "files";
-          # NOT. just remove it, meaning compat. #35299
-          Nsswitch.WriteDb(db, db_l)
-        end if !have_plus
-        Builtins.foreach(nis_dbs) do |db|
+        if !has_plus?
+          dbs.each do |db|
+            db_l = Nsswitch.ReadDb(db)
+
+            # remove "nis" if there;
+            db_l -= ["nis"]
+
+            # if nothing left, put "files";
+            # NOT. just remove it, meaning compat. #35299
+            Nsswitch.WriteDb(db, db_l)
+          end
+        end
+
+        nis_dbs.each do |db|
           db_l = Nsswitch.ReadDb(db)
-          db_l = Builtins.filter(db_l) { |s| s != "nis" }
-          db_l = ["files"] if db_l == []
+
+          db_l -= ["nis"]
+          db_l = ["files", "usrfiles"] if db_l.empty?
+
           Nsswitch.WriteDb(db, db_l)
         end
       end
 
-      if !SCR.Write(path(".etc.nsswitch_conf"), nil)
-        Report.Error(Message.ErrorWritingFile("/etc/nsswitch.conf"))
-        return false
-      end
-      true
+      return true if SCR.Write(path(".etc.nsswitch_conf"), nil)
+
+      Report.Error(Message.ErrorWritingFile("/etc/nsswitch.conf"))
+
+      false
     end
 
     # Only write new configuration w/o starting any scripts
@@ -1282,7 +1301,7 @@
           Pam.Add("unix-nis")
         else
           Pam.Remove("unix-nis")
-        end 
+        end
       end
 
       Y2Firewall::Firewalld.instance.reload


Reply via email to