From 60a5b5cf5e87c644b52c08f04f0c14b4a11370ea Mon Sep 17 00:00:00 2001 From: Mike Christie Date: Tue, 12 Jan 2010 21:56:06 -0600 Subject: iscsi tools: Allow empty username for CHAP Some iSCSI implementations (eg HP) is using an empty username for CHAP negotiations. So we should be allowing the same. Signed-off-by: Hannes Reinecke --- usr/auth.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usr/auth.c') diff --git a/usr/auth.c b/usr/auth.c index 4b9afb5..cc232a0 100644 --- a/usr/auth.c +++ b/usr/auth.c @@ -1892,8 +1892,10 @@ acl_set_user_name(struct iscsi_acl *client, const char *username) return AUTH_STATUS_ERROR; } - if (strlcpy(client->username, username, AUTH_STR_MAX_LEN) >= - AUTH_STR_MAX_LEN) { + if (!username) + client->username[0] = '\0'; + else if (strlcpy(client->username, username, AUTH_STR_MAX_LEN) >= + AUTH_STR_MAX_LEN) { client->phase = AUTH_PHASE_ERROR; return AUTH_STATUS_ERROR; } -- cgit v1.2.1