getstringpasswd

Description

The getstringpasswd() function prompts the user for a password and compares the answer against the previously encrypted password.

The user’s failure to provide the correct password does not automatically result in a rejection of the secured task request. The policy should examine the result of the getstringpasswd() function and respond accordingly.

Syntax

result = getstringpasswd(encryptedpassword[, prompt [, attempts]]);

Arguments

encryptedpassword Required. An encrypted password, which can be generated by pbpasswd. The clear text form of this password is the password that the user is expected to enter.
prompt Optional. A user prompt that describes the desired password. If none is specified, then the default prompt Password: is used.
attempts Optional. Number of attempts the user gets to specify the correct password. The default value for attempts is 3.

Return Values

true The answer matched the password.
false The answer did not match the password.
result = getstringpasswd(<encrypted string>, "Please enter the Backup Task Password: ", 2);

In this example, result contains true if the user enters the correct Backup Task Password. If the correct password is not entered in two attempts, the function sets result to false.