From e329cc5abb1380a2a6b2d86c17ea622b20b37a27 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 28 Aug 2013 22:47:21 +0000 Subject: [PATCH] Make SCST patters matching, for instance, to match initiator names to their group names, case insensitive git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4981 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/usr/target.c | 4 ++-- scst/src/scst_targ.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/iscsi-scst/usr/target.c b/iscsi-scst/usr/target.c index 05cee9d15..2d475edb1 100644 --- a/iscsi-scst/usr/target.c +++ b/iscsi-scst/usr/target.c @@ -68,7 +68,7 @@ static int __wildcmp(const char *wild, const char *string, int recursion_level) if ((*wild == '!') && (recursion_level == 0)) return !__wildcmp(++wild, string, ++recursion_level); - if ((*wild != *string) && (*wild != '?')) + if ((tolower(*wild) != tolower(*string)) && (*wild != '?')) return 0; wild++; @@ -85,7 +85,7 @@ static int __wildcmp(const char *wild, const char *string, int recursion_level) mp = wild; cp = string+1; - } else if ((*wild == *string) || (*wild == '?')) { + } else if ((tolower(*wild) == tolower(*string)) || (*wild == '?')) { wild++; string++; } else { diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index c9800fdf2..35f0fcbb5 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -6396,7 +6397,7 @@ static bool __wildcmp(const char *wild, const char *string, int recursion_level) if ((*wild == '!') && (recursion_level == 0)) return !__wildcmp(++wild, string, ++recursion_level); - if ((*wild != *string) && (*wild != '?')) + if ((tolower(*wild) != tolower(*string)) && (*wild != '?')) return false; wild++; @@ -6413,7 +6414,7 @@ static bool __wildcmp(const char *wild, const char *string, int recursion_level) mp = wild; cp = string+1; - } else if ((*wild == *string) || (*wild == '?')) { + } else if ((tolower(*wild) == tolower(*string)) || (*wild == '?')) { wild++; string++; } else {