立即与支持人员聊天
与支持团队交流

Privilege Manager for Unix 7.0 - Administration Guide

Introducing Privilege Manager for Unix Planning Deployment Installation and Configuration Upgrade Privilege Manager for Unix 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 for Unix Troubleshooting Privilege Manager for Unix Policy File Components Privilege Manager for Unix Variables
Variable names Variable scope Global input variables Global output variables Global event log variables PM settings variables
Privilege Manager for Unix Flow Control Statements Privilege Manager for Unix Built-in Functions and Procedures
Environment functions Hash table functions Input and output functions LDAP functions LDAP API example List functions Miscellaneous functions Password functions Remote access functions String functions User information functions Authentication Services functions
Privilege Manager for Unix programs Installation Packages

rand

Syntax
int rand(int max )
Description

rand returns a random number less than the specified maximum.

Example
# print a random item from a list 
print(alist[rand(length(alist)]);

stat

Syntax
list stat ( string fn )
Description

stat returns information about a specified file on the policy server.

If the file fn exists on the policy server, stat returns the following list of values:

  • File size in bytes
  • File owner as username
  • File group as groupname
  • File permissions as octal
  • File change date in the format: YYYY/MM/DD
  • File change time in the format: HH:MM:SS
  • File change time in the format: seconds since the epoch
  • File access date in the format: YYYY/MM/DD
  • File access time in the format: HH:MM:SS
  • File access time in the format: seconds since the epoch
  • File modification date in the format: YYYY/MM/DD
  • File modification time in the format: HH:MM:SS
  • File modification time in the format: seconds since the epoch
  • File inode number

strftime

Syntax
string strftime (string format )
Description

strftime formats dates and times.

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

Table 42: 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
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, One Identity 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");
相关文档

The document was helpful.

选择评级

I easily found the information I needed.

选择评级