Lines Matching +defs:match +defs:string

31 #include <string.h>
57 /* login_access - match username/group and host/tty with access control file */
80 int match = NO;
85 * Process the table one line at a time and stop at the first match.
93 while (!match && fgets(line, sizeof(line), fp)) {
120 match = (list_match(froms, from, from_match)
127 return (match == 0 || (line[0] == '+'));
130 /* list_match - match an item against a list of tokens with exceptions */
137 int match = NO;
142 * a match, look for an "EXCEPT" list and recurse to determine whether
143 * the match is affected by any exceptions.
149 if ((match = (*match_fn)(tok, item)) != 0) /* YES */
154 if (match != NO) {
158 return (match);
163 /* netgroup_match - match group against machine or user */
173 /* user_match - match a username against one token */
176 user_match(const char *tok, const char *string)
183 * If a token has the magic value "ALL" the match always succeeds.
189 return (netgroup_match(tok + 1, (char *) 0, string));
190 } else if (string_match(tok, string)) { /* ALL or exact match */
195 if (strcasecmp(string, group->gr_mem[i]) == 0)
201 /* from_match - match a host or tty against a list of tokens */
204 from_match(const char *tok, const char *string)
210 * If a token has the magic value "ALL" the match always succeeds. Return
211 * YES if the token fully matches the string. If the token is a domain
212 * name, return YES if it matches the last fields of the string. If the
213 * token has the magic value "LOCAL", return YES if the string does not
215 * if it matches the head of the string.
219 return (netgroup_match(tok + 1, string, (char *) 0));
220 } else if (string_match(tok, string)) { /* ALL or exact match */
222 } else if (tok[0] == '.') { /* domain: match last fields */
223 if ((str_len = strlen(string)) > (tok_len = strlen(tok))
224 && strcasecmp(tok, string + str_len - tok_len) == 0)
227 if (strchr(string, '.') == 0)
230 && strncmp(tok, string, tok_len) == 0) {
236 /* string_match - match a string against one token */
239 string_match(const char *tok, const char *string)
243 * If the token has the magic value "ALL" the match always succeeds.
244 * Otherwise, return YES if the token fully matches the string.
249 } else if (strcasecmp(tok, string) == 0) { /* try exact match */