]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix name parsing in CIFSSMBQAllEAs
authorJeff Layton <jlayton@redhat.com>
Tue, 26 Jul 2011 22:23:47 +0000 (18:23 -0400)
committerSteve French <sfrench@us.ibm.com>
Sun, 31 Jul 2011 21:21:09 +0000 (21:21 +0000)
commit7b6bcc8b4e00ea6249975ff81e76a80c00f6b380
treeb233806b287b9b97f9c085f2e0dc280d031961ed
parentfbc2c6c5fc30a57df22de073bbe978a69d1fe8d9
cifs: fix name parsing in CIFSSMBQAllEAs

The code that matches EA names in CIFSSMBQAllEAs is incorrect. It
uses strncmp to do the comparison with the length limited to the
name_len sent in the response.

Problem: Suppose we're looking for an attribute named "foobar" and
have an attribute before it in the EA list named "foo". The
comparison will succeed since we're only looking at the first 3
characters. Fix this by also comparing the length of the provided
ea_name with the name_len in the response. If they're not equal then
it shouldn't match.

Reported-by: Jian Li <jiali@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Reviewed-by: Pavel Shilovsky <piastryyy@gmail.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
fs/cifs/cifssmb.c