Chatta subito con l'assistenza
Chat con il supporto

Privilege Manager for Unix 7.2.1 - 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

switch

Syntax
switch (string) 
{ 
   case expression1: 
      statement1a; [statement1b; …] [break;] 
   case expression2: 
      statement2a; [statement2b; …] [break;] 
   default: statement3a; [statement3b; …] [break;] 
}
Description

The switch statement tests whether an expression matches one of several values (each of which is specified in a case statement) and branches accordingly. If a case matches the value, execution will begin at that case falling through to subsequent cases until a break statement occurs. The break statement forces an immediate exit from the switch statement; it is optional.

The default statement runs if none of the cases match the value. This statement is optional. If there is no default and none of the cases match the value, nothing happens. Case statements can be in any order, but the default statement, if present, must occur after all of the case statements.

Examples
switch (user) { 
   case "leslie": 
      runuser="sys"; 
      break; 
   case "adrian": 
      accept; 
   case "cory": 
   case "jamie": 
      runuser = "root"; 
      accept; 
   default: 
      reject; 
} 

switch (gidnum){ 
   case 0: runuser="root"; break; 
   default: break; 
}

See Example 9: Switch and case statements for additional usage examples.

while

Syntax
while ( expression ) statement
Description

The while statement is a looping statement. It repeatedly runs the specified statement while the specified expression evaluates to true (any non-zero value). The while statement terminates when the specified expression evaluates to false (the value 0) or it encounters a break statement.

The specified statement may not run if the specified expression initially evaluates to false (unlike the do-while statement, which always runs its specified statement at least once).

Use a statement block in the form { statement ... } to run multiple statements in the loop. One Identity recommends using a statement block for readability.

Examples

This prints the values 1,2,3,4,5:

x = 1; 
while (x <= 5) print(x++);

This prints the values 1,2,3,4,5 and uses a statement block:

x = 1; 
while (x <= 5) { 
   print(x); 
   x++; 
}

This prints the values 1,2,3 because the break statement terminates the loop:

x=1; 
while (x <= 5) { 
   if (x > 3) break; 
   print(x++); 
}

See Use the while loop for more usage examples.

Privilege Manager for Unix Built-in Functions and Procedures

This section documents the syntax and usage of the built-in functions and procedures that are available to use within the policy file. They are listed in the following categories:

Environment functions

These are the built-in environment functions available to use within the policy file.

Table 34: Environment functions
Name Description
getenv Return the value of an environment variable in runenv.
getlistsetting Return a list of the settings in the current policy server host settings file.
getnumericsetting Return the integer of the numeric setting in the current policy server host settings file.
getstringsetting Returns the value of a string setting in the current policy server host settings file.
getyesnosetting Returns the value of a yes/no setting in the current policy server host settings file.
keepenv Remove all except the specified variables from the runenv.

policygetenv

Set the value of the local variable to the value of the environment variable on the policy server.

policysetenv

Locally set the environment variable on the policy server host.

policyunsetenv

Locally unset an environment variable on the policy server.

setenv Set a runtime environment variable.

unsetenv

Remove an environment variable from the runtime environment

Related Documents

The document was helpful.

Seleziona valutazione

I easily found the information I needed.

Seleziona valutazione