diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2010-01-12 21:56:06 -0600 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2010-01-12 21:56:06 -0600 |
commit | 60a5b5cf5e87c644b52c08f04f0c14b4a11370ea (patch) | |
tree | a8a325844b3ad9620c5dd45ea1ee9ccc843f2148 /usr/auth.c | |
parent | 2bca7ca86cd7b2743a4611ba89c3963b8fddbd02 (diff) | |
download | open-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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } |