[packages/lin_tape] - strncpy has been finally removed in kernel 7.2
baggins
baggins at pld-linux.org
Wed Sep 2 00:18:00 CEST 2026
commit cdd0f4b178e339151676145c3ce158d2fba3f00d
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Wed Sep 2 00:17:33 2026 +0200
- strncpy has been finally removed in kernel 7.2
lin_tape.spec | 2 ++
no-strncpy.patch | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
---
diff --git a/lin_tape.spec b/lin_tape.spec
index 4f35a4e..68c4e86 100644
--- a/lin_tape.spec
+++ b/lin_tape.spec
@@ -23,6 +23,7 @@ Patch3: kernel-6.1.patch
Patch4: kernel-6.15.patch
Patch5: kernel-6.16.patch
Patch6: kernel-7.0.patch
+Patch7: no-strncpy.patch
# System Storage, Tape systems, Tape drivers and software, Tape device drivers (Linux)
URL: http://www.ibm.com/support/fixcentral/
BuildRequires: rpmbuild(macros) >= 1.701
@@ -77,6 +78,7 @@ compatible platforms.\
%patch -P4 -p1
%patch -P5 -p1
%patch -P6 -p1
+%patch -P7 -p1
install -p %{SOURCE1} .
diff --git a/no-strncpy.patch b/no-strncpy.patch
new file mode 100644
index 0000000..654976d
--- /dev/null
+++ b/no-strncpy.patch
@@ -0,0 +1,22 @@
+--- lin_tape-3.0.71/resolve_ibm_hp.c~ 2025-06-30 16:30:30.000000000 +0200
++++ lin_tape-3.0.71/resolve_ibm_hp.c 2026-09-02 00:15:27.329906823 +0200
+@@ -992,7 +992,7 @@
+ if (size >= MAX_SIZE) {
+ size = MAX_SIZE-1;
+ }
+- strncpy(string, in_string, size);
++ strscpy(string, in_string, size);
+ string[size] = '\0';
+ if (string[size-1] == '\n') {
+ string[size-1] = '\0';
+--- lin_tape-3.0.71/fo_util.c~ 2025-06-30 16:30:30.000000000 +0200
++++ lin_tape-3.0.71/fo_util.c 2026-09-02 00:15:56.166538201 +0200
+@@ -162,7 +162,7 @@
+ strcpy(debug_buffer+debug_tail, tmp);
+ debug_tail += count;
+ } else {
+- strncpy(debug_buffer+debug_tail, tmp,
++ strscpy(debug_buffer+debug_tail, tmp,
+ DEBUG_BUFFER_SIZE-1-debug_tail);
+ debug_buffer[DEBUG_BUFFER_SIZE-1] = '\0';
+ strcpy(debug_buffer,
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/lin_tape.git/commitdiff/cdd0f4b178e339151676145c3ce158d2fba3f00d
More information about the pld-cvs-commit
mailing list