Chatee ahora con Soporte
Chat con el soporte

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

accept, reject

Syntax
accept [from ["user"][, ["submithost"][, ["command"]
[, ["runhost"]]]]] [when conditional-expression]
[with optional-statements-before-execution];
reject ["reject-text"] [from ["user"][, ["submithost"]
[, ["command"][, ["runhost"]]]]]
[when conditional-expression];
Description

The accept statement accepts the job request submitted by a user. The reject statement denies the request. After a command is accepted, nothing else in the configuration script is run. If neither an accept nor reject statement is reached while parsing the configuration file, the command is rejected by default. A default reject message is displayed to the user if no message is specified with the reject statement. If a null string is specified, then the command is rejected silently.

The expanded form of the accept and reject statements make it possible to accept or reject a command based on the criteria "who", "what", and "where" without using conditional statements.

Examples
adminusers = {"dan","robyn"}; 
adminprogs = {"hostname","kill","csh","ksh"}; 
if (user in adminusers && command in adminprogs) 
{ 
   runuser = "root"; 
   if (user == "dan" && !officehours) 
   { 
      reject "You can't use “ + runcommand + “ outside office hours\n"; #custom msg 

   } 
   if (user == "robyn" && !officehours) 
   { 
      if (!getuserpasswd(user)) 
         reject ; #use default reject msg 
   } 
   accept; 
} 
else 
{ 
   reject ""; #reject silently - no msg displayed to the user 
}

break

Syntax
break;
Description

The break statement exits a loop and terminates cases. Use to force an immediate exit in case statements and looping statements such as for, while, and do-while statements.

Example
for ( oneuser in userlist ) 
{ 
   if (oneuser == "root") 
   { 
      break; 
   } 
   print(oneuser); 
}

continue

Syntax
continue;
Description

Use the continue statement in the body of a C-style for loop, while, or do-while statement to skip the rest of the statements in the body of the loop and start again from the top of the loop.

Example
for ( oneuser in userlist ) 
{ 
   if (oneuser == "root") 
   { 
      continue; 
   } 
      print(oneuser); 
}

do-while

Syntax
dostatement while ( expression ) ;
Description

The do-while statement is a looping statement. It repeatedly runs the specified statement until the specified expression evaluates to false (the value 0) or it encounters a break statement.

The specified statement runs at least once (unlike the while statement, which may terminate immediately).

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; 
do print(x++); while (x <= 5);

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

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

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

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

The document was helpful.

Seleccionar calificación

I easily found the information I needed.

Seleccionar calificación