Syntax
int feature_enabled (int feature )
Description
feature_enabled checks whether a particular feature is enabled on the policy server. Use this function to detect support for platform-dependant features; currently these comprise FEATURE_LDAP and FEATURE_VAS (defined as integer constants).
Returns true if the feature is enabled, otherwise false.
Example
if (feature_enabled(FEATURE_LDAP))
{
if (proc_do_ldap_authentication(user))
{
accept;
}
}
Syntax
int fileexists ( string path )
int access ( string path )
Description
fileexists or access() determines whether the file fn or path exists on the policy server.
Returns true if the path name exists, false if not.
Example
if (fileexists("/opt/quest/pmc") ) {
print ("PMC is installed.");
}
if (access("/opt/quest/pmc") ) {
print ("PMC is installed.");
}
Related Topics
access
Syntax
int getopt ( string argv, string optstring))
Description
getopt breaks up command lines for easier parsing and legal review. It examines a list of arguments for short options, which is a dash followed by a single letter or parameter.
Example
while ((option = getopt(args, "vh")) !=""){
print("Matched option",option);
}
Syntax
int getopt_long ( string argv, string optstring, string long_options))
Description
getopt_long breaks up command lines for easier parsing and legal review. It examines a list of arguments for short or long options.
The function works in posixly correct mode and does not reorder arguments. However, if you unset the POSIXLY_CORRECT environment option, it reorders the argv variable as it scans, placing all nonoptions at the end of the list.
Example
while ((option = getopt_long(args, "vh",{"verbose","help"})) !=""){
print("Matched option",option);
}