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"
Description
osname returns an internal string representation of the operating system on the policy server, such as aix43-rs6k, linux-x86_64.
Example
printf("Policy server is running on OS:%s\n", osname());