Syntax
int glob ( string pattern, string str )
Description
glob matches a string to a pattern. This match is often used for filenames since the patterns are the same ones that the UNIX shell uses for filename matching.
For more information, see the fnmatch(3) man page.
Returns true if the string matches the pattern, otherwise false.
Example
#this returns true because the “*” wildcard character matches any number of any character
glob("a*b", "axyzb")
#this returns true because the “.” Is interpreted as a literal period char.
glob("a.*b", "a.fgb")
Table 41: Search patterns
j* |
j followed by any number of characters. |
j*e |
j followed by any number of characters, ending with an e. |
[jJ]* |
Upper or lower case j followed by any number of characters. |
[a-z] |
Any lower case character. |
[^a-z] |
Any character except lower case characters. |
j followed by a single character. |
Syntax
int ingroup ( string user, string group )
Description
ingroup returns true if the specified user is in the specified UNIX group on the policy server; otherwise returns false.
Example
if (ingroup("cory", "admin") ) {
accept;
}
Syntax
int innetgroup ( string netgroup, string host )
Description
innetgroup returns true if the specified host is in the specified NIS netgroup on the policy server; otherwise returns false.
Example
if ( ! innetgroup("submithosts", submithost)) {
reject "You are not permitted to submit a command from this host";
}
Syntax
int innetuser (string netgroup, string user)
int inusernetgroup (string netgroupname, string username)
Description
innetuser or inusernetgroup returns true if the specified user is in the specified NIS netgroup or other specified group on the policy server; otherwise the function returns false.
Example
if ( ! innetuser("submitusers", user)) {
reject "You are not permitted to submit a command from this host";
}
if ( ! inusernetgroup("submitusers", user)) {
reject "You are not permitted to submit a command from this host";
}