scst: Add support for wildcard matching to the copy manager

Reported-by: L <514005989@qq.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9150 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-09-05 04:21:56 +00:00
parent bd3aa5d4a5
commit ad546b1e68
3 changed files with 4 additions and 2 deletions

View File

@@ -2823,7 +2823,7 @@ static bool scst_cm_check_access_acg(const char *initiator_name,
if (default_acg)
goto found;
list_for_each_entry(acn, &acg->acn_list, acn_list_entry) {
if (strcmp(acn->name, initiator_name) == 0)
if (wildcmp(acn->name, initiator_name))
goto found;
}
}

View File

@@ -379,6 +379,8 @@ int scst_del_free_acg(struct scst_acg *acg, bool close_sessions);
void scst_get_acg(struct scst_acg *acg);
void scst_put_acg(struct scst_acg *acg);
bool wildcmp(const char *wild, const char *string);
struct scst_acg *scst_tgt_find_acg(struct scst_tgt *tgt, const char *name);
struct scst_acg *scst_find_acg(const struct scst_session *sess);

View File

@@ -7132,7 +7132,7 @@ static bool __wildcmp(const char *wild, const char *string, int recursion_level)
*
* Also see comment for __wildcmp().
*/
static bool wildcmp(const char *wild, const char *string)
bool wildcmp(const char *wild, const char *string)
{
return __wildcmp(wild, string, 0);
}