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

hashtable_lookup

Syntax
list hashtable_lookup ( int hid, string key)
Description

hashtable_lookup searches the specified hash table for the key.

If it finds the key, it returns the associated list, otherwise it returns an empty list.

Example
hid=hashtable_create(); 
hashtable_add(hid, "unxadm", {"johnd", "davel", "jamesp"}); 
hashtable_add(hid, "winadm", {"marym", "stevec", "janel"}); 
print("Windows Admin Group:" + hashtable_lookup(hid, "winadm")); 

Input and Output Functions

These are the built-in input and output functions available to use within the policy file:

Table 38: Input and output functions
Name Description

fprintf

Write a string to a file on the policy server.

input

Request input from the user.

inputnoecho

Request input from the user without echoing to the screen.

print

Print a string to stdout with newline.

printf

Print a string to stdout.

printnnl

Print a string to stdout without newline.

printvars

Print the policy variables to stdout.

readdir

Return the list of entries in a directory as a string.

readfile

Read from a file on the policy server.

sprintf

Format a string.

syslog

Log a message to the syslog file.

fprintf

Syntax
fprintf ( string filename, string format [, string expression...] )
Description

The fprintf function is similar to printf except that the first argument is a filename. It appends the formatted string to the specified file.

NOTE: For more information about formatting parameters, see the printf(3) man page.

This example appends the string "End of file" to the pmlog file in the specified format.

Example
fprintf("/var/adm/usertrace.txt", "User:%s, cmd:%s\n", user, command); 
Related Topics

printf

print

input

Syntax
string input( string prompt )
Description

input prompts the user to enter a single line of input and returns the entered string.

NOTE: If the user enters a string, use the atoi function to convert the string to an integer.

Example
menu_selection = input("Enter your selection: "); 
switch(atoi(menu_selection)) {
 … 
} 
Related Topics

atoi

inputnoecho

Related Documents