summaryrefslogtreecommitdiff
path: root/usr/auth.c
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2010-01-12 21:56:06 -0600
committerMike Christie <michaelc@cs.wisc.edu>2010-01-12 21:56:06 -0600
commit60a5b5cf5e87c644b52c08f04f0c14b4a11370ea (patch)
treea8a325844b3ad9620c5dd45ea1ee9ccc843f2148 /usr/auth.c
parent2bca7ca86cd7b2743a4611ba89c3963b8fddbd02 (diff)
downloadopen-iscsi-60a5b5cf5e87c644b52c08f04f0c14b4a11370ea.tar.gz
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 <hare@suse.de>
Diffstat (limited to 'usr/auth.c')
-rw-r--r--usr/auth.c6
1 files changed, 4 insertions, 2 deletions
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;
}