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";
}
Description
lineno returns the current line number in the policy file.
Example
printf("TRACE: user:%s, cmd:%s, lineno:%d\n", user, command, lineno());
Syntax
string mktemp ( string template )
Description
mktemp returns a unique filename which is guaranteed not to exist on the policy server. Use the mktemp function to create unique temporary filenames.
For more information, see the mktemp(3) man page.
Example
#generate a unique filename-the XXXXXX chars will be replaced to construct a unique name
filename=mktemp("/tmp/pmXXXXXX");
print(filename); // prints "/tmp/pmAxK2de"