We want to require that the filename begins with the correct string,
not just that it contains it somewhere.

Signed-off-by: Jeff Layton <[email protected]>
---
 cifs.upcall.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/cifs.upcall.c b/cifs.upcall.c
index 598a999..12d5900 100644
--- a/cifs.upcall.c
+++ b/cifs.upcall.c
@@ -181,10 +181,9 @@ err_cache:
 
 static int krb5cc_filter(const struct dirent *dirent)
 {
-       if (strstr(dirent->d_name, CIFS_DEFAULT_KRB5_PREFIX))
-               return 1;
-       else
-               return 0;
+       /* subtract 1 for the null terminator */
+       return !strncmp(dirent->d_name, CIFS_DEFAULT_KRB5_PREFIX,
+                       sizeof(CIFS_DEFAULT_KRB5_PREFIX) - 1);
 }
 
 static char *
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to