iscsi-target: chap auth shouldn't match username with trailing garbage
authorEric Seppanen <eric@purestorage.com>
Wed, 20 Nov 2013 22:19:52 +0000 (14:19 -0800)
committerNicholas Bellinger <nab@linux-iscsi.org>
Thu, 21 Nov 2013 06:03:57 +0000 (22:03 -0800)
commit86784c6bdeeef78eed94d298be7a8879f6a97ee2
tree8a73f73d36e0051f0cf7a40ca85a3cae7375b0c6
parent369653e4fb511928511b0ce81f41c812ff1f28b6
iscsi-target: chap auth shouldn't match username with trailing garbage

In iSCSI negotiations with initiator CHAP enabled, usernames with
trailing garbage are permitted, because the string comparison only
checks the strlen of the configured username.

e.g. "usernameXXXXX" will be permitted to match "username".

Just check one more byte so the trailing null char is also matched.

Signed-off-by: Eric Seppanen <eric@purestorage.com>
Cc: <stable@vger.kernel.org> #3.1+
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_auth.c