Chat now with support
Chat with Support

Safeguard for Sudo 2.0 - Administrators Guide

One Identity Privileged Access Suite for Unix Introducing Privilege Manager for Unix Introducing Privilege Manager for Sudo Planning Deployment Installation and Configuration
Download Privilege Manager for Unix Software Packages Download Privilege Manager for Sudo Software Packages Quick Start and Evaluation Configure a Primary Policy Server Configure a Secondary Policy Server Install PM Agent or Sudo Plugin on a Remote Host Remove Configurations
Upgrading Privilege Manager System Administration Managing Security Policy The Privilege Manager for Unix Security Policy Advanced Privilege Manager for Unix Configuration Administering Log and Keystroke Files InTrust Plug-in for Privilege Manager Troubleshooting Privilege Manager for Unix Policy File Components Privilege Manager Variables Privilege Manager for Unix Flow Control Statements Privilege Manager for Unix Built-in Functions and Procedures Privilege Manager Programs Installation Packages Unsupported Sudo Options Sudo Plugin Policy Evaluation About us

strftime

Syntax
string strftime (string format )
Description

strftime formats dates and times.

Note: For more information on the standard formats for dates and times, refer to the strftime(3) man pages.

Table 44: Standard date and time formats
%d Day of the month
%H 24 hour format
%I 12 hour format
%j Day of the year
%m Month number
%M Minute
%S Seconds
%w Weekday name
%h Abbreviated month name
Example
strftime("%m/%d/%Y") strftime("%H:%M") 

Returns the current date and time formatted, as follows:

03/17/2012 
13:05 

system

Syntax
string system( string command [, string input] )
Description

The system function runs the specified command on the policy server, taking input from and sending output to the users terminal. system can use an optional string parameter to pass an input string to a command instead of prompting the user for input.

system sets the status variable to the exit status of the command. Typically, the exit status of a command returns 0 if it is successful, and non-zero if it is not successful.

By default, the command runs as root, but you can set the subprocuser variable to a different user under which to run the command.

For security reasons, Quest recommends that you set the second parameter to " " (empty quotation marks) for all system calls that do not require user input.

Example
#list the contents of the directory /etc – and store the result as a string in "files". 
#The exit status is stored in "status" and should be 0 if ls succeeds. 
files=system("/bin/ls /etc"); 
if (status == 0) { …} 
#perform a NIS lookup for all known hosts and store the result in "hosts" variable. 
hosts=system("ypcat hosts"); 
if (status==0) {…} 
#send mail to "root" user – the second param contains the contents of the mail, which 
#will be passed to the mail program as standard input. 
system("mail root", "mail from QPM4U\n");

timebetween

Syntax
int timebetween ( int starttime, int endtime )
Description

The timebetween function returns a 0 or 1 depending on whether the current time is between those specified. Use this function to determine whether a user is submitting a request within valid business hours. Times must be specified using the 24-hour clock. Do not use leading zeroes for time specifications, because this will be interpreted in octal. For example, 12:30 am can be 30 or 2430.

Example
If (timebetween(800, 1630)) { 
   proc_working_hours_rules(); 
} else { 
   proc_outside_working_hours_rules(); 
}

tolower

Syntax
string tolower ( string expr )
Description

tolower converts all upper case characters in the string to lower case. Leaves all other characters unchanged. The tolower function is frequently used in search and comparison expressions to make them case-insensitive.

The following example accepts user inputs of "adrian", "Adrian", or "ADRIAN" and returns "adrian".

Example
#this returns "adrian" 
tolower("Adrian"); 
Related Documents