Tchater maintenant avec le support
Tchattez avec un ingénieur du support

Privilege Manager for Unix 6.1.1 - Administration Guide for Unix

One Identity Privileged Access Suite for Unix 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 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

hashtable_import

Syntax
int hashtable_import ( int hid, string filename )
Description

hashtable_import reads a specified file and uses the contents to create a hash table containing hash table entries, one per line, consisting of a single hash key, a colon, and a comma-separated list of hash values. The file may also contain comments delimited by the # character.

If successfully imported, it returns the number of entries in the hash table.

Example
#File admgroups.txt contains the formatted text 
unxadm:john,bob,fred,jane 
winadm:mary,chris,henry 

#policy loads this file into a hashtable that identifies the group permissions, 
hid=hashtable_create(); 
count=hashtable_import(hid, "/etc/opt/quest/qpm4u/tables/admgroups.txt"); 
printf("Import loaded %d groups\n", count); 
unxadm=hashtable_lookup(hid, "unxadm"); 
if (user !in unxadm) 
{ 
   reject "You are not authorized to run this command"; 
}

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 35: 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.

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.

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

Example

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

fprintf("/var/adm/pmlog", "%s\n", "End of file";
Related Topics

printf

print

Documents connexes