open-iscsi/0012-Remove-session-info-password-print.patch
Wenchao Hao 03045f674c Remove useless patch
remove patch 0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch

This patch get iscsid's pid from pidfile /var/run/iscsid.pid, and judge
if iscsid is alive according to that pid. While now iscsid.service would
not hold a pidfile, so this patch can not work as desired.

What's more, iscsiadm would try to connect to iscsid before send request
to iscsid, if iscsid is not alive, the connection would failed and
return error.

At wrost, if iscsid died after connect success, it would timeout after
1 second. And the patch
0009-fix-iscsiadm-op-new-report-to-cannot-rename-error.patch can not fix
this too.

Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
2022-02-08 19:42:25 +08:00

57 lines
1.7 KiB
Diff

From fe6458547a2e6dd6c7dd8246738e0c8a73478171 Mon Sep 17 00:00:00 2001
From: Wenchao Hao <haowenchao@huawei.com>
Date: Tue, 25 Jan 2022 19:36:35 +0800
Subject: [PATCH] Remove session info password print
In consideration of security, password should not be printed
in log, so this patch remove password printing in code.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
---
usr/session_info.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
diff --git a/usr/session_info.c b/usr/session_info.c
index 0dae82f..b9c406f 100644
--- a/usr/session_info.c
+++ b/usr/session_info.c
@@ -268,7 +268,6 @@ void session_info_print_tree(struct iscsi_session **ses, uint32_t se_count,
int32_t tgt_reset_tmo = -1;
int32_t lu_reset_tmo = -1;
int32_t abort_tmo = -1;
- const char *pass = NULL;
for (i = 0; i < se_count; ++i) {
curr = ses[i];
@@ -403,24 +402,15 @@ void session_info_print_tree(struct iscsi_session **ses, uint32_t se_count,
if (!do_show)
printf("%s\t\tpassword: %s\n", prefix,
"********");
- else {
- pass = iscsi_session_password_get(curr);
+ else
printf("%s\t\tpassword: %s\n", prefix,
- strlen(pass) ? pass : UNKNOWN_VALUE);
- }
+ "********");
printf("%s\t\tusername_in: %s\n", prefix,
strlen(iscsi_session_username_in_get(curr)) ?
iscsi_session_username_in_get(curr) :
UNKNOWN_VALUE);
- if (!do_show)
- printf("%s\t\tpassword_in: %s\n", prefix,
- "********");
- else {
- pass = iscsi_session_password_in_get(curr);
- printf("%s\t\tpassword: %s\n", prefix,
- strlen(pass) ? pass : UNKNOWN_VALUE);
- }
+ printf("%s\t\tpassword_in: %s\n", prefix,"********");
}
if (flags & SESSION_INFO_ISCSI_PARAMS)
--
1.8.3.1