Syntax
int lineno( )
Description
lineno returns the current line number in the policy file.
Example
printf("TRACE: user:%s, cmd:%s, lineno:%d\n", user, command, lineno());
int lineno( )
lineno returns the current line number in the policy file.
printf("TRACE: user:%s, cmd:%s, lineno:%d\n", user, command, lineno());
string mktemp ( string template )
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.
#generate a unique filename–the XXXXXX chars will be replaced to construct a unique name filename=mktemp("/tmp/pmXXXXXX"); print(filename); // prints "/tmp/pmAxK2de"
string osname( )
osname returns an internal string representation of the operating system on the policy server, such as aix43-rs6k, linux-x86_64.
printf("Policy server is running on OS:%s\n", osname());
string quote( string str [, string esc[, string surrounding_string]] )
The quote function puts the specified string between quotation marks. It inserts the "\" (backslash) character as required to "quote" any occurrences of the characters in the second argument to indicate that they are taken literally. The string is surrounded by a "surrounding_string" and defaults to the value of esc, which is optional and defaults to the value of the specified escape character. UThe quote function is useful when parsing arguments into commands which are shell scripts. The default escape character is a single quote.
#this function will return: [This won\'t fail.] quote("This won't fail.", "'");
© ALL RIGHTS RESERVED. Términos de uso Privacidad Cookie Preference Center