Hello community,

here is the log from the commit of package util-linux for openSUSE:Factory 
checked in at 2013-07-02 12:30:09
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/util-linux (Old)
 and      /work/SRC/openSUSE:Factory/.util-linux.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "util-linux"

Changes:
--------
--- /work/SRC/openSUSE:Factory/util-linux/util-linux.changes    2013-06-25 
06:56:54.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.util-linux.new/util-linux.changes       
2013-07-02 14:30:30.000000000 +0200
@@ -1,0 +2,23 @@
+Mon Jul  1 13:43:23 UTC 2013 - m...@bernhard-voelker.de
+
+- Correct condition for Conflicts of sysvinit-tools.
+
+-------------------------------------------------------------------
+Mon Jul  1 07:08:46 UTC 2013 - wer...@suse.de
+
+- Correct version in source URL path.
+
+-------------------------------------------------------------------
+Fri Jun 28 17:42:14 CEST 2013 - sbra...@suse.cz
+
+- Fix Provides and Obsoletes of eject.
+- Conflict with old coreutils and sysvinit-tools with conflicting
+  files to guarantee seamless upgrade.
+- Remove Provides and Obsoletes of packages that do not exist since
+  SuSE Linux 8.
+- Include upstreamed patch from SUSE eject package:
+  Check eject host_status and driver_status when using SG_IO
+  (eject-scsi-check-host_status-and-driver_status.patch,
+  bnc#358033).
+
+-------------------------------------------------------------------

New:
----
  eject-scsi-check-host_status-and-driver_status.patch

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

Other differences:
------------------
++++++ util-linux.spec ++++++
--- /var/tmp/diff_new_pack.0HEin4/_old  2013-07-02 14:30:32.000000000 +0200
+++ /var/tmp/diff_new_pack.0HEin4/_new  2013-07-02 14:30:32.000000000 +0200
@@ -16,12 +16,6 @@
 #
 
 
-#
-# Following package should be fixed:
-#  coreutils ... do not install su and kill
-#  sysvinit-tools ... do not install sulogin and utmpdump
-#  eject ... simply drop this package
-#
 %bcond_without  sysvinit_tools
 %bcond_without enable_su
 %bcond_without enable_eject
@@ -59,7 +53,7 @@
 Summary:        A collection of basic system utilities
 License:        GPL-2.0+
 Group:          System/Base
-Source:         
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.21/%{name}-%{version}.tar.bz2
+Source:         
ftp://ftp.kernel.org/pub/linux/utils/util-linux/v2.23/%{name}-%{version}.tar.bz2
 Source1:        util-linux-rpmlintrc
 # XXX: make nologin part of util-linux upstream
 Source2:        nologin.c
@@ -95,7 +89,8 @@
 Patch3:         fdisk-tinfo.patch
 # PATCH-EXTEND-UPSTREAM: Let `su' handle /sbin and /usr/sbin in path
 Patch4:         make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
-
+# PATCH-FIX-UPSTREAM eject-scsi-check-host_status-and-driver_status.patch 
bnc358033 ani...@suse.cz -- Check eject host_status and driver_status when 
using SG_IO.
+Patch5:         eject-scsi-check-host_status-and-driver_status.patch
 # disable encryption
 Patch12:        util-linux-2.23.1-noenc-suse.diff
 
@@ -115,20 +110,25 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 PreReq:         %insserv_prereq %fillup_prereq /bin/sed
 #
-Provides:       base = %{version}-%{release}
-Provides:       eject = %{version}-%{release}
+%if %{with enable_eject}
+Provides:       eject = 2.1.0-166.8
+%endif
 Provides:       login = 4.0-33.7
-Provides:       raw = %{version}-%{release}
-Provides:       rawio = %{version}-%{release}
-Provides:       util = %{version}-%{release}
-Provides:       uuid-runtime = %{version}-%{release}
-Obsoletes:      base < %{version}-%{release}
-Obsoletes:      eject < %{version}-%{release}
+%if %{with enable_eject}
+# File conflict of eject (up to 12.3 and SLE11).
+Obsoletes:      eject < 2.1.0-166.8
+%endif
+# File conflict of login (up to 12.1 and SLE11).
 Obsoletes:      login < 4.0-33.7
-Obsoletes:      raw < %{version}-%{release}
-Obsoletes:      rawio < %{version}-%{release}
-Obsoletes:      util < %{version}-%{release}
-Obsoletes:      uuid-runtime < %{version}-%{release}
+%if %{with enable_su}
+# File conflict of su and kill (up to 12.3 and SLE11).
+# It should be coreutils < 8.21-4, but coreutils provide Release-less symbol.
+Conflicts:      coreutils < 8.21
+%endif
+%if %{with sysvinit_tools}
+# File conflict of sulogin and utmpdump (up to 12.3 and SLE11).
+Conflicts:      sysvinit-tools < 2.88+-87
+%endif
 #
 # Using "Requires" here would lend itself to help upgrading, but since
 # util-linux is in the initial bootstrap, that is not a good thing to do:
@@ -210,6 +210,7 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
 %patch12 -p1
 #
 %patch20 -p1
@@ -795,6 +796,7 @@
 %dir %{_datadir}/getopt
 %attr (755,root,root) %{_datadir}/getopt/getopt-parse.bash
 %attr (755,root,root) %{_datadir}/getopt/getopt-parse.tcsh
+# FIXME: Fix directory ownership.
 %{_datadir}/bash-completion
 %ifnarch ia64
 #XXX: post our patches upstream

++++++ eject-scsi-check-host_status-and-driver_status.patch ++++++
>From 90a0e97c7be9da39fd54600228e006b98667ad56 Mon Sep 17 00:00:00 2001
From: Karel Zak <k...@redhat.com>
Date: Tue, 18 Jun 2013 12:24:28 +0200
Subject: [PATCH 1/2] eject: Check host_status and driver_status when using
 SG_IO.

Based on Suse patch, originally from
        Anna Bernathova <ani...@suse.cz>, May 2008

  SG_IO completion status is weird but still well defined. You'll need
  to check both host_status, driver_status and status to determine that
  a command actually succeeded. -- Tejun Heo, May 2008

Note that we also need to check driver_status and sense_buffer to
detect situation when there is no medium. It's valid request to call
eject(8) for device with no medium.

References: https://bugzilla.novell.com/show_bug.cgi?id=358033
Signed-off-by: Anna Bernathova <ani...@suse.cz>
Signed-off-by: Karel Zak <k...@redhat.com>
---
 sys-utils/eject.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/sys-utils/eject.c b/sys-utils/eject.c
index 4ec69e7..f98f227 100644
--- a/sys-utils/eject.c
+++ b/sys-utils/eject.c
@@ -53,6 +53,14 @@
 #include "pathnames.h"
 #include "sysfs.h"
 
+/*
+ * sg_io_hdr_t driver_status -- see kernel include/scsi/scsi.h
+ */
+#ifndef DRIVER_SENSE
+# define DRIVER_SENSE  0x08
+#endif
+
+
 #define EJECT_DEFAULT_DEVICE "/dev/cdrom"
 
 
@@ -604,17 +612,27 @@ static int eject_scsi(int fd)
 
        io_hdr.cmdp = allowRmBlk;
        status = ioctl(fd, SG_IO, (void *)&io_hdr);
-       if (status < 0)
+       if (status < 0 || io_hdr.host_status || io_hdr.driver_status)
                return 0;
 
        io_hdr.cmdp = startStop1Blk;
        status = ioctl(fd, SG_IO, (void *)&io_hdr);
-       if (status < 0)
+       if (status < 0 || io_hdr.host_status)
+               return 0;
+
+       /* Ignore errors when there is not medium -- in this case driver sense
+        * buffer sets MEDIUM NOT PRESENT (3a) bit. For more details see:
+        * 
http://www.tldp.org/HOWTO/archived/SCSI-Programming-HOWTO/SCSI-Programming-HOWTO-22.html#sec-sensecodes
+        * -- kzak Jun 2013
+        */
+       if (io_hdr.driver_status != 0 &&
+           !(io_hdr.driver_status == DRIVER_SENSE && io_hdr.sbp &&
+                                                     io_hdr.sbp[12] == 0x3a))
                return 0;
 
        io_hdr.cmdp = startStop2Blk;
        status = ioctl(fd, SG_IO, (void *)&io_hdr);
-       if (status < 0)
+       if (status < 0 || io_hdr.host_status || io_hdr.driver_status)
                return 0;
 
        /* force kernel to reread partition table when new disc inserted */
-- 
1.8.1.4

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to