Skip to content

sync src/scsi_id/scsi_id.c#203

Merged
bbonev merged 8 commits intoeudev-project:masterfrom
bbonev:s1scsi
Oct 16, 2021
Merged

sync src/scsi_id/scsi_id.c#203
bbonev merged 8 commits intoeudev-project:masterfrom
bbonev:s1scsi

Conversation

@bbonev
Copy link
Member

@bbonev bbonev commented Sep 19, 2021

Author: Jan Synacek jan.synacek@gmail.com
Date: Wed Aug 2 10:12:33 2017 +0200

scsi_id: add missing options to getopt_long() (#6501)

systemd-commit: ebc6f34a0b2359ac0da41037a1122d3abe02caee

@bbonev
Copy link
Member Author

bbonev commented Sep 27, 2021

Some important changes are there, this should be ready to merge after a review

systemd-commit: ebc6f34a0b2359ac0da41037a1122d3abe02caee
Author: Jan Synacek <jan.synacek@gmail.com>
Date:   Wed Aug 2 10:12:33 2017 +0200
Previously, the value is once stringified, and later again parsed,
that is completely redundant.

Follow-up for 1001167ca5e4cfdc6230562e4fb9029e5f624d53.

Replaces #20013.

systemd-commit: 4dce1b9f059733ed9a263fba7cfa12704e96794a
Author: Yu Watanabe <watanabe.yu+github@gmail.com>
Date:   Fri Jun 25 15:04:12 2021 +0900
gcc was warning about strncpy() leaving an unterminated string.
In this case, it was correct.

The code was doing strncpy()+strncat()+strlen() essentially to determine
if the strings have expected length. If the length was correct, a buffer
overread was performed (or at least some garbage bytes were used from the
uninitialized part of the buffer). Let's do the length check first and then
only copy stuff if everything agrees.

For some reason the function was called "prepend", when it obviously does
an "append".

systemd-commit: 099c77fd5ff835614dea8dc11c57f6d44f77d9ee
Author: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Date:   Tue May 7 15:58:29 2019 +0200
The prefix for EMC Symmetrix pre-SPC VPD inquiry reply
is always SCSI_ID_NAA, so we need to hardcode it to
avoid false values here.

Signed-off-by: Hannes Reinecke <hare@suse.com>

systemd-commit: c0373eb019db70017878ee64d042de902e4c98ee
Author: Hannes Reinecke <hare@suse.de>
Date:   Wed Sep 13 09:08:28 2017 +0200
…n VPD page

The length of device identification VPD page is filled with two bytes,
but scsi_id only gets the low byte. Fix it.

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>

systemd-commit: 1f7b6872dbe8ccae1f3bda9aa6aeb87c9b42e01e
Author: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
Date:   Mon May 13 18:41:55 2019 +0800
@bbonev bbonev merged commit 221549a into eudev-project:master Oct 16, 2021
@bbonev bbonev deleted the s1scsi branch April 6, 2022 02:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants