Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package sg3_utils for openSUSE:Factory 
checked in at 2026-06-17 16:16:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/sg3_utils (Old)
 and      /work/SRC/openSUSE:Factory/.sg3_utils.new.1981 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "sg3_utils"

Wed Jun 17 16:16:49 2026 rev:70 rq:1359746 version:1.48+35.c49e7c08

Changes:
--------
--- /work/SRC/openSUSE:Factory/sg3_utils/sg3_utils.changes      2026-03-12 
22:21:53.285319168 +0100
+++ /work/SRC/openSUSE:Factory/.sg3_utils.new.1981/sg3_utils.changes    
2026-06-17 16:17:18.128509693 +0200
@@ -1,0 +2,37 @@
+Mon Jun 15 12:07:50 UTC 2026 - Martin Wilck <[email protected]>
+
+- Update to version 1.48+35.c49e7c08:
+  * configure.ac: reset version to 1.48
+
+-------------------------------------------------------------------
+Fri Jun 12 18:11:03 UTC 2026 - Martin Wilck <[email protected]>
+
+- Update to version 1.48+34.3c93ead5
+
+- sg_inq: --export output conformance for SCSI name string and ATA fields 
(github: PR #83)
+  (bsc#1267823, gh#doug-gilbert/sg3_utils#83)
+
+- Upstream fixes backported (bsc#1268201):
+
+  * sg_logs: correct tape Device statisitics lpage [0x14] serial number 
parameters [0x40 and 0x41] per 
https://github.com/doug-gilbert/sg3_utils/issues/45
+  * sg_wr_mode: fix --contents and --cfile= handling; 
https://github.com/doug-gilbert/sg3_utils/issues/40
+  * rescan-scsi-bus.sh: github issue #76 a few shellcheck fixes; 
scsi_logging_level: add MIT license Xose Vazquez Perez; sg_ses: restore some 
help text, github PR #79 Paul Evans
+  * sg_ses: re-add help description lost in v1.48 restructure
+  * utils/hxascdmp: sprintf --> snprintf [From: orbisai0security 
<[email protected]>]
+  * rescan-scsi-bus.sh: fix broken command existence checks for dmsetup and 
multipath
+  * rescan-scsi-bus.sh: quote $id_serial in findmultipath call
+  * sg_copy_results: bound device-reported sense data length to buffer size
+  * sg_xcopy: fix undefined behaviour and out-of-bounds read
+  * sginfo: set MODE SENSE(10) response length to buffer size
+  * sg_vpd_vendor: fix buffer overflows from device-controlled data
+  * rescan-scsi-bus.sh: Immediately check removable in testonline()
+  * rescan-scsi-bus.sh Replace 'which' with build in 'command -v'
+  * rescan-scsi-bus.sh Correctly read RMB bit on enquiry
+  * sg_ses: fixed AES EI validation when EIIOE=1
+  * sg_logs: Fix parameter lengths in show_data_compression_page
+  * configure.ac: Fix the getrandom() test
+  * [PATCH 2/2] ci: Use the latest version of the Android NDK
+  * [PATCH 1/2] Unbreak the Android build
+  * sg_inq: fix indentation in std_inq_decode sgj_pr_hr strings (match main)
+
+-------------------------------------------------------------------

Old:
----
  sg3_utils-1.48+13.54da4276.obscpio

New:
----
  sg3_utils-1.48+35.c49e7c08.obscpio

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

Other differences:
------------------
++++++ sg3_utils.spec ++++++
--- /var/tmp/diff_new_pack.yIHxEb/_old  2026-06-17 16:17:21.008630224 +0200
+++ /var/tmp/diff_new_pack.yIHxEb/_new  2026-06-17 16:17:21.028631061 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           sg3_utils
-Version:        1.48+13.54da4276
+Version:        1.48+35.c49e7c08
 %global lname libsgutils2-%(echo %{version} | sed 's/[~+].*//;y/./_/')-2
 Release:        0
 Summary:        A collection of tools that send SCSI commands to devices

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.yIHxEb/_old  2026-06-17 16:17:21.332643784 +0200
+++ /var/tmp/diff_new_pack.yIHxEb/_new  2026-06-17 16:17:21.360644956 +0200
@@ -1,5 +1,5 @@
-mtime: 1773165100
-commit: aedb9de3b62703852e206dea4d2bcc8633b12e6a44d6ca7d7cc743fc72c437ea
+mtime: 1781525361
+commit: 511b83017035ad16e05c24e1b78b591c739ce227d833185c30a5af9661fd4335
 url: https://src.opensuse.org/mwilck/sg3_utils
 revision: factory
 

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.yIHxEb/_old  2026-06-17 16:17:21.604655168 +0200
+++ /var/tmp/diff_new_pack.yIHxEb/_new  2026-06-17 16:17:21.628656172 +0200
@@ -5,6 +5,6 @@
                 <param 
name="url">https://github.com/doug-gilbert/sg3_utils</param>
               <param 
name="changesrevision">ed556a52933d29309849dbb24ba49f8b829c1058</param></service><service
 name="tar_scm">
                 <param name="url">https://github.com/openSUSE/sg3_utils</param>
-              <param 
name="changesrevision">54da42762f2f8cc015075772686b450b52a150e8</param></service></servicedata>
+              <param 
name="changesrevision">c49e7c0865af4d4cbb3715a6d2a2e10942a37e0c</param></service></servicedata>
 (No newline at EOF)
 

++++++ build.specials.obscpio ++++++

++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore      1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore      2026-06-15 14:09:21.000000000 +0200
@@ -0,0 +1,6 @@
+*.osc
+_build.*
+.pbuild
+*~
+\#*
+sg3_utils/

++++++ sg3_utils-1.48+13.54da4276.obscpio -> sg3_utils-1.48+35.c49e7c08.obscpio 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/.github/workflows/ci.yml 
new/sg3_utils-1.48+35.c49e7c08/.github/workflows/ci.yml
--- old/sg3_utils-1.48+13.54da4276/.github/workflows/ci.yml     2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/.github/workflows/ci.yml     2026-06-15 
14:03:02.000000000 +0200
@@ -12,7 +12,8 @@
       fail-fast: false
       matrix:
         build:
-        - android
+        - android-23
+        - android-33
         - linux-gcc
         - linux-clang
         - linux-x86-gcc
@@ -20,9 +21,12 @@
         - linux-mingw64-gcc
         - macos
         include:
-        - build: android
+        - build: android-23
           cc: clang
-          host: aarch64-linux-android32
+          host: aarch64-linux-android23
+        - build: android-33
+          cc: clang
+          host: aarch64-linux-android33
         - build: linux-gcc
           cc: gcc
         - build: linux-clang
@@ -43,10 +47,11 @@
       - uses: actions/checkout@v3
       - name: Install Android NDK
         run: |
-          if [ ${{matrix.build}} = android ]; then \
-              wget --quiet 
https://dl.google.com/android/repository/android-ndk-r24-linux.zip; \
-              unzip -q android-ndk-r24-linux.zip;  \
-          fi
+          case ${{matrix.build}} \
+          in android*) \
+              wget --quiet 
https://dl.google.com/android/repository/android-ndk-r25c-linux.zip; \
+              unzip -q android-ndk-r25c-linux.zip;;  \
+          esac
       - name: Install Ubuntu packages
         run: |
           sudo apt-get -q update
@@ -60,7 +65,7 @@
       - name: Build
         run: |
           echo "HOST=${{matrix.host}}"
-          NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin
+          NDK=$PWD/android-ndk-r25c/toolchains/llvm/prebuilt/linux-x86_64/bin
           export PATH="$NDK:$PATH"
           ./autogen.sh
           ./configure --host=${{matrix.host}} \
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/BSD_LICENSE 
new/sg3_utils-1.48+35.c49e7c08/BSD_LICENSE
--- old/sg3_utils-1.48+13.54da4276/BSD_LICENSE  2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/BSD_LICENSE  2026-06-15 14:03:02.000000000 
+0200
@@ -1,5 +1,5 @@
 
-Copyright (c) 1999-2022, Douglas Gilbert
+Copyright (c) 1999-2023, Douglas Gilbert
 All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/CREDITS 
new/sg3_utils-1.48+35.c49e7c08/CREDITS
--- old/sg3_utils-1.48+13.54da4276/CREDITS      2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/CREDITS      2026-06-15 14:03:02.000000000 
+0200
@@ -128,6 +128,9 @@
 Pat LaVarre <p.lavarre at ieee dot org> pointed out danger of negative bpt
         values in sg_dd (and friends); also problems when reading /dev/null
 
+Paul Evans <pevans at redhat dot com> multiple fixes for rescan-scsi-bus.sh
+        and sg_ses [20260526]
+
 Peter Allworth <linsol at zeta dot org dot au> original dd clone design used
         by sg3_utils's dd variants (e.g. sg_dd).
 
@@ -159,8 +162,8 @@
         data and "-6" switch for sg_modes
 
 Xose Vazquez Perez <xose dot vazquez at gmail dot com>
-        documentation corrections [20200117]
+        documentation corrections [20200117] rescan-scsi-bus.sh [20260526]
 
 
 Douglas Gilbert
-10th January 2023
+26 May 2026
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/ChangeLog 
new/sg3_utils-1.48+35.c49e7c08/ChangeLog
--- old/sg3_utils-1.48+13.54da4276/ChangeLog    2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/ChangeLog    2026-06-15 14:03:02.000000000 
+0200
@@ -3,6 +3,18 @@
 directory have their own "man" pages. There is also a sg3_utils man page.
 
 Changelog for openSUSE (post 1.48)
+  - sg_logs: correct tape Device statisitics lpage [0x14]
+    serial number parameters [0x40 and 0x41] per
+    https://github.com/doug-gilbert/sg3_utils/issues/45
+  - sg_wr_mode: fix --contents and --cfile= handling
+    https://github.com/doug-gilbert/sg3_utils/issues/40
+  - sg_inq: --export conformance for SCSI name string and ATA fields, github 
PR #83
+  - rescan-scsi-bus.sh: github issue #76 shellcheck fixes Xose Vazquez Perez
+  - scsi_logging_level: add MIT license Xose Vazquez Perez
+  - sg_ses: restore some help text, github PR #79 Paul Evans
+  - utils/hxascdmp: sprint -> snprintf [github PR #78]
+  - apply https://github.com/doug-gilbert/sg3_utils/pull/39
+    and its revision [20230807] mainly for Android
   - rescan-scsi-bus.sh: fix multipath resize without update
   - rescan-scsi-bus.sh: remove /tmp/rescan-scsi-mpath-info.txt
   - avoid root FS going read-only with
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/configure.ac 
new/sg3_utils-1.48+35.c49e7c08/configure.ac
--- old/sg3_utils-1.48+13.54da4276/configure.ac 2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/configure.ac 2026-06-15 14:03:02.000000000 
+0200
@@ -61,7 +61,20 @@
 AC_DEFINE_UNQUOTED(SG_LIB_BUILD_HOST, "${host}", [sg3_utils Build Host])
 
 check_for_getrandom() {
-       AC_CHECK_HEADERS([sys/random.h], [AC_DEFINE_UNQUOTED(HAVE_GETRANDOM, 1, 
[Found sys/random.h])], [], [])
+       AC_CHECK_HEADERS([sys/random.h])
+       AC_MSG_CHECKING([for getrandom()])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#ifdef HAVE_SYS_RANDOM_H
+#include <sys/random.h>
+#endif
+]], [[
+char buf[16];
+return getrandom(buf, sizeof(buf), 0);
+]])], [
+               AC_MSG_RESULT(yes)
+               AC_DEFINE_UNQUOTED(HAVE_GETRANDOM, 1, [Define to 1 if you have 
the `getrandom' function])], [
+               AC_MSG_RESULT(no)
+               ])
 }
 
 check_for_linux_nvme_headers() {
@@ -87,13 +100,31 @@
                [AC_DEFINE_UNQUOTED(HAVE_LINUX_SG_V4_HDR, 1, [Have Linux sg v4 
header]) ])
 }
 
+check_for___u64() {
+       AC_MSG_CHECKING([for __u64])
+       AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+       #ifdef HAVE_LINUX_TYPES_H
+       #include <linux/types.h>
+       #endif
+       ]],[[
+       __u64 var = 0;
+       return var;
+       ]])],
+       [
+       AC_MSG_RESULT(yes)
+       AC_DEFINE(HAVE___U64, 1, [__u64 is defined in <linux/types.h>])
+       ],
+       [AC_MSG_RESULT(no)])
+}
+
 case "${host}" in
        *-*-android*)
                AC_DEFINE_UNQUOTED(SG_LIB_ANDROID, 1, [sg3_utils on android])
                AC_DEFINE_UNQUOTED(SG_LIB_LINUX, 1, [sg3_utils on linux])
                check_for_linux_sg_v4_hdr
                check_for_getrandom
-               check_for_linux_nvme_headers;;
+               check_for_linux_nvme_headers
+               check_for___u64;;
         *-*-freebsd*|*-*-kfreebsd*-gnu*)
                AC_DEFINE_UNQUOTED(SG_LIB_FREEBSD, 1, [sg3_utils on FreeBSD])
                AC_DEFINE_UNQUOTED(HAVE_NVME, 1, [Found NVMe])
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/debian/changelog 
new/sg3_utils-1.48+35.c49e7c08/debian/changelog
--- old/sg3_utils-1.48+13.54da4276/debian/changelog     2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/debian/changelog     2026-06-15 
14:03:02.000000000 +0200
@@ -1,3 +1,9 @@
+sg3-utils (1.49-0.1) unstable; urgency=low
+
+  * New upstream version
+
+ -- Douglas Gilbert <[email protected]>  Thu, 26 Oct 2023 19:00:00 -0400
+
 sg3-utils (1.48-0.1) unstable; urgency=low
 
   * New upstream version
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/doc/sg3_utils.8 
new/sg3_utils-1.48+35.c49e7c08/doc/sg3_utils.8
--- old/sg3_utils-1.48+13.54da4276/doc/sg3_utils.8      2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/doc/sg3_utils.8      2026-06-15 
14:03:02.000000000 +0200
@@ -1,4 +1,4 @@
-.TH SG3_UTILS "8" "August 2023" "sg3_utils\-1.48" SG3_UTILS
+.TH SG3_UTILS "8" "August 2023" "sg3_utils\-1.49" SG3_UTILS
 .SH NAME
 sg3_utils \- a package of utilities for sending SCSI commands
 .SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sg3_utils-1.48+13.54da4276/include/sg_pt_linux_missing.h 
new/sg3_utils-1.48+35.c49e7c08/include/sg_pt_linux_missing.h
--- old/sg3_utils-1.48+13.54da4276/include/sg_pt_linux_missing.h        
2026-03-10 18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/include/sg_pt_linux_missing.h        
2026-06-15 14:03:02.000000000 +0200
@@ -24,6 +24,7 @@
 extern "C" {
 #endif
 
+#ifndef HAVE___U64
 /* typedefs if linux/types.h header not available */
 
 typedef uint64_t __u64;
@@ -32,6 +33,7 @@
 typedef int32_t __s32;
 typedef uint16_t __u16;
 typedef int16_t __s16;
+#endif
 
 
 /* Following if linux/major.h header is not available */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/inhex/tst_script.sh 
new/sg3_utils-1.48+35.c49e7c08/inhex/tst_script.sh
--- old/sg3_utils-1.48+13.54da4276/inhex/tst_script.sh  2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/inhex/tst_script.sh  2026-06-15 
14:03:02.000000000 +0200
@@ -89,5 +89,19 @@
 
 sg_z_act_query --inhex=z_act_query.hex
 
+echo ""
+echo ">>>>>>>>>>>>>>>> sg_inq --export udev encoding conformance test"
+# VPD 0x83 designator type 8 (SCSI name string) udev encoding conformance
+# test. The --export output must be in conformance with other udev character
+# encoding rules.
+export_output=$(sg_inq --export --inhex=vpd_di_name_inject.hex 2>/dev/null)
+export_lines=$(echo "$export_output" | wc -l)
+if [ "$export_lines" -eq 1 ] && echo "$export_output" | grep -q '\\x0a'; then
+    echo "PASS: SCSI name string is udev conformed character encoding 
($export_lines line)"
+else
+    echo "FAIL: expected udev conformance, instead got $export_lines line(s):"
+    echo "$export_output"
+fi
+
 # D. Gilbert, last updated 20230420
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sg3_utils-1.48+13.54da4276/inhex/vpd_di_name_inject.hex 
new/sg3_utils-1.48+35.c49e7c08/inhex/vpd_di_name_inject.hex
--- old/sg3_utils-1.48+13.54da4276/inhex/vpd_di_name_inject.hex 1970-01-01 
01:00:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/inhex/vpd_di_name_inject.hex 2026-06-15 
14:03:02.000000000 +0200
@@ -0,0 +1,18 @@
+#
+# VPD page 0x83 with a SCSI name string (designator type 8) testing
+# udev udev-conforming character encoding.
+#
+# Used to test that sg_inq --export conforms as expected.
+#
+# Identifier: iqn.2026-05.sg3\nX_SG3_PROBE=1
+#
+# An example invocation:
+#    sg_inq --export --inhex=vpd_di_name_inject.hex --raw
+
+00 83 00 24
+
+# SCSI name string designator (type 8, code set 3 UTF-8, association 0 LUN)
+# descriptor header: code_set=3, assoc=0, desig_type=8, length=0x1d
+03 08 00 1d
+69 71 6e 2e 32 30 32 36  2d 30 35 2e 73 67 33 0a
+58 5f 53 47 33 5f 50 52  4f 42 45 3d 31 00 00 00
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/scripts/README 
new/sg3_utils-1.48+35.c49e7c08/scripts/README
--- old/sg3_utils-1.48+13.54da4276/scripts/README       2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/scripts/README       2026-06-15 
14:03:02.000000000 +0200
@@ -7,7 +7,8 @@
 package utilities are on the PATH of the user.
 
 rescan-scsi-bus.sh is written by Kurt Garloff (formerly from Suse Labs)
-with patches from Hannes Reinecke (Suse) and Redhat.
+with patches from Hannes Reinecke (Suse) and Redhat. There have also
+been patches from Paul Evans and Xose Vazquez Perez.
 
 scsi_logging_level is written by Andreas Herrmann <aherrman at de dot ibm
 dot com>. It sets the logging level of the SCSI subsystem in the Linux
@@ -52,4 +53,4 @@
 /dev/disk/by-id/wwn-0x5001501234567890-part1.
 
 Douglas Gilbert
-4th October 2021
+26th May 2026
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sg3_utils-1.48+13.54da4276/scripts/rescan-scsi-bus.sh 
new/sg3_utils-1.48+35.c49e7c08/scripts/rescan-scsi-bus.sh
--- old/sg3_utils-1.48+13.54da4276/scripts/rescan-scsi-bus.sh   2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/scripts/rescan-scsi-bus.sh   2026-06-15 
14:03:02.000000000 +0200
@@ -4,7 +4,7 @@
 # (c) 2006--2022 Hannes Reinecke, GNU GPL v2 or later
 # $Id: rescan-scsi-bus.sh,v 1.57 2012/03/31 14:08:48 garloff Exp $
 
-VERSION="20230413"
+VERSION="20260526"
 SCAN_WILD_CARD=4294967295
 
 # Only use standard PATH
@@ -265,9 +265,10 @@
 
   p=/sys/class/scsi_device/${host}:${channel}:${id}:${lun}/device/inquiry
   # Extract the second byte of the INQUIRY response and check bit 7 (mask 
0x80).
-  b=$(hexdump -n1 -e '/1 "%02X"' "$p" 2>/dev/null)
+  b=$(od -j1 -N1 -An -t x1 "$p" 2>/dev/null)
   if [ -n "$b" ]; then
-    echo $(((0x$b & 0x80) != 0))
+    # Handle od leading space with parameter substitution.
+    echo $(((0x${b// /} & 0x80) != 0))
   else
     sg_inq "$sg_len_arg" /dev/$SGDEV 2>/dev/null | sed -n 
's/^.*RMB=\([0-9]*\).*$/\1/p'
   fi
@@ -295,7 +296,15 @@
   RC=$?
 
   # Handle in progress of becoming ready and unit attention
-  while [ $RC = 2 -o $RC = 6 ] && [ $ctr -lt $timeout ] ; do
+  # In bash || and && have the same precedence so following while evaluated 
left to right
+  while [ $RC = 2 ] || [ $RC = 6 ] && [ $ctr -lt $timeout ] ; do
+    # Check immediately for removable devices; TEST UNIT READY obviously will
+    # fail for a removable device with no medium
+    RMB=$(is_removable)
+    print_and_scroll_back "$host:$channel:$id:$lun $SGDEV ($RMB) "
+    [ $RC = 2 ] && [ "$RMB" = "1" ] && break
+
+    # Check non-removable devices second
     if [ $RC = 2 ] && [ "$RMB" != "1" ] && sg_inq "$sg_len_arg" /dev/$SGDEV | 
grep -q -i "PQual=0" ; then
       echo -n "."
       let LN+=1
@@ -306,11 +315,6 @@
     let ctr+=1
     sg_turs "$sg_turs_opt" /dev/$SGDEV >/dev/null 2>&1
     RC=$?
-    # Check for removable device; TEST UNIT READY obviously will
-    # fail for a removable device with no medium
-    RMB=$(is_removable)
-    print_and_scroll_back "$host:$channel:$id:$lun $SGDEV ($RMB) "
-    [ $RC = 2 ] && [ "$RMB" = "1" ] && break
   done
   if [ $ctr != 0 ] ; then
     white_out
@@ -486,7 +490,7 @@
     # Loop for up to 60 seconds if sd devices still are settling..
     # This allows us to continue if udev events are stuck on multipaths in 
recovery mode
     while [ $tmo -gt 0 ] ; do
-      if ! "$UDEVADM" settle --timeout=1 | grep -E -q sd[a-z]+ ; then
+      if ! "$UDEVADM" settle --timeout=1 | grep -E -q 'sd[a-z]+' ; then
         break;
       fi
       let tmo=$tmo-1
@@ -547,7 +551,7 @@
   fi
 
   : f "$remove" s $SCSISTR
-  if [ "$remove" ] && [ "$SCSISTR" -o "$remappedlun0" = "1" ] ; then
+  if [ "$remove" ] && ( [ "$SCSISTR" ] || [ "$remappedlun0" = "1" ] ) ; then
     if [ $RC != 0 ] || [ ! -z "$forceremove" ] || [ -n "$remappedlun0" ] ; then
       if [ "$remappedlun0" != "1" ] ; then
         echo -en "\r\e[A\e[A\e[A${red}REM: "
@@ -813,7 +817,8 @@
       echo "softlink /dev/mapper/${mp} not available."
       continue
     fi
-    local ret=$(readlink /dev/mapper/$mp 2>/dev/null)
+    local ret=
+    ret=$(readlink /dev/mapper/$mp 2>/dev/null)
     if [[ $? -ne 0 || -z "$ret" ]]; then
       echo "readlink /dev/mapper/$mp failed. check multipath status."
       continue
@@ -872,7 +877,7 @@
     # If udev events updated the disks already, but the multipath device isn't 
update
     # check for old devices to make sure we found remapped luns
     if [ -n "$mp_enable" ] && [ $remapped -eq 0 ]; then
-      findmultipath "$sddev" $id_serial
+      findmultipath "$sddev" "$id_serial"
       if [ $? -eq 1 ] ; then
         remapped=1
       fi
@@ -1140,13 +1145,13 @@
   if [ -n "$mp_enable" ] && [ -n "$mpaths" ] ; then
     i=0
     for m in $mpaths ; do
-      mpathsizes[$i]="$($MULTIPATH -l "$m" | grep -E -o [0-9]+.[0-9]+[KMGT])"
+      mpathsizes[$i]="$($MULTIPATH -l "$m" | grep -E -o '[0-9]+.[0-9]+[KMGT]')"
       let i=$i+1
     done
     resizempaths
     i=0
     for m in $mpaths ; do
-      mpathsize="$($MULTIPATH -l "$m" | grep -E -o [0-9\.]+[KMGT])"
+      mpathsize="$($MULTIPATH -l "$m" | grep -E -o '[0-9\.]+[KMGT]')"
       echo "$m ${mpathsizes[$i]} => $mpathsize"
       let i=$i+1
     done
@@ -1359,9 +1364,9 @@
     unset OLD_SCANFLAGS
   fi
 fi
-DMSETUP=$(which dmsetup)
+DMSETUP=$(command -v dmsetup)
 [ -z "$DMSETUP" ] && flush= && mp_enable=
-MULTIPATH=$(which multipath)
+MULTIPATH=$(command -v multipath)
 [ -z "$MULTIPATH" ] && flush= && mp_enable=
 
 echo -n "Scanning SCSI subsystem for new devices"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/sg3_utils-1.48+13.54da4276/scripts/scsi_logging_level 
new/sg3_utils-1.48+35.c49e7c08/scripts/scsi_logging_level
--- old/sg3_utils-1.48+13.54da4276/scripts/scsi_logging_level   2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/scripts/scsi_logging_level   2026-06-15 
14:03:02.000000000 +0200
@@ -1,13 +1,14 @@
-#! /bin/bash
-###############################################################################
-# Conveniently create and set scsi logging level, show SCSI_LOG fields in human
-# readable form.
+#!/bin/bash
 #
-# (C) Copyright IBM Corp. 2006
+# scsi_logging_level - Conveniently create and set scsi logging level,
+#                      show SCSI_LOG fields in human readable form
+#
+# Copyright IBM Corp. 2006, 2017
+#
+# You can redistribute it and/or modify it under the terms of the MIT license.
 #
 # Modified by D. Gilbert to replace the use of sysctl [20080218]
-# Lat change: D. Gilbert 20150219
-###############################################################################
+# Last change: D. Gilbert 20260526 add MIT license
 
 
 REVISION="1.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/sg3_utils.spec 
new/sg3_utils-1.48+35.c49e7c08/sg3_utils.spec
--- old/sg3_utils-1.48+13.54da4276/sg3_utils.spec       2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/sg3_utils.spec       2026-06-15 
14:03:02.000000000 +0200
@@ -1,6 +1,6 @@
 Summary: Utilities for devices that use SCSI command sets
 Name: sg3_utils
-Version: 1.48
+Version: 1.49
 # Release: 1%{?dist}
 Release: 1
 License: GPL
@@ -84,6 +84,10 @@
 %{_libdir}/*.a
 
 %changelog
+* Thu Oct 26 2023 - dgilbert at interlog dot com
+- track t10 changes
+  * sg3_utils-1.49
+
 * Tue Aug 01 2023 - dgilbert at interlog dot com
 - track t10 changes
   * sg3_utils-1.48
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_copy_results.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_copy_results.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_copy_results.c        2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_copy_results.c        2026-06-15 
14:03:02.000000000 +0200
@@ -126,8 +126,14 @@
         return;
     }
     printf("Receive copy results (failed segment details):\n");
+    if (rcBuffLen < 60) {
+        pr2serr("  <<not enough buffer for sense data>>\n");
+        return;
+    }
     printf("    Extended copy command status: %d\n", rcBuff[56]);
     senseLen = sg_get_unaligned_be16(rcBuff + 58);
+    if (senseLen > (int)(rcBuffLen - 60))
+        senseLen = (int)(rcBuffLen - 60);
     sg_get_sense_str("    ", &rcBuff[60], senseLen, 0, 1024, senseBuff);
     printf("%s", senseBuff);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_inq.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_inq.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_inq.c 2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_inq.c 2026-06-15 14:03:02.000000000 
+0200
@@ -1919,8 +1919,17 @@
                 }
                 printf("\n");
                 if (!memcmp(ip, "ATA_", 4)) {
-                    printf("SCSI_IDENT_%s_ATA=%.*s\n", assoc_str,
-                           k - 4, ip + 4);
+                    printf("SCSI_IDENT_%s_ATA=", assoc_str);
+                    for (m = 4; m < k; ++m) {
+                        if ((ip[m] >= '0' && ip[m] <= '9') ||
+                            (ip[m] >= 'A' && ip[m] <= 'Z') ||
+                            (ip[m] >= 'a' && ip[m] <= 'z') ||
+                            strchr("#+-.:=@_", ip[m]) != NULL)
+                            printf("%c", ip[m]);
+                        else
+                            printf("\\x%02x", ip[m]);
+                    }
+                    printf("\n");
                 }
             } else {
                 for (m = 0; m < i_len; ++m)
@@ -2043,8 +2052,17 @@
                 break;
             }
 
-            printf("SCSI_IDENT_%s_NAME=%.*s\n", assoc_str, i_len,
-                   (const char *)ip);
+            printf("SCSI_IDENT_%s_NAME=", assoc_str);
+            for (m = 0; m < i_len; ++m) {
+                if ((ip[m] >= '0' && ip[m] <= '9') ||
+                    (ip[m] >= 'A' && ip[m] <= 'Z') ||
+                    (ip[m] >= 'a' && ip[m] <= 'z') ||
+                    strchr("#+-.:=@_", ip[m]) != NULL)
+                    printf("%c", ip[m]);
+                else
+                    printf("\\x%02x", ip[m]);
+            }
+            printf("\n");
             break;
         case 9: /*  Protocol specific port identifier */
             if (TPROTO_UAS == p_id) {
@@ -2356,10 +2374,10 @@
                 printf("SCSI_VENDOR_ENC=%s\n", xtra_buff);
             }
         } else
-            sgj_pr_hr(jsp, " Vendor identification: %s\n", xtra_buff);
+            sgj_pr_hr(jsp, "  Vendor identification: %s\n", xtra_buff);
         if (len <= 16) {
             if (! op->do_export)
-                sgj_pr_hr(jsp, " Product identification: <none>\n");
+                sgj_pr_hr(jsp, "  Product identification: <none>\n");
         } else {
             memcpy(xtra_buff, &rp[16], 16);
             xtra_buff[16] = '\0';
@@ -2371,11 +2389,11 @@
                     printf("SCSI_MODEL_ENC=%s\n", xtra_buff);
                 }
             } else
-                sgj_pr_hr(jsp, " Product identification: %s\n", xtra_buff);
+                sgj_pr_hr(jsp, "  Product identification: %s\n", xtra_buff);
         }
         if (len <= 32) {
             if (! op->do_export)
-                sgj_pr_hr(jsp, " Product revision level: <none>\n");
+                sgj_pr_hr(jsp, "  Product revision level: <none>\n");
         } else {
             memcpy(xtra_buff, &rp[32], 4);
             xtra_buff[4] = '\0';
@@ -2384,7 +2402,7 @@
                 if (rlen > 0)
                     printf("SCSI_REVISION=%s\n", xtra_buff);
             } else
-                sgj_pr_hr(jsp, " Product revision level: %s\n", xtra_buff);
+                sgj_pr_hr(jsp, "  Product revision level: %s\n", xtra_buff);
         }
         if (op->do_vendor && (len > 36) && ('\0' != rp[36]) &&
             (' ' != rp[36])) {
@@ -2394,7 +2412,7 @@
                 if (vlen > 0)
                     printf("VENDOR_SPECIFIC=%s\n", xtra_buff);
             } else
-                sgj_pr_hr(jsp, " Vendor specific: %s\n", xtra_buff);
+                sgj_pr_hr(jsp, "  Vendor specific: %s\n", xtra_buff);
         }
         if (op->do_descriptors) {
             for (j = 0, k = 58; ((j < 8) && ((k + 1) < len));
@@ -2409,7 +2427,7 @@
                 if (vlen > 0)
                     printf("VENDOR_SPECIFIC=%s\n", xtra_buff);
             } else
-                sgj_pr_hr(jsp, " Vendor specific: %s\n", xtra_buff);
+                sgj_pr_hr(jsp, "  Vendor specific: %s\n", xtra_buff);
         }
         if (op->do_vendor && (len > 243) &&
             (0 == strncmp("OPEN-V", (const char *)&rp[16], 6))) {
@@ -2419,7 +2437,7 @@
                 if (vlen > 0)
                     printf("VENDOR_SPECIFIC_OPEN-V_LDEV_NAME=%s\n", xtra_buff);
             } else
-                sgj_pr_hr(jsp, " Vendor specific OPEN-V LDEV Name: %s\n",
+                sgj_pr_hr(jsp, "  Vendor specific OPEN-V LDEV Name: %s\n",
                           xtra_buff);
         }
     }
@@ -2429,7 +2447,7 @@
         if (as_json)
             jo2p = std_inq_decode_js(rp, len, op, jop);
         if ((0 == op->maxlen) && usn_buff[0])
-            sgj_pr_hr(jsp, " Unit serial number: %s\n", usn_buff);
+            sgj_pr_hr(jsp, "  Unit serial number: %s\n", usn_buff);
         if (op->do_descriptors) {
             sgj_opaque_p jap = sgj_named_subarray_r(jsp, jo2p,
                                                 "version_descriptor_list");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_logs.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_logs.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_logs.c        2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_logs.c        2026-06-15 
14:03:02.000000000 +0200
@@ -40,7 +40,7 @@
 
 #include "sg_logs.h"
 
-static const char * version_str = "2.35 20230622";    /* spc6r08 + sbc5r04 */
+static const char * version_str = "2.37 20231026";    /* spc6r10 + sbc5r05 */
 
 #define MY_NAME "sg_logs"
 
@@ -7888,7 +7888,7 @@
     return true;
 }
 
-/* Device statistics 0x14 <ds> for tape and ADC */
+/* DEVICE_STATS_LPAGE [0x14] Device statistics lpage for tape and ADC */
 static bool
 show_device_stats_page(const uint8_t * resp, int len,
                        struct opts_t * op, sgj_opaque_p jop)
@@ -7908,6 +7908,7 @@
     char b[196];
     static const int blen = sizeof(b);
     static const char * const ds_lp = "Device statistics log page";
+    static const char * const sn_sn = "serial_number";
 
     if (op->verbose || ((0 == op->do_raw) &&
         ((0 == op->do_hex) || (op->do_hex > 3)))) {
@@ -8036,10 +8037,22 @@
                        "sample time";
                 break;
             case 0x40:
+                vl_num = false;
                 ccp = "Drive manufacturer's serial number";
+                sgj_pr_hr(jsp, "  %s: %.*s\n", ccp, pl - 4, bp + 4);
+                if (jsp->pr_as_json) {
+                    sgj_js_nv_ihexstr(jsp, jo3p, param_c_sn, pc, NULL, ccp);
+                    sgj_js_nv_s_len_chk(jsp, jo3p, sn_sn, bp + 4, pl - 4);
+                }
                 break;
             case 0x41:
+                vl_num = false;
                 ccp = "Drive serial number";
+                sgj_pr_hr(jsp, "  %s: %.*s\n", ccp, pl - 4, bp + 4);
+                if (jsp->pr_as_json) {
+                    sgj_js_nv_ihexstr(jsp, jo3p, param_c_sn, pc, NULL, ccp);
+                    sgj_js_nv_s_len_chk(jsp, jo3p, sn_sn, bp + 4, pl - 4);
+                }
                 break;
             case 0x42:          /* added ssc5r02b */
                 vl_num = false;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_logs_vendor.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_logs_vendor.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_logs_vendor.c 2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_logs_vendor.c 2026-06-15 
14:03:02.000000000 +0200
@@ -492,7 +492,7 @@
                 js_pcb(jsp, jo3p, bp[2]);
         }
         /* variable length integer, max length 8 bytes */
-        ull = sg_get_unaligned_be(pl - 4, bp + 4);
+        ull = sg_get_unaligned_be(pl, bp + 4);
         ccp = NULL;
         is_x100 = false;
         is_pr = false;
@@ -536,7 +536,7 @@
         default:
             sgj_pr_hr(jsp, "  unknown %s = 0x%x, contents in hex:\n", param_c,
                       pc);
-            hex2str(bp + 4, pl - 4, "    ", op->h2s_oformat, blen, b);
+            hex2str(bp + 4, pl, "    ", op->h2s_oformat, blen, b);
             sgj_pr_hr(jsp, "%s\n", b);
             is_pr = true;
             break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_ses.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_ses.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_ses.c 2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_ses.c 2026-06-15 14:03:02.000000000 
+0200
@@ -41,7 +41,7 @@
  * commands tailored for SES (enclosure) devices.
  */
 
-static const char * version_str = "2.86 20230623";    /* ses4r04 */
+static const char * version_str = "2.88 20260526";    /* ses4r05 */
 
 #define MY_NAME "sg_ses"
 
@@ -1023,6 +1023,11 @@
         other_usage(true);
         pr2serr("   corresponding shorter form:\n");
         other_usage(false);
+        pr2serr("\nFirst usage above is for fetching pages or fields from "
+            "a SCSI enclosure.\nThe second usage is for changing a page or "
+            "field in an enclosure. For\nmore information use '--help' (or "
+            "'-h'). Use '-hhhh' for examples.\n"
+            );
     } else if (1 == help_num) {
         pr2serr("Usage for general access:\n");
         gen_usage(true);
@@ -1038,6 +1043,8 @@
             "only\n"
             "    --get=STR|-G STR    get value of field by acronym or "
             "position\n"
+            "    --help|-h           print out usage message, use multiple "
+            "times for more\n"
             "    --index=IIA|-I IIA    individual index ('-1' for overall) "
             "or element\n"
             "                          type abbreviation (e.g. 'arr'). A "
@@ -6549,11 +6556,11 @@
                 if (eip && (1 == eiioe)) {         /* EIP and EIIOE=1 */
                     ei = ae_bp[3];
                     jr2p = tesp->j_base + ei;
-                    if ((ei >= tesp->num_j_eoe) ||
+                    if ((ei >= tesp->num_j_rows) ||
                         (NULL == jr2p->enc_statp)) {
-                        pr2serr("%s: oi=%d, ei=%d [num_eoe=%d], eiioe=1 "
+                        pr2serr("%s: oi=%d, ei=%d [num_rows=%d], eiioe=1 "
                                 "not in join_arr\n", __func__, k, ei,
-                                tesp->num_j_eoe);
+                                tesp->num_j_rows);
                         return broken_ei;
                     }
                     devslotnum_and_sasaddr(jr2p, ae_bp);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_vpd_vendor.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_vpd_vendor.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_vpd_vendor.c  2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_vpd_vendor.c  2026-06-15 
14:03:02.000000000 +0200
@@ -330,42 +330,61 @@
     int memsize;
     char name[65];
 
-    if (len < 3) {
+    if (len < 8) {
         pr2serr("Hardware Version VPD page length too short=%d\n", len);
         return;
     }
-    if (buff[4] != 'h' && buff[5] != 'w' && buff[6] != 'r') {
+    if (buff[4] != 'h' || buff[5] != 'w' || buff[6] != 'r') {
         pr2serr("Invalid page identifier %c%c%c%c, decoding not possible.\n",
                 buff[4], buff[5], buff[6], buff[7]);
         return;
     }
-    printf("  Number of channels: %x\n", buff[8]);
-    memsize = sg_get_unaligned_be16(buff + 10);
-    printf("  Processor Memory Size: %d\n", memsize);
-    memset(name, 0, 65);
-    memcpy(name, buff + 16, 64);
-    printf("  Board Name: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 80, 16);
-    printf("  Board Part Number: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 96, 12);
-    printf("  Schematic Number: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 108, 4);
-    printf("  Schematic Revision Number: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 112, 16);
-    printf("  Board Serial Number: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 144, 8);
-    printf("  Date of Manufacture: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 152, 2);
-    printf("  Board Revision: %s\n", name);
-    memset(name, 0, 65);
-    memcpy(name, buff + 154, 4);
-    printf("  Board Identifier: %s\n", name);
+    if (len > 8)
+        printf("  Number of channels: %x\n", buff[8]);
+    if (len > 11) {
+        memsize = sg_get_unaligned_be16(buff + 10);
+        printf("  Processor Memory Size: %d\n", memsize);
+    }
+    if (len >= 80) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 16, 64);
+        printf("  Board Name: %s\n", name);
+    }
+    if (len >= 96) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 80, 16);
+        printf("  Board Part Number: %s\n", name);
+    }
+    if (len >= 108) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 96, 12);
+        printf("  Schematic Number: %s\n", name);
+    }
+    if (len >= 112) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 108, 4);
+        printf("  Schematic Revision Number: %s\n", name);
+    }
+    if (len >= 128) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 112, 16);
+        printf("  Board Serial Number: %s\n", name);
+    }
+    if (len >= 152) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 144, 8);
+        printf("  Date of Manufacture: %s\n", name);
+    }
+    if (len >= 154) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 152, 2);
+        printf("  Board Revision: %s\n", name);
+    }
+    if (len >= 158) {
+        memset(name, 0, 65);
+        memcpy(name, buff + 154, 4);
+        printf("  Board Identifier: %s\n", name);
+    }
 
     return;
 }
@@ -376,11 +395,11 @@
     int i, n, v, r, m, p, d, y, num_part;
     char part[5];
 
-    if (len < 3) {
+    if (len < 14) {
         pr2serr("Firmware Version VPD page length too short=%d\n", len);
         return;
     }
-    if (buff[4] != 'f' && buff[5] != 'w' && buff[6] != 'r') {
+    if (buff[4] != 'f' || buff[5] != 'w' || buff[6] != 'r') {
         pr2serr("Invalid page identifier %c%c%c%c, decoding not possible.\n",
                 buff[4], buff[5], buff[6], buff[7]);
         return;
@@ -526,7 +545,7 @@
     int label_len;
     char uuid[33];
     int uuid_len;
-    uint8_t port_id[128];
+    uint8_t port_id[224]; /* RFC 3720 iSCSI names can be up to 223 bytes */
     int n;
 
     if (len < 0xab) {
@@ -541,11 +560,14 @@
     }
 
     uuid_len = buff[11];
+    if (uuid_len > 16)
+        uuid_len = 16;
 
     for (i = 0, c = uuid; i < uuid_len; i++) {
         sprintf(c,"%02x",buff[12 + i]);
         c += 2;
     }
+    *c = '\0';
 
     printf("  Volume Unique Identifier: %s\n", uuid);
 #ifndef SG_LIB_MINGW
@@ -559,20 +581,27 @@
 #endif
     memset(label, 0, 61);
     label_len = buff[28];
+    if (label_len > (int)sizeof(label))
+        label_len = (int)sizeof(label);
     for(i = 0; i < (label_len - 1); ++i)
         *(label + i) = buff[29 + (2 * i) + 1];
     printf("  Volume User Label: %s\n", label);
 
     uuid_len = buff[89];
+    if (uuid_len > 16)
+        uuid_len = 16;
 
     for (i = 0, c = uuid; i < uuid_len; i++) {
         sprintf(c,"%02x",buff[90 + i]);
         c += 2;
     }
+    *c = '\0';
 
     printf("  Storage Array Unique Identifier: %s\n", uuid);
     memset(label, 0, 61);
     label_len = buff[106];
+    if (label_len > (int)sizeof(label))
+        label_len = (int)sizeof(label);
     for(i = 0; i < (label_len - 1); ++i)
         *(label + i) = buff[107 + (2 * i) + 1];
     printf("  Storage Array User Label: %s\n", label);
@@ -586,7 +615,7 @@
 
     /* Initiator transport ID */
     if ( buff[10] & 0x01 ) {
-        memset(port_id, 0, 128);
+        memset(port_id, 0, sizeof(port_id));
         printf("  Transport Protocol: ");
         switch (buff[175] & 0x0F) {
         case TPROTO_FCP: /* FC */
@@ -602,7 +631,12 @@
         case TPROTO_ISCSI: /* iSCSI */
             printf("iSCSI\n");
             n = sg_get_unaligned_be32(buff + 177);
+            if (n > (int)sizeof(port_id) - 1)
+                n = (int)sizeof(port_id) - 1;
+            if (n > len - 179)
+                n = len - 179;
             memcpy(port_id, &buff[179], n);
+            port_id[n] = '\0';
             n = 179 + n;
             break;
         case TPROTO_SAS: /* SAS */
@@ -616,7 +650,7 @@
 
         printf("  Initiator Port Identifier: %s\n", port_id);
         if ( buff[10] & 0x02 ) {
-            memset(port_id, 0, 128);
+            memset(port_id, 0, sizeof(port_id));
             memcpy(port_id, &buff[n], 8);
             printf("  Supplemental Vendor ID: %s\n", port_id);
         }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_wr_mode.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_wr_mode.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_wr_mode.c     2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_wr_mode.c     2026-06-15 
14:03:02.000000000 +0200
@@ -32,7 +32,7 @@
  * mode page on the given device.
  */
 
-static const char * version_str = "1.30 20230623";
+static const char * version_str = "1.31 20230831";
 
 #define ME "sg_wr_mode: "
 
@@ -374,17 +374,23 @@
         }
     }
     if (cfile_arg || contents_arg) {
+        const char * inp = (cfile_arg ? cfile_arg : contents_arg);
+
         if (cfile_arg && contents_arg) {
             pr2serr("Cannot have both --contents= and --cfile= options\n");
             return SG_LIB_SYNTAX_ERROR;
         }
         memset(read_in, 0, read_in_sz);
-        if ((ret = build_mode_page(optarg, !! cfile_arg, do_raw, read_in,
-                                   &read_in_len, read_in_sz))) {
+        if ((ret = build_mode_page(inp, !! cfile_arg, do_raw,
+                                   read_in, &read_in_len, read_in_sz))) {
             pr2serr("bad argument to '%s'\n", cfile_arg ? "--cfile=" :
                                                           "--contents=");
             return ret;
         }
+        if (verbose > 5) {
+           pr2serr("Decoded contents:\n");
+            hex2stderr(read_in, read_in_len, 1);
+       }
         got_contents = true;
     }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sg_xcopy.c 
new/sg3_utils-1.48+35.c49e7c08/src/sg_xcopy.c
--- old/sg3_utils-1.48+13.54da4276/src/sg_xcopy.c       2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sg_xcopy.c       2026-06-15 
14:03:02.000000000 +0200
@@ -797,15 +797,15 @@
                     1 << rcBuff[38]);
         if (rcBuff[39] > 30)
             pr2serr("    Held data granularity: 2**%u bytes\n",
-                    1 << rcBuff[39]);
+                    rcBuff[39]);
         else
             pr2serr("    Held data granularity: %u bytes\n", 1 << rcBuff[39]);
 
         pr2serr("    Implemented descriptor list:\n");
     }
-    xfp->min_bytes = 1 << rcBuff[37];
+    xfp->min_bytes = (rcBuff[37] < 32) ? 1U << rcBuff[37] : 0;
 
-    for (n = 0; n < rcBuff[43]; n++) {
+    for (n = 0; n < rcBuff[43] && (44 + n) < rcBuffLen; n++) {
         switch(rcBuff[44 + n]) {
         case 0x00: /* copy block to stream device */
             if (!is_target && (ftype & FT_BLOCK))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/src/sginfo.c 
new/sg3_utils-1.48+35.c49e7c08/src/sginfo.c
--- old/sg3_utils-1.48+13.54da4276/src/sginfo.c 2026-03-10 18:43:00.000000000 
+0100
+++ new/sg3_utils-1.48+35.c49e7c08/src/sginfo.c 2026-06-15 14:03:02.000000000 
+0200
@@ -913,6 +913,8 @@
         }
     }
     mpi->resp_len = (resp[0] << 8) + resp[1] + 2;
+    if (mpi->resp_len > MAX_RESP10_SIZE)
+        mpi->resp_len = MAX_RESP10_SIZE;
     if (sngl_fetch) {
         if (trace_cmd > 1) {
             off = modePageOffset(resp, mpi->resp_len, 0);
@@ -1043,6 +1045,8 @@
 
     bdlen = (msense10_resp[6] << 8) + msense10_resp[7];
     resplen = (msense10_resp[0] << 8) + msense10_resp[1] + 2;
+    if (resplen > SIZEOF_BUFFER1)
+        resplen = SIZEOF_BUFFER1;
 
     cmd[0] = SMODE_SELECT_10;
     cmd[1] = 0x10 | (sp_bit ? 1 : 0); /* always set PF bit */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/sg3_utils-1.48+13.54da4276/utils/hxascdmp.c 
new/sg3_utils-1.48+35.c49e7c08/utils/hxascdmp.c
--- old/sg3_utils-1.48+13.54da4276/utils/hxascdmp.c     2026-03-10 
18:43:00.000000000 +0100
+++ new/sg3_utils-1.48+35.c49e7c08/utils/hxascdmp.c     2026-06-15 
14:03:02.000000000 +0200
@@ -24,7 +24,7 @@
 
 static int bytes_per_line = DEF_BYTES_PER_LINE;
 
-static const char * version_str = "1.11 20190527";
+static const char * version_str = "1.13 20260525";
 
 #define CHARS_PER_HEX_BYTE 3
 #define BINARY_START_COL 6
@@ -34,7 +34,7 @@
 #ifdef SG_LIB_MINGW
 /* Non Unix OSes distinguish between text and binary files.
    Set text mode on fd. Does nothing in Unix. Returns negative number on
-   failure. */
+   failure. Note under CygWin and Visual Studio it's _setmode() . */
 int
 sg_set_text_mode(int fd)
 {
@@ -232,7 +232,7 @@
     memset(buff, ' ', line_length);
     buff[line_length] = '\0';
     if (0 == noAddr) {
-        k = sprintf(buff + 1, "%.2lx", a);
+        k = snprintf(buff + 1, sizeof(buff) - 1, "%.2lx", a);
         buff[k + 1] = ' ';
     }
 
@@ -245,7 +245,7 @@
             a += bytes_per_line;
             memset(buff,' ', line_length);
             if (0 == noAddr) {
-                k = sprintf(buff + 1, "%.2lx", a);
+                k = snprintf(buff + 1, sizeof(buff) - 1, "%.2lx", a);
                 buff[k + 1] = ' ';
             }
         }
@@ -253,7 +253,8 @@
         bpos += (nl && noAddr) ?  0 : CHARS_PER_HEX_BYTE;
         if ((bytes_per_line > 4) && ((j % bytes_per_line) == midline_space))
             bpos++;
-        sprintf(&buff[bpos], "%.2x", (int)(unsigned char)c);
+        snprintf(&buff[bpos], sizeof(buff) - bpos, "%.2x",
+                 (int)(unsigned char)c);
         buff[bpos + 2] = ' ';
         if ((c < ' ') || (c >= 0x7f))
             c='.';
@@ -288,7 +289,7 @@
     memset(buff, ' ', line_length);
     buff[line_length] = '\0';
     if (0 == noAddr) {
-        k = sprintf(buff + 1, "%.2lx", a);
+        k = snprintf(buff + 1, sizeof(buff) - 1, "%.2lx", a);
         buff[k + 1] = ' ';
     }
 
@@ -300,7 +301,7 @@
             a += bytes_per_line;
             memset(buff,' ', line_length);
             if (0 == noAddr) {
-                k = sprintf(buff + 1, "%.2lx", a);
+                k = snprintf(buff + 1, sizeof(buff) - 1, "%.2lx", a);
                 buff[k + 1] = ' ';
             }
         }
@@ -308,7 +309,8 @@
         bpos += (nl && noAddr) ? 0 : CHARS_PER_HEX_BYTE;
         if ((bytes_per_line > 4) && ((j % bytes_per_line) == midline_space))
             bpos++;
-        sprintf(&buff[bpos], "%.2x", (int)(unsigned char)c);
+        snprintf(&buff[bpos], sizeof(buff) - bpos, "%.2x",
+                 (int)(unsigned char)c);
         buff[bpos + 2] = ' ';
     }
     if (bpos > bpstart)

++++++ sg3_utils.obsinfo ++++++
--- /var/tmp/diff_new_pack.yIHxEb/_old  2026-06-17 16:17:23.684742218 +0200
+++ /var/tmp/diff_new_pack.yIHxEb/_new  2026-06-17 16:17:23.720743725 +0200
@@ -1,5 +1,5 @@
 name: sg3_utils
-version: 1.48+13.54da4276
-mtime: 1773164580
-commit: 54da42762f2f8cc015075772686b450b52a150e8
+version: 1.48+35.c49e7c08
+mtime: 1781524982
+commit: c49e7c0865af4d4cbb3715a6d2a2e10942a37e0c
 

Reply via email to