Compare commits

...

No commits in common. "c8" and "c9-beta" have entirely different histories.
c8 ... c9-beta

17 changed files with 2231 additions and 1681 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/sg3_utils-1.44.tar.xz
SOURCES/sg3_utils-1.47.tar.xz

View File

@ -1 +1 @@
b00dae1fc53fc4d31202f7a590233d98c1dda4d8 SOURCES/sg3_utils-1.44.tar.xz
4ab889eb273b34fe052977b994e5c6da09b9d3ab SOURCES/sg3_utils-1.47.tar.xz

View File

@ -1,14 +0,0 @@
#
# Blacklist specific USB devices
#
# don't inquire sn and di on broken devices (https://bugzilla.suse.com/show_bug.cgi?id=840054)
ACTION!="add|change", GOTO="usb_blacklist_end"
KERNEL!="sd*[!0-9]|sr*", GOTO="usb_blacklist_end"
# unkown device
ATTRS{idVendor}=="0aec", ATTRS{idProduct}=="3260", ENV{ID_SCSI_INQUIRY}="1"
# Sony/JMicron port replicator
ATTRS{idVendor}=="054c", ATTRS{idProduct}=="06a0", ENV{ID_SCSI_INQUIRY}="1"
LABEL="usb_blacklist_end"

View File

@ -1,17 +0,0 @@
#
# FC WWPN-based by-path links
#
ACTION!="add|change", GOTO="fc_wwpn_end"
KERNEL!="sd*", GOTO="fc_wwpn_end"
ENV{DEVTYPE}=="disk", IMPORT{program}="fc_wwpn_id %p"
ENV{DEVTYPE}=="partition", IMPORT{parent}="FC_*"
ENV{FC_TARGET_WWPN}!="?*", GOTO="fc_wwpn_end"
ENV{FC_INITIATOR_WWPN}!="?*", GOTO="fc_wwpn_end"
ENV{FC_TARGET_LUN}!="?*", GOTO="fc_wwpn_end"
ENV{DEVTYPE}=="disk", SYMLINK+="disk/by-path/fc-$env{FC_INITIATOR_WWPN}-$env{FC_TARGET_WWPN}-lun-$env{FC_TARGET_LUN}"
ENV{DEVTYPE}=="partition", SYMLINK+="disk/by-path/fc-$env{FC_INITIATOR_WWPN}-$env{FC_TARGET_WWPN}-lun-$env{FC_TARGET_LUN}-part%n"
LABEL="fc_wwpn_end"

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
From 37b8af8278bba0b116b579950218f2e610a2ab2b Mon Sep 17 00:00:00 2001
From: jtpittman195 <jpittman@redhat.com>
Date: Fri, 4 Oct 2019 10:58:24 -0400
Subject: [PATCH] fc_wwpn_id: add condition to FC_TARGET_LUN return
If there is no relevant fc_remote_port or fc_host found, there is no need to return the target_lun number. Returning with no condition causes a FC_TARGET_LUN value to be present in the udev database for devices that are not fibre attached. Add condition to check.
---
scripts/fc_wwpn_id | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/scripts/fc_wwpn_id b/scripts/fc_wwpn_id
index c8d0189..b05c5e8 100644
--- a/scripts/fc_wwpn_id
+++ b/scripts/fc_wwpn_id
@@ -38,7 +38,9 @@ while [ -n "$d" ] ; do
esac
done
-echo "FC_TARGET_LUN=$target_lun"
+if [ -n "$rport_wwpn" ] || [ -n "$host_wwpn" ] ; then
+ echo "FC_TARGET_LUN=$target_lun"
+fi
if [ -n "$rport_wwpn" ] ; then
echo "FC_TARGET_WWPN=$rport_wwpn"

View File

@ -0,0 +1,45 @@
From ae6618a9573e7519f6e5c3ea02b7be865dd456d7 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Mon, 17 Jan 2022 13:54:04 +0100
Subject: [PATCH] rescan-scsi-bus: Do not use printf for summary
A string containing escape sequences can only be supplied
to `printf` as the first argument. As there's no format involved
in the summary string, just use `echo -e` to process the escaped
sequences.
Fixes the following phenomenon:
1 new or changed device(s) found.
\t[1:0:0:0]\n0 remapped or resized device(s) found.
0 device(s) removed.
---
scripts/rescan-scsi-bus.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 23eff3b..5d5d63b 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -1384,15 +1384,15 @@ fi
echo "$found new or changed device(s) found. "
if [ ! -z "$FOUNDDEVS" ] ; then
- printf "%s" "$FOUNDDEVS"
+ echo -e "$FOUNDDEVS"
fi
echo "$updated remapped or resized device(s) found."
if [ ! -z "$CHGDEVS" ] ; then
- printf "%s" "$CHGDEVS"
+ echo -e "$CHGDEVS"
fi
echo "$rmvd device(s) removed. "
if [ ! -z "$RMVDDEVS" ] ; then
- printf "%s" "$RMVDDEVS"
+ echo -e "$RMVDDEVS"
fi
# Local Variables:
--
2.34.1

View File

@ -0,0 +1,27 @@
From 80b570a1f890d2912418f7698213dfca40443fa1 Mon Sep 17 00:00:00 2001
From: "Nitin U. Yewale" <nyewale@redhat.com>
Date: Mon, 3 Jan 2022 13:12:12 +0530
Subject: [PATCH] fix crash with rescan-scsi-bus.sh -r
---
scripts/rescan-scsi-bus.sh | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index 46fe6c0..e34ea35 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -307,7 +307,13 @@ testonline ()
IPREV=$(echo "$INQ" | grep 'Product revision level:' | sed 's/^[^:]*: \(.*\)$/\1/')
STR=$(printf " Vendor: %-08s Model: %-16s Rev: %-4s" "$IVEND" "$IPROD" "$IPREV")
IPTYPE=$(echo "$INQ" | sed -n 's/.* Device_type=\([0-9]*\) .*/\1/p')
+ if [ -z "$IPTYPE" ]; then
+ IPTYPE=$(echo "$INQ" | sed -n 's/.* PDT=\([0-9]*\) .*/\1/p')
+ fi
IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) Device.*/\1/p')
+ if [ -z "$IPQUAL" ] ; then
+ IPQUAL=$(echo "$INQ" | sed -n 's/ *PQual=\([0-9]*\) PDT.*/\1/p')
+ fi
if [ "$IPQUAL" != 0 ] ; then
[ -z "$IPQUAL" ] && IPQUAL=3
[ -z "$IPTYPE" ] && IPTYPE=31

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,798 @@
From 20315aa4fae1340e5d4b1faae15b90ee34b9ea50 Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Sat, 20 Nov 2021 17:13:42 +0000
Subject: [PATCH] sg_z_act_query: new utility for sending either a Zone
activate or Zone query command; sg_rep_zones: add Report zone starting LBA
granularity field in REPORT ZONES response [zbc2r12]; sg_decode_sense: add
--nodecode option; initialize all sense buffers to 0; rework main README file
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@923 6180dd3e-e324-4e3e-922d-17de1ae2f315
diff --git a/lib/sg_cmds_basic.c b/lib/sg_cmds_basic.c
index 844018c..e177354 100644
--- a/lib/sg_cmds_basic.c
+++ b/lib/sg_cmds_basic.c
@@ -379,7 +379,7 @@ sg_ll_inquiry_com(struct sg_pt_base * ptvp, int sg_fd, bool cmddt, bool evpd,
bool local_cdb = true;
int res, ret, sense_cat, resid;
uint8_t inq_cdb[INQUIRY_CMDLEN] = {INQUIRY_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
uint8_t * up;
if (resp == NULL) {
@@ -738,7 +738,7 @@ sg_ll_request_sense_com(struct sg_pt_base * ptvp, int sg_fd, bool desc,
static const char * const rq_s = "request sense";
uint8_t rs_cdb[REQUEST_SENSE_CMDLEN] =
{REQUEST_SENSE_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (desc)
rs_cdb[1] |= 0x1;
@@ -837,7 +837,7 @@ sg_ll_report_luns_com(struct sg_pt_base * ptvp, int sg_fd, int select_report,
int ret, res, sense_cat;
uint8_t rl_cdb[REPORT_LUNS_CMDLEN] =
{REPORT_LUNS_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
rl_cdb[2] = select_report & 0xff;
sg_put_unaligned_be32((uint32_t)mx_resp_len, rl_cdb + 6);
diff --git a/lib/sg_cmds_basic2.c b/lib/sg_cmds_basic2.c
index 06bbda6..7772aa4 100644
--- a/lib/sg_cmds_basic2.c
+++ b/lib/sg_cmds_basic2.c
@@ -93,7 +93,7 @@ sg_ll_sync_cache_10(int sg_fd, bool sync_nv, bool immed, int group,
int res, ret, sense_cat;
uint8_t sc_cdb[SYNCHRONIZE_CACHE_CMDLEN] =
{SYNCHRONIZE_CACHE_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (sync_nv)
@@ -154,7 +154,7 @@ sg_ll_readcap_16(int sg_fd, bool pmi, uint64_t llba, void * resp,
uint8_t rc_cdb[SERVICE_ACTION_IN_16_CMDLEN] =
{SERVICE_ACTION_IN_16_CMD, READ_CAPACITY_16_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (pmi) { /* lbs only valid when pmi set */
@@ -209,7 +209,7 @@ sg_ll_readcap_10(int sg_fd, bool pmi, unsigned int lba, void * resp,
int ret, res, sense_cat;
uint8_t rc_cdb[READ_CAPACITY_10_CMDLEN] =
{READ_CAPACITY_10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (pmi) { /* lbs only valid when pmi set */
@@ -262,7 +262,7 @@ sg_ll_mode_sense6(int sg_fd, bool dbd, int pc, int pg_code, int sub_pg_code,
int res, ret, sense_cat, resid;
uint8_t modes_cdb[MODE_SENSE6_CMDLEN] =
{MODE_SENSE6_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
modes_cdb[1] = (uint8_t)(dbd ? 0x8 : 0);
@@ -361,7 +361,7 @@ sg_ll_mode_sense10_v2(int sg_fd, bool llbaa, bool dbd, int pc, int pg_code,
struct sg_pt_base * ptvp;
uint8_t modes_cdb[MODE_SENSE10_CMDLEN] =
{MODE_SENSE10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
modes_cdb[1] = (uint8_t)((dbd ? 0x8 : 0) | (llbaa ? 0x10 : 0));
modes_cdb[2] = (uint8_t)(((pc << 6) & 0xc0) | (pg_code & 0x3f));
@@ -448,7 +448,7 @@ sg_ll_mode_select6_v2(int sg_fd, bool pf, bool rtd, bool sp, void * paramp,
int res, ret, sense_cat;
uint8_t modes_cdb[MODE_SELECT6_CMDLEN] =
{MODE_SELECT6_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
modes_cdb[1] = (uint8_t)((pf ? 0x10 : 0x0) | (sp ? 0x1 : 0x0));
@@ -519,7 +519,7 @@ sg_ll_mode_select10_v2(int sg_fd, bool pf, bool rtd, bool sp, void * paramp,
int res, ret, sense_cat;
uint8_t modes_cdb[MODE_SELECT10_CMDLEN] =
{MODE_SELECT10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
modes_cdb[1] = (uint8_t)((pf ? 0x10 : 0x0) | (sp ? 0x1 : 0x0));
@@ -818,7 +818,7 @@ sg_ll_log_sense_v2(int sg_fd, bool ppc, bool sp, int pc, int pg_code,
int res, ret, sense_cat, resid;
uint8_t logs_cdb[LOG_SENSE_CMDLEN] =
{LOG_SENSE_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (mx_resp_len > 0xffff) {
@@ -902,7 +902,7 @@ sg_ll_log_select(int sg_fd, bool pcr, bool sp, int pc, int pg_code,
int res, ret, sense_cat;
uint8_t logs_cdb[LOG_SELECT_CMDLEN] =
{LOG_SELECT_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (param_len > 0xffff) {
@@ -973,7 +973,7 @@ sg_ll_start_stop_unit_com(struct sg_pt_base * ptvp, int sg_fd, bool immed,
bool local_cdb = true;
int res, ret, sense_cat;
uint8_t ssuBlk[START_STOP_CMDLEN] = {START_STOP_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (immed)
ssuBlk[1] = 0x1;
@@ -1073,7 +1073,7 @@ sg_ll_prevent_allow(int sg_fd, int prevent, bool noisy, int verbose)
int res, ret, sense_cat;
uint8_t p_cdb[PREVENT_ALLOW_CMDLEN] =
{PREVENT_ALLOW_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if ((prevent < 0) || (prevent > 3)) {
diff --git a/lib/sg_cmds_extra.c b/lib/sg_cmds_extra.c
index cbcc844..7d4f453 100644
--- a/lib/sg_cmds_extra.c
+++ b/lib/sg_cmds_extra.c
@@ -125,7 +125,7 @@ sg_ll_get_lba_status16(int sg_fd, uint64_t start_llba, uint8_t rt,
static const char * const cdb_s = "Get LBA status(16)";
int res, s_cat, ret;
uint8_t getLbaStatCmd[SERVICE_ACTION_IN_16_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(getLbaStatCmd, 0, sizeof(getLbaStatCmd));
@@ -202,7 +202,7 @@ sg_ll_get_lba_status32(int sg_fd, uint64_t start_llba, uint32_t scan_len,
static const char * const cdb_s = "Get LBA status(32)";
int res, s_cat, ret;
uint8_t gls32_cmd[GLS32_CMD_LEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(gls32_cmd, 0, sizeof(gls32_cmd));
@@ -281,7 +281,7 @@ sg_ll_report_tgt_prt_grp2(int sg_fd, void * resp, int mx_resp_len,
uint8_t rtpg_cdb[MAINTENANCE_IN_CMDLEN] =
{MAINTENANCE_IN_CMD, REPORT_TGT_PRT_GRP_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (extended)
@@ -346,7 +346,7 @@ sg_ll_set_tgt_prt_grp(int sg_fd, void * paramp, int param_len, bool noisy,
uint8_t stpg_cdb[MAINTENANCE_OUT_CMDLEN] =
{MAINTENANCE_OUT_CMD, SET_TGT_PRT_GRP_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)param_len, stpg_cdb + 6);
@@ -402,7 +402,7 @@ sg_ll_report_referrals(int sg_fd, uint64_t start_llba, bool one_seg,
uint8_t repRef_cdb[SERVICE_ACTION_IN_16_CMDLEN] =
{SERVICE_ACTION_IN_16_CMD, REPORT_REFERRALS_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be64(start_llba, repRef_cdb + 2);
@@ -475,7 +475,7 @@ sg_ll_send_diag_com(struct sg_pt_base * ptvp, int sg_fd, int st_code,
int res, ret, s_cat, tmout;
uint8_t senddiag_cdb[SEND_DIAGNOSTIC_CMDLEN] =
{SEND_DIAGNOSTIC_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
senddiag_cdb[1] = (uint8_t)(st_code << 5);
if (pf_bit)
@@ -593,7 +593,7 @@ sg_ll_receive_diag_com(struct sg_pt_base * ptvp, int sg_fd, bool pcv,
static const char * const cdb_s = "Receive diagnostic results";
uint8_t rcvdiag_cdb[RECEIVE_DIAGNOSTICS_CMDLEN] =
{RECEIVE_DIAGNOSTICS_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (pcv)
rcvdiag_cdb[1] = 0x1;
@@ -715,7 +715,7 @@ sg_ll_read_defect10(int sg_fd, bool req_plist, bool req_glist, int dl_format,
int res, ret, s_cat;
uint8_t rdef_cdb[READ_DEFECT10_CMDLEN] =
{READ_DEFECT10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
rdef_cdb[2] = (dl_format & 0x7);
@@ -787,7 +787,7 @@ sg_ll_read_media_serial_num(int sg_fd, void * resp, int mx_resp_len,
uint8_t rmsn_cdb[SERVICE_ACTION_IN_12_CMDLEN] =
{SERVICE_ACTION_IN_12_CMD, READ_MEDIA_SERIAL_NUM_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)mx_resp_len, rmsn_cdb + 6);
@@ -851,7 +851,7 @@ sg_ll_report_id_info(int sg_fd, int itype, void * resp, int max_resp_len,
uint8_t rii_cdb[MAINTENANCE_IN_CMDLEN] = {MAINTENANCE_IN_CMD,
REPORT_IDENTIFYING_INFORMATION_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)max_resp_len, rii_cdb + 6);
@@ -917,7 +917,7 @@ sg_ll_set_id_info(int sg_fd, int itype, void * paramp, int param_len,
uint8_t sii_cdb[MAINTENANCE_OUT_CMDLEN] = {MAINTENANCE_OUT_CMD,
SET_IDENTIFYING_INFORMATION_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)param_len, sii_cdb + 6);
@@ -1000,7 +1000,7 @@ sg_ll_format_unit_v2(int sg_fd, int fmtpinfo, bool longlist, bool fmtdata,
int res, ret, s_cat, tmout;
uint8_t fu_cdb[FORMAT_UNIT_CMDLEN] =
{FORMAT_UNIT_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (fmtpinfo)
@@ -1069,7 +1069,7 @@ sg_ll_reassign_blocks(int sg_fd, bool longlba, bool longlist, void * paramp,
int res, ret, s_cat;
uint8_t reass_cdb[REASSIGN_BLKS_CMDLEN] =
{REASSIGN_BLKS_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (longlba)
@@ -1128,7 +1128,7 @@ sg_ll_persistent_reserve_in(int sg_fd, int rq_servact, void * resp,
int res, ret, s_cat;
uint8_t prin_cdb[PERSISTENT_RESERVE_IN_CMDLEN] =
{PERSISTENT_RESERVE_IN_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (rq_servact > 0)
@@ -1195,7 +1195,7 @@ sg_ll_persistent_reserve_out(int sg_fd, int rq_servact, int rq_scope,
int res, ret, s_cat;
uint8_t prout_cdb[PERSISTENT_RESERVE_OUT_CMDLEN] =
{PERSISTENT_RESERVE_OUT_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (rq_servact > 0)
@@ -1274,7 +1274,7 @@ sg_ll_read_long10(int sg_fd, bool pblock, bool correct, unsigned int lba,
static const char * const cdb_s = "read long(10)";
int res, s_cat, ret;
uint8_t readLong_cdb[READ_LONG10_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(readLong_cdb, 0, READ_LONG10_CMDLEN);
@@ -1366,7 +1366,7 @@ sg_ll_read_long16(int sg_fd, bool pblock, bool correct, uint64_t llba,
static const char * const cdb_s = "read long(16)";
int res, s_cat, ret;
uint8_t readLong_cdb[SERVICE_ACTION_IN_16_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(readLong_cdb, 0, sizeof(readLong_cdb));
@@ -1459,7 +1459,7 @@ sg_ll_write_long10(int sg_fd, bool cor_dis, bool wr_uncor, bool pblock,
static const char * const cdb_s = "write long(10)";
int res, s_cat, ret;
uint8_t writeLong_cdb[WRITE_LONG10_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(writeLong_cdb, 0, WRITE_LONG10_CMDLEN);
@@ -1541,7 +1541,7 @@ sg_ll_write_long16(int sg_fd, bool cor_dis, bool wr_uncor, bool pblock,
static const char * const cdb_s = "write long(16)";
int res, s_cat, ret;
uint8_t writeLong_cdb[SERVICE_ACTION_OUT_16_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(writeLong_cdb, 0, sizeof(writeLong_cdb));
@@ -1628,7 +1628,7 @@ sg_ll_verify10(int sg_fd, int vrprotect, bool dpo, int bytchk,
int res, ret, s_cat, slen;
uint8_t v_cdb[VERIFY10_CMDLEN] =
{VERIFY10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
/* N.B. BYTCHK field expanded to 2 bits sbc3r34 */
@@ -1709,7 +1709,7 @@ sg_ll_verify16(int sg_fd, int vrprotect, bool dpo, int bytchk, uint64_t llba,
int res, ret, s_cat, slen;
uint8_t v_cdb[VERIFY16_CMDLEN] =
{VERIFY16_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
/* N.B. BYTCHK field expanded to 2 bits sbc3r34 */
@@ -1807,7 +1807,7 @@ sg_ll_ata_pt(int sg_fd, const uint8_t * cdbp, int cdb_len,
int k, res, slen, duration;
int ret = -1;
uint8_t apt_cdb[ATA_PT_32_CMDLEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
uint8_t * sp;
const uint8_t * bp;
struct sg_pt_base * ptvp;
@@ -1962,7 +1962,7 @@ sg_ll_read_buffer(int sg_fd, int mode, int buffer_id, int buffer_offset,
int res, ret, s_cat;
uint8_t rbuf_cdb[READ_BUFFER_CMDLEN] =
{READ_BUFFER_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
rbuf_cdb[1] = (uint8_t)(mode & 0x1f);
@@ -2027,7 +2027,7 @@ sg_ll_write_buffer(int sg_fd, int mode, int buffer_id, int buffer_offset,
int res, ret, s_cat;
uint8_t wbuf_cdb[WRITE_BUFFER_CMDLEN] =
{WRITE_BUFFER_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
wbuf_cdb[1] = (uint8_t)(mode & 0x1f);
@@ -2098,7 +2098,7 @@ sg_ll_write_buffer_v2(int sg_fd, int mode, int m_specific, int buffer_id,
int res, ret, s_cat;
uint8_t wbuf_cdb[WRITE_BUFFER_CMDLEN] =
{WRITE_BUFFER_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (buffer_offset > 0xffffff) {
@@ -2182,7 +2182,7 @@ sg_ll_unmap_v2(int sg_fd, bool anchor, int group_num, int timeout_secs,
int res, ret, s_cat, tmout;
uint8_t u_cdb[UNMAP_CMDLEN] =
{UNMAP_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (anchor)
@@ -2240,7 +2240,7 @@ sg_ll_read_block_limits(int sg_fd, void * resp, int mx_resp_len,
int ret, res, s_cat;
uint8_t rl_cdb[READ_BLOCK_LIMITS_CMDLEN] =
{READ_BLOCK_LIMITS_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (vb) {
@@ -2301,7 +2301,7 @@ sg_ll_receive_copy_results(int sg_fd, int sa, int list_id, void * resp,
int res, ret, s_cat;
uint8_t rcvcopyres_cdb[THIRD_PARTY_COPY_IN_CMDLEN] =
{THIRD_PARTY_COPY_IN_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
char b[64];
@@ -2364,7 +2364,7 @@ sg_ll_extended_copy(int sg_fd, void * paramp, int param_len, bool noisy,
int res, ret, s_cat;
uint8_t xcopy_cdb[THIRD_PARTY_COPY_OUT_CMDLEN] =
{THIRD_PARTY_COPY_OUT_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
const char * cdb_s = "Extended copy (LID1)";
@@ -2424,7 +2424,7 @@ sg_ll_3party_copy_out(int sg_fd, int sa, unsigned int list_id, int group_num,
int res, ret, s_cat, tmout;
uint8_t xcopy_cdb[THIRD_PARTY_COPY_OUT_CMDLEN] =
{THIRD_PARTY_COPY_OUT_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
char cname[80];
@@ -2511,7 +2511,7 @@ sg_ll_pre_fetch_x(int sg_fd, bool do_seek10, bool cdb16, bool immed,
int res, s_cat, ret, cdb_len, tmout;
const char *cdb_s;
uint8_t preFetchCdb[PRE_FETCH16_CMDLEN]; /* all use longest cdb */
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(preFetchCdb, 0, sizeof(preFetchCdb));
diff --git a/src/sg_bg_ctl.c b/src/sg_bg_ctl.c
index a1ca3f2..0e61d38 100644
--- a/src/sg_bg_ctl.c
+++ b/src/sg_bg_ctl.c
@@ -93,7 +93,7 @@ sg_ll_background_control(int sg_fd, unsigned int bo_ctl, unsigned int bo_time,
uint8_t bcCDB[16] = {SG_SERVICE_ACTION_IN_16,
BACKGROUND_CONTROL_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (bo_ctl)
diff --git a/src/sg_compare_and_write.c b/src/sg_compare_and_write.c
index e376202..0a30700 100644
--- a/src/sg_compare_and_write.c
+++ b/src/sg_compare_and_write.c
@@ -355,7 +355,7 @@ sg_ll_compare_and_write(int sg_fd, uint8_t * buff, int blocks,
uint64_t ull = 0;
struct sg_pt_base * ptvp;
uint8_t cawCmd[COMPARE_AND_WRITE_CDB_SIZE];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (sg_build_scsi_cdb(cawCmd, blocks, lba, flags)) {
pr2serr(ME "bad cdb build, lba=0x%" PRIx64 ", blocks=%d\n",
diff --git a/src/sg_dd.c b/src/sg_dd.c
index 75430dd..2fa3750 100644
--- a/src/sg_dd.c
+++ b/src/sg_dd.c
@@ -715,7 +715,7 @@ sg_read_low(int sg_fd, uint8_t * buff, int blocks, int64_t from_block,
int res, slen;
const uint8_t * sbp;
uint8_t rdCmd[MAX_SCSI_CDBSZ];
- uint8_t senseBuff[SENSE_BUFF_LEN];
+ uint8_t senseBuff[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
if (sg_build_scsi_cdb(rdCmd, ifp->cdbsz, blocks, from_block, do_verify,
@@ -1124,7 +1124,7 @@ sg_write(int sg_fd, uint8_t * buff, int blocks, int64_t to_block,
uint64_t io_addr = 0;
const char * op_str = do_verify ? "verifying" : "writing";
uint8_t wrCmd[MAX_SCSI_CDBSZ];
- uint8_t senseBuff[SENSE_BUFF_LEN];
+ uint8_t senseBuff[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
if (sg_build_scsi_cdb(wrCmd, ofp->cdbsz, blocks, to_block, do_verify,
diff --git a/src/sg_format.c b/src/sg_format.c
index 0d9b318..b6620ab 100644
--- a/src/sg_format.c
+++ b/src/sg_format.c
@@ -278,7 +278,7 @@ sg_ll_format_medium(int sg_fd, bool verify, bool immed, int format,
int ret, res, sense_cat;
uint8_t fm_cdb[SG_FORMAT_MEDIUM_CMDLEN] =
{SG_FORMAT_MEDIUM_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (verify)
@@ -343,7 +343,7 @@ sg_ll_format_with_preset(int sg_fd, bool immed, bool fmtmaxlba,
int ret, res, sense_cat;
uint8_t fwp_cdb[SG_FORMAT_WITH_PRESET_CMDLEN] =
{SG_FORMAT_WITH_PRESET_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (immed)
diff --git a/src/sg_get_elem_status.c b/src/sg_get_elem_status.c
index c60d984..ea5b7d0 100644
--- a/src/sg_get_elem_status.c
+++ b/src/sg_get_elem_status.c
@@ -144,7 +144,7 @@ sg_ll_get_phy_elem_status(int sg_fd, uint32_t starting_elem, uint8_t filter,
uint8_t gpesCmd[16] = {SG_SERVICE_ACTION_IN_16,
GET_PHY_ELEM_STATUS_SA, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
static const char * const cmd_name = "Get physical element status";
diff --git a/src/sg_opcodes.c b/src/sg_opcodes.c
index ffa7823..9d90824 100644
--- a/src/sg_opcodes.c
+++ b/src/sg_opcodes.c
@@ -195,7 +195,7 @@ do_rsoc(struct sg_pt_base * ptvp, bool rctd, int rep_opts, int rq_opcode,
int ret, res, sense_cat;
uint8_t rsoc_cdb[RSOC_CMD_LEN] = {SG_MAINTENANCE_IN, RSOC_SA, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (rctd)
rsoc_cdb[2] |= 0x80;
@@ -259,7 +259,7 @@ do_rstmf(struct sg_pt_base * ptvp, bool repd, void * resp, int mx_resp_len,
int ret, res, sense_cat;
uint8_t rstmf_cdb[RSTMF_CMD_LEN] = {SG_MAINTENANCE_IN, RSTMF_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
if (repd)
rstmf_cdb[2] = 0x80;
diff --git a/src/sg_read.c b/src/sg_read.c
index cd10c2e..628e0d8 100644
--- a/src/sg_read.c
+++ b/src/sg_read.c
@@ -296,7 +296,7 @@ sg_bread(int sg_fd, uint8_t * buff, int blocks, int64_t from_block, int bs,
bool no_dxfer)
{
uint8_t rdCmd[MAX_SCSI_CDBSZ];
- uint8_t senseBuff[SENSE_BUFF_LEN];
+ uint8_t senseBuff[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
if (sg_build_scsi_cdb(rdCmd, cdbsz, blocks, from_block, false, fua,
diff --git a/src/sg_read_attr.c b/src/sg_read_attr.c
index 87124d3..b0bcedb 100644
--- a/src/sg_read_attr.c
+++ b/src/sg_read_attr.c
@@ -249,7 +249,7 @@ sg_ll_read_attr(int sg_fd, void * resp, int * residp, bool noisy,
uint8_t ra_cdb[SG_READ_ATTRIBUTE_CMDLEN] =
{SG_READ_ATTRIBUTE_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
ra_cdb[1] = 0x1f & op->sa;
diff --git a/src/sg_read_buffer.c b/src/sg_read_buffer.c
index e3dae42..93c32a5 100644
--- a/src/sg_read_buffer.c
+++ b/src/sg_read_buffer.c
@@ -166,7 +166,7 @@ sg_ll_read_buffer_10(int sg_fd, int rb_mode, int rb_mode_sp, int rb_id,
int ret, res, sense_cat;
uint8_t rb10_cb[SG_READ_BUFFER_10_CMDLEN] =
{SG_READ_BUFFER_10_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
rb10_cb[1] = (uint8_t)(rb_mode & 0x1f);
@@ -234,7 +234,7 @@ sg_ll_read_buffer_16(int sg_fd, int rb_mode, int rb_mode_sp, int rb_id,
uint8_t rb16_cb[SG_READ_BUFFER_16_CMDLEN] =
{SG_READ_BUFFER_16_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
rb16_cb[1] = (uint8_t)(rb_mode & 0x1f);
diff --git a/src/sg_rep_pip.c b/src/sg_rep_pip.c
index f800d81..2f6127e 100644
--- a/src/sg_rep_pip.c
+++ b/src/sg_rep_pip.c
@@ -102,7 +102,7 @@ sg_ll_report_pip(int sg_fd, void * resp, int mx_resp_len, int * residp,
uint8_t rz_cdb[SG_MAINT_IN_CMDLEN] =
{SG_MAINTENANCE_IN, REPORT_PROVISIONING_INITIALIZATION_PATTERN_SA,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)mx_resp_len, rz_cdb + 6);
diff --git a/src/sg_rep_zones.c b/src/sg_rep_zones.c
index 7453ee2..2e719e7 100644
--- a/src/sg_rep_zones.c
+++ b/src/sg_rep_zones.c
@@ -191,7 +194,7 @@ sg_ll_report_zzz(int sg_fd, int serv_act, uint64_t zs_lba, bool partial,
uint8_t rz_cdb[SG_ZONING_IN_CMDLEN] =
{SG_ZONING_IN, REPORT_ZONES_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
rz_cdb[1] = serv_act;
diff --git a/src/sg_requests.c b/src/sg_requests.c
index a0afd36..ee0c038 100644
--- a/src/sg_requests.c
+++ b/src/sg_requests.c
@@ -152,7 +152,7 @@ main(int argc, char * argv[])
char b[256];
uint8_t rs_cdb[REQUEST_SENSE_CMDLEN] =
{REQUEST_SENSE_CMD, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
#ifndef SG_LIB_MINGW
bool do_time = false;
struct timeval start_tm, end_tm;
diff --git a/src/sg_reset_wp.c b/src/sg_reset_wp.c
index 3a99a72..f3e76b3 100644
--- a/src/sg_reset_wp.c
+++ b/src/sg_reset_wp.c
@@ -88,7 +88,7 @@ sg_ll_reset_write_pointer(int sg_fd, uint64_t zid, uint16_t zc, bool all,
int ret, res, sense_cat;
uint8_t rwp_cdb[SG_ZONING_OUT_CMDLEN] = {SG_ZONING_OUT,
RESET_WRITE_POINTER_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be64(zid, rwp_cdb + 2);
diff --git a/src/sg_sanitize.c b/src/sg_sanitize.c
index 6865e46..ade9be7 100644
--- a/src/sg_sanitize.c
+++ b/src/sg_sanitize.c
@@ -185,7 +185,7 @@ do_sanitize(int sg_fd, const struct opts_t * op, const void * param_lstp,
bool immed;
int ret, res, sense_cat, timeout;
uint8_t san_cdb[SANITIZE_OP_LEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (op->early || op->wait)
diff --git a/src/sg_stream_ctl.c b/src/sg_stream_ctl.c
index 3f1ff84..eede6e8 100644
--- a/src/sg_stream_ctl.c
+++ b/src/sg_stream_ctl.c
@@ -116,7 +116,7 @@ sg_ll_get_stream_status(int sg_fd, uint16_t s_str_id, uint8_t * resp,
int k, ret, res, sense_cat;
uint8_t gssCdb[16] = {SG_SERVICE_ACTION_IN_16,
GET_STREAM_STATUS_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
static const char * const cmd_name = "Get stream status";
@@ -184,7 +184,7 @@ sg_ll_stream_control(int sg_fd, uint32_t str_ctl, uint16_t str_id,
int k, ret, res, sense_cat;
uint8_t scCdb[16] = {SG_SERVICE_ACTION_IN_16,
STREAM_CONTROL_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
static const char * const cmd_name = "Stream control";
diff --git a/src/sg_sync.c b/src/sg_sync.c
index 751b25c..1a8eebf 100644
--- a/src/sg_sync.c
+++ b/src/sg_sync.c
@@ -101,7 +101,7 @@ sg_ll_sync_cache_16(int sg_fd, bool sync_nv, bool immed, int group,
uint8_t sc_cdb[SYNCHRONIZE_CACHE16_CMDLEN] =
{SYNCHRONIZE_CACHE16_CMD, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
if (sync_nv)
diff --git a/src/sg_timestamp.c b/src/sg_timestamp.c
index 58f1297..b9da385 100644
--- a/src/sg_timestamp.c
+++ b/src/sg_timestamp.c
@@ -197,7 +197,7 @@ sg_ll_rep_timestamp(int sg_fd, void * resp, int mx_resp_len, int * residp,
int k, ret, res, sense_cat;
uint8_t rt_cdb[REP_TIMESTAMP_CMDLEN] =
{SG_MAINTENANCE_IN, REP_TIMESTAMP_SA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32((uint32_t)mx_resp_len, rt_cdb + 6);
@@ -260,7 +260,7 @@ sg_ll_set_timestamp(int sg_fd, void * paramp, int param_len, bool noisy,
uint8_t st_cdb[SET_TIMESTAMP_CMDLEN] =
{SG_MAINTENANCE_OUT, SET_TIMESTAMP_SA, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
sg_put_unaligned_be32(param_len, st_cdb + 6);
diff --git a/src/sg_write_same.c b/src/sg_write_same.c
index bfbfdca..e2213fb 100644
--- a/src/sg_write_same.c
+++ b/src/sg_write_same.c
@@ -169,8 +169,8 @@ do_write_same(int sg_fd, const struct opts_t * op, const void * dataoutp,
{
int ret, res, sense_cat, cdb_len;
uint64_t llba;
- uint8_t ws_cdb[WRITE_SAME32_LEN];
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t ws_cdb[WRITE_SAME32_LEN] = {0};
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
cdb_len = op->pref_cdb_size;
@@ -194,7 +194,6 @@ do_write_same(int sg_fd, const struct opts_t * op, const void * dataoutp,
}
if (act_cdb_lenp)
*act_cdb_lenp = cdb_len;
- memset(ws_cdb, 0, sizeof(ws_cdb));
switch (cdb_len) {
case WRITE_SAME10_LEN:
ws_cdb[0] = WRITE_SAME10_OP;
diff --git a/src/sg_write_verify.c b/src/sg_write_verify.c
index 1303020..384899b 100644
--- a/src/sg_write_verify.c
+++ b/src/sg_write_verify.c
@@ -129,7 +129,7 @@ run_scsi_transaction(int sg_fd, const uint8_t *cdbp, int cdb_len,
{
int res, sense_cat, ret;
struct sg_pt_base * ptvp;
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
char b[32];
snprintf(b, sizeof(b), "Write and verify(%d)", cdb_len);
diff --git a/src/sg_write_x.c b/src/sg_write_x.c
index 504fe26..18d1e7e 100644
--- a/src/sg_write_x.c
+++ b/src/sg_write_x.c
@@ -1053,7 +1053,7 @@ do_write_x(int sg_fd, const void * dataoutp, int dout_len,
{
int k, ret, res, sense_cat, cdb_len, vb, err;
uint8_t x_cdb[WRITE_X_32_LEN]; /* use for both lengths */
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_pt_base * ptvp;
memset(x_cdb, 0, sizeof(x_cdb));
diff --git a/src/sg_zone.c b/src/sg_zone.c
index f47e6f6..ff4dc36 100644
--- a/src/sg_zone.c
+++ b/src/sg_zone.c
@@ -133,7 +133,7 @@ sg_ll_zone_out(int sg_fd, int sa, uint64_t zid, uint16_t zc, bool all,
struct sg_pt_base * ptvp;
uint8_t zo_cdb[SG_ZONING_OUT_CMDLEN] =
{SG_ZONING_OUT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
char b[64];
zo_cdb[1] = 0x1f & sa;
diff --git a/src/sginfo.c b/src/sginfo.c
index ba094dc..51a312a 100644
--- a/src/sginfo.c
+++ b/src/sginfo.c
@@ -393,7 +393,7 @@ struct scsi_cmnd_io
static int
do_scsi_io(struct scsi_cmnd_io * sio)
{
- uint8_t sense_b[SENSE_BUFF_LEN];
+ uint8_t sense_b[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
struct sg_scsi_sense_hdr ssh;
int res;
diff --git a/src/sgm_dd.c b/src/sgm_dd.c
index 4909c82..e95fca9 100644
--- a/src/sgm_dd.c
+++ b/src/sgm_dd.c
@@ -471,7 +471,7 @@ sg_read(int sg_fd, uint8_t * buff, int blocks, int64_t from_block,
bool print_cdb_after = false;
int res;
uint8_t rdCmd[MAX_SCSI_CDBSZ];
- uint8_t senseBuff[SENSE_BUFF_LEN];
+ uint8_t senseBuff[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
if (sg_build_scsi_cdb(rdCmd, cdbsz, blocks, from_block, false, fua,
@@ -568,7 +568,7 @@ sg_write(int sg_fd, uint8_t * buff, int blocks, int64_t to_block,
bool print_cdb_after = false;
int res;
uint8_t wrCmd[MAX_SCSI_CDBSZ];
- uint8_t senseBuff[SENSE_BUFF_LEN];
+ uint8_t senseBuff[SENSE_BUFF_LEN] = {0};
struct sg_io_hdr io_hdr;
if (sg_build_scsi_cdb(wrCmd, cdbsz, blocks, to_block, true, fua, dpo)) {

View File

@ -0,0 +1,69 @@
From 9939d8d804d0ce423824836173c296daf4e13e99 Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Mon, 7 Feb 2022 16:02:32 +0000
Subject: [PATCH] rescan-scsi-bus.sh: Use "seq -s"
Since the commit [git: 8c86fe2; svn rev 815 "library: add to '.so' name;
rescan-scsi-bus: multiple patches to sync with Suse], we correctly use
quoting when we print $idsearch or $lunsearch. This causes a change in
the output of the script, because these number lists are generated by
the GNU seq utility, which uses "\n" as default separator, and the
quoting now causes the newlines to be preserved. Use "seq -s" to
generate space-separated lists instead.
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@936 6180dd3e-e324-4e3e-922d-17de1ae2f315
---
ChangeLog | 4 +++-
scripts/rescan-scsi-bus.sh | 12 ++++++------
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/scripts/rescan-scsi-bus.sh b/scripts/rescan-scsi-bus.sh
index e4eeef1..78544b1 100755
--- a/scripts/rescan-scsi-bus.sh
+++ b/scripts/rescan-scsi-bus.sh
@@ -716,7 +716,7 @@ expandlist ()
result="$result $beg";
else
end=${first#*-}
- result="$result $(seq $beg $end)"
+ result="$result $(seq -s ' ' $beg $end)"
fi
[ "$rest" = "$first" ] && rest=""
first=${rest%%,*}
@@ -1200,7 +1200,7 @@ fi
unsetcolor
debug=0
lunsearch=
-opt_idsearch=$(seq 0 7)
+opt_idsearch=$(seq -s ' ' 0 7)
filter_ids=0
opt_channelsearch=
remove=
@@ -1227,13 +1227,13 @@ while [ ! -z "$opt" ] && [ -z "${opt##-*}" ] ; do
f) flush=1 ;;
i) lipreset=0 ;;
I) shift; lipreset=$opt ;;
- l) lunsearch=$(seq 0 7) ;;
- L) lunsearch=$(seq 0 "$2"); shift ;;
+ l) lunsearch=$(seq -s ' ' 0 7) ;;
+ L) lunsearch=$(seq -s ' ' 0 "$2"); shift ;;
m) mp_enable=1 ;;
r) remove=1 ;;
s) resize=1; mp_enable=1 ;;
u) update=1 ;;
- w) opt_idsearch=$(seq 0 15) ;;
+ w) opt_idsearch=$(seq -s ' ' 0 15) ;;
-alltargets) existing_targets=;;
-attachpq3) scan_flags=$((scan_flags|0x1000000)) ;;
-channels=*) arg=${opt#-channels=};opt_channelsearch=$(expandlist "$arg") ;;
@@ -1257,7 +1257,7 @@ while [ ! -z "$opt" ] && [ -z "${opt##-*}" ] ; do
-sparselun) scan_flags=$((scan_flags|0x40)) ;;
-sync) sync=2 ;;
-update) update=1;;
- -wide) opt_idsearch=$(seq 0 15) ;;
+ -wide) opt_idsearch=$(seq -s ' ' 0 15) ;;
*) echo "Unknown option -$opt !" ;;
esac
shift

View File

@ -0,0 +1,25 @@
From d8d16e8d7b520e7d00003f57ae78233d993cf781 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Wed, 8 Jun 2022 16:55:19 +0200
Subject: [PATCH] sg_vpd_vendor: Fix missing newline in the
svpd_decode_vendor() error path
---
src/sg_vpd_vendor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sg_vpd_vendor.c b/src/sg_vpd_vendor.c
index 4f3b25e..e0d57fc 100644
--- a/src/sg_vpd_vendor.c
+++ b/src/sg_vpd_vendor.c
@@ -1557,6 +1557,6 @@ svpd_decode_vendor(int sg_fd, struct opts_t * op, int off)
return 0;
}
} else
- pr2serr("Vendor VPD page=0x%x failed to fetch", op->vpd_pn);
+ pr2serr("Vendor VPD page=0x%x failed to fetch\n", op->vpd_pn);
return res;
}
--
2.36.1

View File

@ -1,28 +0,0 @@
From c683e6e2bc62b43c140934b919323d107b0a48cb Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 28 May 2019 16:06:06 +0200
Subject: [PATCH] sg_raw: do not print error about device not specified on
version request
---
src/sg_raw.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/sg_raw.c b/src/sg_raw.c
index 33a85f7c..453ff42a 100644
--- a/src/sg_raw.c
+++ b/src/sg_raw.c
@@ -440,6 +440,13 @@ parse_cmd_line(struct opts_t * op, int argc, char *argv[])
}
}
+ if (op->version_given
+#ifdef DEBUG
+ && ! op->verbose_given
+#endif
+ )
+ return 0;
+
if (optind >= argc) {
pr2serr("No device specified\n\n");
return SG_LIB_SYNTAX_ERROR;

View File

@ -0,0 +1,25 @@
From 975c80c40b7e4244de94acc95144d81f80e08cb1 Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Mon, 17 Jan 2022 14:50:27 +0100
Subject: [PATCH] man: Fix sg_readcap -z argument in the old options
---
doc/sg_readcap.8 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/sg_readcap.8 b/doc/sg_readcap.8
index fa2afd3..d936ef9 100644
--- a/doc/sg_readcap.8
+++ b/doc/sg_readcap.8
@@ -178,7 +178,7 @@ and '\-vvv' are also accepted yielding greater verbosity.
\fB\-V\fR
outputs version string then exits.
.TP
-\fB\-R\fR
+\fB\-z\fR
Equivalent to \fI\-\-zbc\fR in the main description.
.SH ENVIRONMENT VARIABLES
Since sg3_utils version 1.23 the environment variable SG3_UTILS_OLD_OPTS
--
2.34.1

View File

@ -1,95 +0,0 @@
From a00692315686c7bc061010aa215bcb381181758f Mon Sep 17 00:00:00 2001
From: Douglas Gilbert <dgilbert@interlog.com>
Date: Wed, 10 Oct 2018 06:50:03 +0000
Subject: [PATCH] sg_ses: bug: --page= being overridden when --control and
--data= also given; fix; sg_opcodes: expand MLU (18-102r0)
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@793 6180dd3e-e324-4e3e-922d-17de1ae2f315
diff --git a/src/sg_ses.c b/src/sg_ses.c
index abb1feac..0cce8bd1 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -70,7 +70,7 @@ static const char * version_str = "2.43 20180810"; /* ses4r02 */
#define ELEM_DESC_DPC 0x7
#define SHORT_ENC_STATUS_DPC 0x8
#define ENC_BUSY_DPC 0x9
-#define ADD_ELEM_STATUS_DPC 0xa
+#define ADD_ELEM_STATUS_DPC 0xa /* Additional Element Status dpage code */
#define SUBENC_HELP_TEXT_DPC 0xb
#define SUBENC_STRING_DPC 0xc
#define SUPPORTED_SES_DPC 0xd /* should be 0x1 <= dpc <= 0x2f */
@@ -108,6 +108,7 @@ static const char * version_str = "2.43 20180810"; /* ses4r02 */
#define SAS_CONNECTOR_ETC 0x19
#define LAST_ETC SAS_CONNECTOR_ETC /* adjust as necessary */
+#define TPROTO_PCIE_PS_NVME 1 /* NVMe regarded as subset of PCIe */
#define NUM_ETC (LAST_ETC + 1)
#define DEF_CLEAR_VAL 0
@@ -1378,7 +1379,8 @@ parse_cmd_line(struct opts_t *op, int argc, char *argv[])
return SG_LIB_SYNTAX_ERROR;
}
op->do_raw = 0;
- if (op->arr_len > 3) {
+ /* struct data_in_desc_t stuff does not apply when --control */
+ if (op->do_status && (op->arr_len > 3)) {
int off;
int pc = 0;
const uint8_t * bp = op->data_arr + DATA_IN_OFF;
@@ -3476,9 +3478,9 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
if (len < 6)
break;
pcie_pt = (ae_bp[5] >> 5) & 0x7;
- if (1 == pcie_pt)
+ if (TPROTO_PCIE_PS_NVME == pcie_pt)
printf("%sPCIe protocol type: NVMe\n", pad);
- else {
+ else { /* no others currently defined */
printf("%sTransport protocol: PCIe subprotocol=0x%x not "
"decoded\n", pad, pcie_pt);
if (op->verbose)
@@ -3490,7 +3492,7 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
ae_bp[5] & 1);
printf(", device slot number: %d\n", ae_bp[7]);
- pcie_vid = sg_get_unaligned_le16(ae_bp + 10);
+ pcie_vid = sg_get_unaligned_le16(ae_bp + 10); /* N.B. LE */
printf("%sPCIe vendor id: 0x%" PRIx16 "%s\n", pad, pcie_vid,
(0xffff == pcie_vid) ? " (not reported)" : "");
printf("%sserial number: %.20s\n", pad, ae_bp + 12);
@@ -3505,14 +3507,14 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
(int)psn_valid, (int)bdf_valid, (int)cid_valid);
if (cid_valid) /* N.B. little endian */
printf("%s controller id: 0x%" PRIx16 "\n", pad,
- sg_get_unaligned_le16(aep + 1));
+ sg_get_unaligned_le16(aep + 1)); /* N.B. LEndian */
if (bdf_valid)
printf("%s bus number: 0x%x, device number: 0x%x, "
"function number: 0x%x\n", pad, aep[4],
(aep[5] >> 3) & 0x1f, 0x7 & aep[5]);
if (psn_valid) /* little endian, top 3 bits assumed zero */
printf("%s physical slot number: 0x%" PRIx16 "\n", pad,
- 0x1fff & sg_get_unaligned_le16(aep + 6));
+ 0x1fff & sg_get_unaligned_le16(aep + 6)); /* N.B. LE */
}
break;
default:
@@ -3524,7 +3526,7 @@ additional_elem_helper(const char * pad, const uint8_t * ae_bp,
}
}
-/* ADD_ELEM_STATUS_DPC [0xa]
+/* ADD_ELEM_STATUS_DPC [0xa] Additional Element Status dpage
* Previously called "Device element status descriptor". Changed "device"
* to "additional" to allow for SAS expander and SATA devices */
static void
@@ -5704,7 +5706,7 @@ main(int argc, char * argv[])
uint16_t oacs;
nvmsr = enc_stat_rsp[253];
- oacs = sg_get_unaligned_le16(enc_stat_rsp + 256);
+ oacs = sg_get_unaligned_le16(enc_stat_rsp + 256); /* N.B. LE */
if (vb > 3)
pr2serr("NVMe Identify ctl response: nvmsr=%u, oacs=0x%x\n",
nvmsr, oacs);

View File

@ -1,24 +0,0 @@
From 116e665ddb7b38bb8f7065ddb08192bd3551897d Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Tue, 26 Feb 2019 16:45:59 +0100
Subject: [PATCH] sg_turs: fix help invocation in the old mode
In the old mode the usage was printed out twice when called
by `sg_turs -O -?`.
---
src/sg_turs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sg_turs.c b/src/sg_turs.c
index 8c6e3792..a318d22c 100644
--- a/src/sg_turs.c
+++ b/src/sg_turs.c
@@ -252,7 +252,7 @@ old_parse_cmd_line(struct opts_t * op, int argc, char * argv[])
op->version_given = true;
break;
case '?':
- usage_old();
+ ++op->do_help;
return 0;
default:
jmp_out = true;

View File

@ -1,32 +1,45 @@
%global rescan_script rescan-scsi-bus.sh
%global _udevlibdir %{_prefix}/lib/udev
Summary: Utilities for devices that use SCSI command sets
Name: sg3_utils
Version: 1.44
Release: 6%{?dist}
Name: sg3_utils
Version: 1.47
Release: 9%{?dist}
License: GPLv2+ and BSD
Group: Applications/System
Source0: http://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
URL: https://sg.danny.cz/sg/sg3_utils.html
Source0: https://sg.danny.cz/sg/p/sg3_utils-%{version}.tar.xz
Source2: scsi-rescan.8
Source10: 40-usb-blacklist.rules
Source11: 59-fc-wwpn-id.rules
Patch0: BZ_1633235-sg3_utils-1.44-covscan-fix.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1683343
# sg_turs: improper usage show
Patch1: sg_turs-help.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1627657
# sg_raw -V fail
Patch2: sg_raw-version.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=1760847
# FC_TARGET_LUN attribute assigned for non FC device
Patch3: fc_wwpn_id-non_FC-devices.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2078107
# sg_ses: --page= is incorrectly overridden when --control and --data= are also used
Patch4: sg_ses-1.45-page_control_data_args.patch
URL: http://sg.danny.cz/sg/sg3_utils.html
# https://bugzilla.redhat.com/show_bug.cgi?id=2044433
# Covscan fixes
Patch0: sg3_utils-1.48-initialize_sense_buffers.patch
Patch1: sg3_utils-1.48-covscan_fixes.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2036718
# sg_readcap man page contains duplicate -R options
Patch2: sg_readcap-man.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2035382
# rescan-scsi-bus.sh output shows tab (\t) and newline (\n) characters in output
Patch3: rescan-scsi-bus_printf.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2036005
# https://bugzilla.redhat.com/show_bug.cgi?id=2035362
# rescan-scsi-bus.sh with "-r" switch deletes all scsi devices, especially boot disk which causes the system to hang
Patch4: rescan-scsi-bus_sg_inq-parse.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2052512
# rescan-scsi-bus.sh: Fix scanning progress output
Patch5: sg3_utils-1.48-rescan-scsi-bus.sh_seq_-s.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2073146
# missing new line in sg_vpd output
Patch6: sg3_utils-1.48-sg_vpd_vendor-Fix-missing-newline-in-the-svpd_decode.patch
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
BuildRequires: make
BuildRequires: gcc
BuildRequires: systemd
BuildRequires: gettext-devel
BuildRequires: automake
BuildRequires: autoconf
BuildRequires: libtool
%description
@ -45,14 +58,12 @@ and the incorrect usage of them may render your system inoperable.
%package libs
Summary: Shared library for %{name}
Group: System Environment/Libraries
%description libs
This package contains the shared library for %{name}.
%package devel
Summary: Development library and header files for the sg3_utils library
Group: Development/Libraries
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
@ -60,20 +71,21 @@ This package contains the %{name} library and its header files for
developing applications.
%prep
%autosetup -p 1
%autosetup -p 1 -n sg3_utils-%{version}
%build
./autogen.sh
%configure --disable-static
# Don't use rpath!
sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
make %{?_smp_mflags}
%make_build
%install
make install DESTDIR=$RPM_BUILD_ROOT
%make_install
rm -rf $RPM_BUILD_ROOT/%{_libdir}/*.la
install -p -m 755 scripts/%{rescan_script} $RPM_BUILD_ROOT%{_bindir}
@ -84,17 +96,14 @@ install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_mandir}/man8
# install all extra udev rules
mkdir -p $RPM_BUILD_ROOT%{_udevrulesdir}
mkdir -p $RPM_BUILD_ROOT/usr/lib/udev
install -p -m 644 scripts/40-usb-blacklist.rules $RPM_BUILD_ROOT%{_udevrulesdir}
# need to run after 60-persistent-storage.rules
install -p -m 644 scripts/55-scsi-sg3_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/61-scsi-sg3_id.rules
# need to run after 62-multipath.rules
install -p -m 644 scripts/58-scsi-sg3_symlink.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-scsi-sg3_symlink.rules
install -p -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_udevrulesdir}
install -p -m 644 %{SOURCE11} $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules
install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
install -p -m 644 scripts/59-scsi-cciss_id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/65-scsi-cciss_id.rules
install -p -m 644 scripts/59-fc-wwpn-id.rules $RPM_BUILD_ROOT%{_udevrulesdir}/63-fc-wwpn-id.rules
install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT%{_udevlibdir}
%files
%doc AUTHORS BSD_LICENSE COPYING COVERAGE CREDITS ChangeLog README README.sg_start
@ -103,8 +112,9 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev
%{_udevrulesdir}/61-scsi-sg3_id.rules
%{_udevrulesdir}/63-scsi-sg3_symlink.rules
%{_udevrulesdir}/63-fc-wwpn-id.rules
%{_udevrulesdir}/65-scsi-cciss_id.rules
%{_udevrulesdir}/40-usb-blacklist.rules
/usr/lib/udev/*
%{_udevlibdir}/fc_wwpn_id
%files libs
%doc BSD_LICENSE COPYING
@ -116,27 +126,77 @@ install -p -m 755 scripts/fc_wwpn_id $RPM_BUILD_ROOT/usr/lib/udev
%changelog
* Wed Jun 08 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.44-6
- Fix sg_ses --page argument override when --control and --data are specified (#2078107)
* Wed Jun 15 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-9
- Fix missing newline in sg_vpd output (#2073146)
* Thu Jan 02 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-5
- Reorder the udev rules to run after 60-persistent-storage.rules (RHBZ #1785062)
* Fri Feb 11 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-8
- Fix scanning progress output (#2052512)
* Tue Dec 10 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-4
- Enable supplemental udev rules by default (RHBZ #1746414)
* Thu Jan 27 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.47-7
- Fix sg_inq parsing in rescan-scsi-bus.sh (#2036005,#2035362)
- Fix rescan-scsi-bus.sh summary print (#2035382)
- sg_readcap --zbc man page switch fix (#2036718)
- Various Covscan fixes (#2044433)
* Tue May 28 2019 Tomas Bzatek <tbzatek@redhat.com> - 1.44-3
* Mon Nov 15 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-6
- update to stable version 1.47 (svn: r919) (#2011810)
* Wed Aug 18 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-5
- update to pre-release version 1.47 (svn: r908) (#1971681)
* Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.47-4
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
Related: rhbz#1991688
* Tue Jun 15 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-3
- update to pre-release version 1.47 (svn: r904) (#1970981)
* Thu May 27 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-2
- Rebuild (#1963799)
* Mon May 17 2021 Tomas Bzatek <tbzatek@redhat.com> - 1.47-1
- update to pre-release version 1.47 (svn: r900)
* Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.45-5
- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.45-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.45-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Tue Jul 14 2020 Tom Stellard <tstellar@redhat.com> - 1.45-2
- Use make macros
- https://fedoraproject.org/wiki/Changes/UseMakeBuildInstallMacro
* Thu Mar 12 2020 Dan Horák <dan@danny.cz> - 1.45-1
- update to version 1.45 (#1809392)
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.44-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Mon Jan 06 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-2
- Backport "rescan-scsi-bus.sh: use LUN wildcard in idlist"
* Fri Jan 03 2020 Tomas Bzatek <tbzatek@redhat.com> - 1.44-1
- Rebase to 1.44 release
- Enable supplemental udev rules
- Fix sg_turs help invocation in an old mode (#1683343)
- Fix sg_raw printing error about device not specified on version request (#1627657)
- Fix coverity scan warnings (#1633235)
* Fri Sep 28 2018 Gris Ge <fge@redhat.com> - 1.44-2
- Fix coverity scan warninings (RHBZ#1633235)
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue Sep 18 2018 Gris Ge <fge@redhat.com> - 1.44-1
- Upgrade to 1.44. (RHBZ#1631347)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Aug 10 2018 Gris Ge <fge@redhat.com> 1.43-0.beta785.1
- Upgrade to 1.43 beta r785.
* Mon Jul 16 2018 Dan Horák <dan[at]danny.cz> - 1.42-6
- fix build with new glibc - use sysmacros.h for major()/minor()
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.42-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild