Accepting request 285960 from home:jengelh:branches:Base:System

- Update to ne wupstream release 1.40

OBS-URL: https://build.opensuse.org/request/show/285960
OBS-URL: https://build.opensuse.org/package/show/Base:System/sg3_utils?expand=0&rev=48
This commit is contained in:
Marcus Meissner 2015-02-24 15:53:49 +00:00 committed by Git OBS Bridge
parent 0e6e64a4dc
commit 209d81a5f2
7 changed files with 52 additions and 150 deletions

3
sg3_utils-1.40.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:901ece577d797a8a3870881fe765f6eac4bb381b99a1f7311551689e9f17130b
size 742448

View File

@ -1,34 +0,0 @@
From 6044f09bd55a9e215b662f8822c41b16fba523d2 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 3 Sep 2014 15:52:15 +0200
Subject: [PATCH 2/2] sg_inq: Do not export long identifiers
Some targets (accidentally) display really long vendor specific
IDs. These will cause a pathname overflow when udev tries to
generate links based on that name.
So skip any vendor-specific IDs which are longer than 128 characters;
vendor-specific IDs are of limited usage anyway.
References: bnc#884779
Signed-off-by: Hannes Reinecke <hare@suse.de>
---
src/sg_inq.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/sg_inq.c b/src/sg_inq.c
index a78960f..74b11ff 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -1827,6 +1827,8 @@ export_dev_ids(unsigned char * buff, int len, int verbose)
}
switch (desig_type) {
case 0: /* vendor specific */
+ if (i_len > 128)
+ break;
printf("SCSI_IDENT_%s_VENDOR=", assoc_str);
if ((2 == c_set) || (3 == c_set)) { /* ASCII or UTF-8 */
k = encode_whitespaces(ip, i_len);
--
1.8.4.5

View File

@ -1,90 +0,0 @@
From c76bfccf5497b11644425e2020f3b9b1bad59142 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Wed, 3 Sep 2014 15:26:42 +0200
Subject: [PATCH 1/2] Fixup formatting of invalid VPD page 0x83
Some target present invalid VPD page 0x83 descriptors.
This patch fixes up sg_inq and sg_vpd to skip those descriptors.
References: bnc#884779
Signed-of-by: Hannes Reinecke <hare@suse.de>
---
src/sg_inq.c | 12 +++++++++++-
src/sg_vpd.c | 16 +++++++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 473d212..a78960f 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -1512,7 +1512,7 @@ decode_dev_ids(const char * leadin, unsigned char * buff, int len, int do_hex)
switch (desig_type) {
case 0: /* vendor specific */
k = 0;
- if ((1 == c_set) || (2 == c_set)) { /* ASCII or UTF-8 */
+ if ((2 == c_set) || (3 == c_set)) { /* ASCII or UTF-8 */
for (k = 0; (k < i_len) && isprint(ip[k]); ++k)
;
if (k >= i_len)
@@ -1965,6 +1965,16 @@ export_dev_ids(unsigned char * buff, int len, int verbose)
}
break;
}
+ if (strncmp((const char *)ip, "eui.", 4) ||
+ strncmp((const char *)ip, "naa.", 4) ||
+ strncmp((const char *)ip, "iqn.", 4)) {
+ if (verbose) {
+ pr2serr(" << expected name string prefix>>\n");
+ dStrHexErr((const char *)ip, i_len, -1);
+ }
+ break;
+ }
+
printf("SCSI_IDENT_%s_NAME=%.*s\n", assoc_str, i_len,
(const char *)ip);
break;
diff --git a/src/sg_vpd.c b/src/sg_vpd.c
index a69b3ec..2f97e94 100644
--- a/src/sg_vpd.c
+++ b/src/sg_vpd.c
@@ -1115,6 +1115,13 @@ decode_dev_ids_quiet(unsigned char * buff, int len, int m_assoc,
dStrHexErr((const char *)ip, i_len, 0);
break;
}
+ if (strncmp((const char *)ip, "eui.", 4) ||
+ strncmp((const char *)ip, "naa.", 4) ||
+ strncmp((const char *)ip, "iqn.", 4)) {
+ pr2serr(" << expected name string prefix>>\n");
+ dStrHexErr((const char *)ip, i_len, -1);
+ break;
+ }
/* does %s print out UTF-8 ok??
* Seems to depend on the locale. Looks ok here with my
* locale setting: en_AU.UTF-8
@@ -1162,7 +1169,7 @@ decode_designation_descriptor(const unsigned char * ip, int i_len,
switch (desig_type) {
case 0: /* vendor specific */
k = 0;
- if ((1 == c_set) || (2 == c_set)) { /* ASCII or UTF-8 */
+ if ((2 == c_set) || (3 == c_set)) { /* ASCII or UTF-8 */
for (k = 0; (k < i_len) && isprint(ip[k]); ++k)
;
if (k >= i_len)
@@ -1405,6 +1412,13 @@ decode_designation_descriptor(const unsigned char * ip, int i_len,
dStrHexErr((const char *)ip, i_len, 0);
break;
}
+ if (strncmp((const char *)ip, "eui.", 4) ||
+ strncmp((const char *)ip, "naa.", 4) ||
+ strncmp((const char *)ip, "iqn.", 4)) {
+ pr2serr(" << expected name string prefix>>\n");
+ dStrHexErr((const char *)ip, i_len, -1);
+ break;
+ }
printf(" SCSI name string:\n");
/* does %s print out UTF-8 ok??
* Seems to depend on the locale. Looks ok here with my
--
1.8.4.5

View File

@ -1,12 +0,0 @@
Index: sg3_utils-1.39/scripts/58-scsi-sg3_symlink.rules
===================================================================
--- sg3_utils-1.39/scripts/58-scsi-sg3_symlink.rules
+++ sg3_utils-1.39/scripts/58-scsi-sg3_symlink.rules
@@ -10,6 +10,7 @@ ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO
# Select which identifier to use per default
# 0: vpd page 0x80 identifier
ENV{SCSI_IDENT_SERIAL}=="?*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/scsi-S$env{SCSI_VENDOR}_$env{SCSI_MODEL}_$env{SCSI_IDENT_SERIAL}"
+ENV{SCSI_IDENT_SERIAL}=="?*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/scsi-S$env{SCSI_VENDOR}_$env{SCSI_MODEL}_$env{SCSI_IDENT_SERIAL}-part%n"
# 1: NAA identifier (prefix 3)
ENV{SCSI_IDENT_LUN_NAA}=="?*", ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-id/scsi-3$env{SCSI_IDENT_LUN_NAA}"
ENV{SCSI_IDENT_LUN_NAA}=="?*", ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-id/scsi-3$env{SCSI_IDENT_LUN_NAA}-part%n"

View File

@ -1,3 +1,19 @@
-------------------------------------------------------------------
Fri Feb 13 14:22:36 UTC 2015 - jengelh@inai.de
- Update to ne wupstream release 1.40
* New utilities: sg_write_verify (for WRITE AND VERIFY),
sg_ses_microcode, sg_sat_read_gplog.
* sg_senddiag gained the --maxlen= and --page=PG options
* sg_opcodes gained the --compact field
* sg_inq: expand Block limits VPD page output
- Drop sg3_utils-fix-missing-rule-for-scsi_serial-partitions.patch,
sg3_utils-Fixup-formatting-of-invalid-VPD-page-0x83.patch,
sg3_utils-Do-not-export-long-identifiers.patch
(merged upstream)
- Replace symbol version hack (it forced lockstep updates) by
sgut-libversioning.diff (allows parallel installation).
-------------------------------------------------------------------
Sun Jan 4 13:55:32 UTC 2015 - lnussel@suse.de

View File

@ -17,8 +17,8 @@
Name: sg3_utils
%define lname libsgutils2-2
Version: 1.39
%define lname libsgutils2-1_40-2
Version: 1.40
Release: 0
Summary: A collection of tools that send SCSI commands to devices
License: GPL-2.0+ and BSD-3-Clause
@ -26,11 +26,10 @@ Group: Hardware/Other
Url: http://sg.danny.cz/sg/sg3_utils.html
Source: http://sg.danny.cz/sg/p/%name-%version.tar.xz
Patch0: sg3_utils-fix-missing-rule-for-scsi_serial-partitions.patch
Patch1: sg3_utils-Fixup-formatting-of-invalid-VPD-page-0x83.patch
Patch2: sg3_utils-Do-not-export-long-identifiers.patch
Patch1: sgut-libversioning.diff
Patch3: sg3_utils-sg_inq-blacklist.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: libtool
BuildRequires: udev
BuildRequires: xz
Requires(pre): %insserv_prereq
@ -84,21 +83,16 @@ applications that want to make use of libsgutils.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%build
%configure --disable-static --with-pic
# sg3_utils has added functions between (for example) 1.36 and 1.39
# without tracking them. Add symvers so RPM updates work in all cases.
echo 'V_%version { global: *; };' >symvers
make %{?_smp_mflags} -C lib LDFLAGS="-Wl,--version-script=$PWD/symvers"
autoreconf -fi
%configure --disable-static
make %{?_smp_mflags}
%install
make install DESTDIR="%buildroot"
%make_install
install -m 755 scripts/scsi_logging_level $RPM_BUILD_ROOT%{_bindir}
install -m 755 scripts/rescan-scsi-bus.sh $RPM_BUILD_ROOT%{_bindir}
install -m 644 doc/rescan-scsi-bus.sh.8 $RPM_BUILD_ROOT%{_mandir}/man8
@ -128,7 +122,7 @@ rm -f %{buildroot}%{_libdir}/*.la
%files -n %lname
%defattr(-,root,root)
%_libdir/libsgutils2.so.2*
%_libdir/libsgutils2-1.*.so.2*
%files -n libsgutils-devel
%defattr(-,root,root)

25
sgut-libversioning.diff Normal file
View File

@ -0,0 +1,25 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2015-02-13 15:29:13.225224047 +0100
build: use unique SONAME for libsgutils
sg3_utils has added functions between (for example) 1.36 and 1.39
without tracking them (either by using a different SONAME,
or using ELF symbol versions).
---
lib/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: sg3_utils-1.40/lib/Makefile.am
===================================================================
--- sg3_utils-1.40.orig/lib/Makefile.am
+++ sg3_utils-1.40/lib/Makefile.am
@@ -47,7 +47,7 @@ AM_CFLAGS = -iquote ../include -D_LARGEF
lib_LTLIBRARIES = libsgutils2.la
-libsgutils2_la_LDFLAGS = -version-info 2:0:0
+libsgutils2_la_LDFLAGS = -version-info 2:0:0 -release ${PACKAGE_VERSION}
libsgutils2_la_LIBADD = @GETOPT_O_FILES@ @os_libs@
libsgutils2_la_DEPENDENCIES = @GETOPT_O_FILES@