Hello community,

here is the log from the commit of package targetcli-fb for openSUSE:Factory 
checked in at 2020-07-01 14:26:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/targetcli-fb (Old)
 and      /work/SRC/openSUSE:Factory/.targetcli-fb.new.3060 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "targetcli-fb"

Wed Jul  1 14:26:55 2020 rev:20 rq:817944 version:2.1.53

Changes:
--------
--- /work/SRC/openSUSE:Factory/targetcli-fb/targetcli-fb.changes        
2020-06-11 10:11:37.232494115 +0200
+++ /work/SRC/openSUSE:Factory/.targetcli-fb.new.3060/targetcli-fb.changes      
2020-07-01 14:26:59.666823293 +0200
@@ -1,0 +2,16 @@
+Tue Jun 30 20:54:28 UTC 2020 - ldun...@suse.com
+
+- Update to version 2.1.53:
+  * version 2.1.53
+  * saveconfig: set right perms on /etc/target/ dir
+  * saveconfig: set right perms on backup dir
+  * saveconfig: set 0o600 perms on backupfiles
+  * uds: set right permissions at bind() time
+  This removed patches which are included upstream:
+  * 0001-uds-set-right-permissions-at-bind-time.patch
+  * 0002-saveconfig-set-0o600-perms-on-backupfiles.patch
+  * 0003-saveconfig-set-right-perms-on-backup-dir.patch
+  * 0004-saveconfig-set-right-perms-on-etc-target-dir.patch
+  And replaced the tarball with targetcli-fb-2.1.53.tar.xz
+
+-------------------------------------------------------------------

Old:
----
  0001-uds-set-right-permissions-at-bind-time.patch
  0002-saveconfig-set-0o600-perms-on-backupfiles.patch
  0003-saveconfig-set-right-perms-on-backup-dir.patch
  0004-saveconfig-set-right-perms-on-etc-target-dir.patch
  targetcli-fb-2.1.52.tar.xz

New:
----
  targetcli-fb-2.1.53.tar.xz

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

Other differences:
------------------
++++++ targetcli-fb.spec ++++++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.346825401 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.346825401 +0200
@@ -18,7 +18,7 @@
 
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 Name:           targetcli-fb
-Version:        2.1.52
+Version:        2.1.53
 Release:        0
 Summary:        A command shell for managing the Linux LIO kernel target
 License:        Apache-2.0
@@ -60,12 +60,6 @@
 Patch2:         rbd-support.patch
 Patch3:         fix-setup-install.patch
 
-# upstreamed patches
-Patch11:        0001-uds-set-right-permissions-at-bind-time.patch
-Patch12:        0002-saveconfig-set-0o600-perms-on-backupfiles.patch
-Patch13:        0003-saveconfig-set-right-perms-on-backup-dir.patch
-Patch14:        0004-saveconfig-set-right-perms-on-etc-target-dir.patch
-
 %python_subpackages
 
 %description
@@ -95,10 +89,6 @@
 %patch2 -p1
 %endif
 %patch3 -p1
-%patch11 -p1
-%patch12 -p1
-%patch13 -p1
-%patch14 -p1
 
 %build
 %python_build

++++++ _service ++++++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.378825501 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.378825501 +0200
@@ -7,7 +7,7 @@
     <param name="versionformat">@PARENT_TAG@</param>
     <param name="versionrewrite-pattern">v(\d*\.\d*\.)(\d*)</param>
     <param name="versionrewrite-replacement">\1\2</param>
-    <param name="revision">v2.1.52</param>
+    <param name="revision">v2.1.53</param>
     <param name="changesgenerate">enable</param>
   </service>
   <service name="recompress" mode="disabled">

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.AYqAty/_old  2020-07-01 14:27:00.394825550 +0200
+++ /var/tmp/diff_new_pack.AYqAty/_new  2020-07-01 14:27:00.394825550 +0200
@@ -1,4 +1,4 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/open-iscsi/targetcli-fb.git</param>
-              <param 
name="changesrevision">bab9fc16236c4aceade31e95327bc7b493bb157a</param></service></servicedata>
\ No newline at end of file
+              <param 
name="changesrevision">ff7766b737c0868ae2579da49f2e8304f40767ee</param></service></servicedata>
\ No newline at end of file

++++++ targetcli-fb-2.1.52.tar.xz -> targetcli-fb-2.1.53.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/targetcli-fb-2.1.52/daemon/targetclid 
new/targetcli-fb-2.1.53/daemon/targetclid
--- old/targetcli-fb-2.1.52/daemon/targetclid   2020-05-11 13:14:43.000000000 
+0200
+++ new/targetcli-fb-2.1.53/daemon/targetclid   2020-06-24 10:14:04.000000000 
+0200
@@ -28,6 +28,7 @@
 
 import os
 import sys
+import stat
 import socket
 import struct
 import fcntl
@@ -238,12 +239,17 @@
         # save socket so a signal can clea it up
         to.sock = sock
 
+        mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+        umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+        umask_original = os.umask(umask)
         # Bind the socket path
         try:
             sock.bind(to.socket_path)
         except socket.error as err:
             to.display(to.render(err.strerror, 'red'))
             sys.exit(1)
+        finally:
+            os.umask(umask_original)
 
         # Listen for incoming connections
         try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/targetcli-fb-2.1.52/targetcli/ui_root.py 
new/targetcli-fb-2.1.53/targetcli/ui_root.py
--- old/targetcli-fb-2.1.52/targetcli/ui_root.py        2020-05-11 
13:14:43.000000000 +0200
+++ new/targetcli-fb-2.1.53/targetcli/ui_root.py        2020-06-24 
10:14:04.000000000 +0200
@@ -95,6 +95,26 @@
         else:
             return False
 
+    def _create_dir(self, dirname):
+        '''
+        create directory with permissions 0o600 set
+        if directory already exists, set right perms
+        '''
+        mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+        if not os.path.exists(dirname):
+            umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+            umask_original = os.umask(umask)
+            try:
+                os.makedirs(dirname, mode)
+            except OSError as exe:
+                raise ExecutionError("Cannot create directory [%s] %s."
+                                     % (dirname, exe.strerror))
+            finally:
+                os.umask(umask_original)
+        else:
+            if (os.stat(dirname).st_mode & 0o777) != mode:
+                os.chmod(dirname, mode)
+
     def _save_backups(self, savefile):
         '''
         Take backup of config-file if needed.
@@ -109,12 +129,7 @@
         backupfile = backup_dir + backup_name
         backup_error = None
 
-        if not os.path.exists(backup_dir):
-            try:
-                os.makedirs(backup_dir)
-            except OSError as exe:
-                raise ExecutionError("Cannot create backup directory [%s] %s."
-                                     % (backup_dir, exe.strerror))
+        self._create_dir(backup_dir)
 
         # Only save backups if savefile exits
         if not os.path.exists(savefile):
@@ -125,12 +140,17 @@
 
         # Save backup if backup dir is empty, or savefile is differnt from 
recent backup copy
         if not backed_files_list or not 
self._compare_files(backed_files_list[-1], savefile):
+            mode = stat.S_IRUSR | stat.S_IWUSR # 0o600
+            umask = 0o777 ^ mode  # Prevents always downgrading umask to 0
+            umask_original = os.umask(umask)
             try:
                 with open(savefile, 'rb') as f_in, gzip.open(backupfile, 'wb') 
as f_out:
                     shutil.copyfileobj(f_in, f_out)
                     f_out.flush()
             except IOError as ioe:
                 backup_error = ioe.strerror or "Unknown error"
+            finally:
+                os.umask(umask_original)
 
             if backup_error == None:
                 # remove excess backups
@@ -167,6 +187,8 @@
 
         savefile = os.path.expanduser(savefile)
 
+        save_dir = os.path.dirname(savefile)
+        self._create_dir(save_dir)
         self._save_backups(savefile)
 
         self.rtsroot.save_to_file(savefile)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/targetcli-fb-2.1.52/targetcli/version.py 
new/targetcli-fb-2.1.53/targetcli/version.py
--- old/targetcli-fb-2.1.52/targetcli/version.py        2020-05-11 
13:14:43.000000000 +0200
+++ new/targetcli-fb-2.1.53/targetcli/version.py        2020-06-24 
10:14:04.000000000 +0200
@@ -15,4 +15,4 @@
 under the License.
 '''
 
-__version__ = '2.1.52'
+__version__ = '2.1.53'


Reply via email to