git: f9f091e7f75f - main - sysutils/sg3_utils: add partial patch from vendor
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 07 Aug 2025 08:20:32 UTC
The branch main has been updated by mm:
URL: https://cgit.FreeBSD.org/ports/commit/?id=f9f091e7f75fc1b7309bb9786ee6a0f54cbba933
commit f9f091e7f75fc1b7309bb9786ee6a0f54cbba933
Author: Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2025-08-07 08:08:24 +0000
Commit: Martin Matuska <mm@FreeBSD.org>
CommitDate: 2025-08-07 08:18:11 +0000
sysutils/sg3_utils: add partial patch from vendor
Add patch to fix --contents= and --cfile= handling in sg_wr_mode
Patch source:
https://github.com/hreinecke/sg3_utils/commits/c27880048df5269e1cf6a32291505f86d7a8dcc1
---
sysutils/sg3_utils/Makefile | 2 +-
sysutils/sg3_utils/files/patch-src_sg__wr__mode.c | 28 +++++++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/sysutils/sg3_utils/Makefile b/sysutils/sg3_utils/Makefile
index 0520e6ca68f9..ac9542b2d491 100644
--- a/sysutils/sg3_utils/Makefile
+++ b/sysutils/sg3_utils/Makefile
@@ -1,6 +1,6 @@
PORTNAME= sg3_utils
DISTVERSION= 1.48
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= sysutils
MASTER_SITES= http://sg.danny.cz/sg/p/
diff --git a/sysutils/sg3_utils/files/patch-src_sg__wr__mode.c b/sysutils/sg3_utils/files/patch-src_sg__wr__mode.c
new file mode 100644
index 000000000000..e9e1c7c2c7cb
--- /dev/null
+++ b/sysutils/sg3_utils/files/patch-src_sg__wr__mode.c
@@ -0,0 +1,28 @@
+--- src/sg_wr_mode.c.orig 2023-06-24 02:05:48 UTC
++++ src/sg_wr_mode.c
+@@ -374,17 +374,23 @@ main(int argc, char * argv[])
+ }
+ }
+ 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;
+ }
+