[PATCH] scsi: target: iscsi: Replace strlcat() with snprintf()

From: Mariia Nikitash

Date: Tue Nov 10 2026 - 05:29:19 EST


In preparation for removing the deprecated strlcat() API[1], replace
the strlcat() call with snprintf() to construct the AuthMethod value
directly from param->value.

Since buf1 contains unmodified copy of param->value, formatting
original value and suffix together preserves the NUL-terminated
output, including partial or omitted ",None" suffixes when the
256-byte buffer is too small.

Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Mariia Nikitash <nikitash.mariiaw@xxxxxxxxx>
---
drivers/target/iscsi/iscsi_target_tpg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index 99772364c88e..aad82a37538f 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -624,7 +624,7 @@ int iscsit_ta_authentication(struct iscsi_portal_group *tpg, u32 authentication)
none = strstr(buf1, NONE);
if (none)
goto out;
- strlcat(buf1, "," NONE, sizeof(buf1));
+ snprintf(buf1, sizeof(buf1), "%s," NONE, param->value);
if (iscsi_update_param_value(param, buf1) < 0)
return -EINVAL;
}
--
2.43.0