sg3_utils/sg3_utils-Do-not-export-long-identifiers.patch
Marcus Meissner 022fc83749 Accepting request 247421 from home:hreinecke:branches:Base:System
- Fixup formatting of invalid VPD pages (bnc#884779)
  Add: sg3_utils-Fixup-formatting-of-invalid-VPD-page-0x83.patch
- sg_inq: Do not export long identifiers (bnc#884779)
  Add: sg3_utils-Do-not-export-long-identifiers.patch

OBS-URL: https://build.opensuse.org/request/show/247421
OBS-URL: https://build.opensuse.org/package/show/Base:System/sg3_utils?expand=0&rev=44
2014-09-04 08:38:09 +00:00

35 lines
1.1 KiB
Diff

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