FreeBSD/usr.sbin/jail/config.c
/*
 * See if a jail name matches a wildcard.
 */
See if a jail name matches a wildcard.
See if a jail name matches a wildcard .
int
wild_jail_match(const char *jname, const char *wname)
{
	const char *jc, *jd, *wc, *wd;
	for (jc = jname, wc = wname;
	     (jd = strchr(jc, '.')) && (wd = strchr(wc, '.'));
	     jc = jd + 1, wc = wd + 1)
		if (strncmp(jc, wc, jd - jc + 1) && strncmp(wc, "*.", 2))
			return 0;
	return (!strcmp(jc, wc) || !strcmp(wc, "*"));
}
int wild_jail_match ( const char * jname , const char * wname ) { const char * jc , * jd , * wc , * wd ; for ( jc = jname , wc = wname ; ( jd = strchr ( jc , ' ' ) ) && ( wd = strchr ( wc , ' ' ) ) ; jc = jd + 1 , wc = wd + 1 ) if ( strncmp ( jc , wc , jd - jc + 1 ) && strncmp ( wc , " " , 2 ) ) return 0 ; return ( ! strcmp ( jc , wc ) || ! strcmp ( wc , " " ) ) ; }
See if a jail name matches a wildcard.
See if a jail name matches a wildcard .
/*
	 * A non-final "*" component in the wild name matches a single jail
	 * component, and a final "*" matches one or more jail components.
	 */