4 #include <netinet/in.h>
5 #include <arpa/inet.h> /* for inet_ntoa() */
6 extern struct group *getgrnam ();
11 #if !defined(MAXHOSTNAMELEN) || (MAXHOSTNAMELEN < 64)
13 @@ -178,6 +180,7 @@ static char *myhostname (void)
18 /* netgroup_match - match group against machine or user */
20 netgroup_match (const char *group, const char *machine, const char *user)
21 @@ -193,6 +196,7 @@ netgroup_match (const char *group, const
23 return innetgr (group, machine, user, mydomain);
27 /* user_match - match a username against one token */
28 static int user_match (const char *tok, const char *string)
29 @@ -214,8 +218,10 @@ static int user_match (const char *tok,
31 return (user_match (tok, string)
32 && from_match (at + 1, myhostname ()));
34 } else if (tok[0] == '@') { /* netgroup */
35 return (netgroup_match (tok + 1, (char *) 0, string));
37 } else if (string_match (tok, string)) { /* ALL or exact match */
39 } else if ((group = getgrnam (tok))) { /* try group membership */
40 @@ -271,9 +277,12 @@ static int from_match (const char *tok,
41 * contain a "." character. If the token is a network number, return YES
42 * if it matches the head of the string.
45 if (tok[0] == '@') { /* netgroup */
46 return (netgroup_match (tok + 1, string, (char *) 0));
47 - } else if (string_match (tok, string)) { /* ALL or exact match */
50 + if (string_match (tok, string)) { /* ALL or exact match */
52 } else if (tok[0] == '.') { /* domain: match last fields */
53 if ((str_len = strlen (string)) > (tok_len = strlen (tok))