Syntax
int atoi ( string nptr )
Description
atoi converts the string representation of a decimal integer to an integer. If the string does not contain a number, it produces a syntax error and rejects the session.
This function returns the converted integer.
Example
x=atoi("123");
printf("%d\n", x);
Returns: 123
Syntax
int authenticate_pam ( string user [, string service] )
Description
The authenticate_pam function authenticates a user by means of the PAM (Pluggable Authentication Method) APIs on the policy servers.
For more information on how to configure PAM, consult the documentation for your platform.
The service parameter identifies the name of the PAM service to use to authenticate the user. This can be any valid service name configured in the PAM system configuration. It defaults to the PAM service "login".
This function returns 0 to indicate failure and 1 to indicate success.
Example
if (user=="paul" && basename(command)=="useradd")
{
if (!authenticate_pam(user, "sshd"))
{
reject;
}
runuser="root";
accept;
}
Syntax
int authenticate_pam_toclient ( string user [, string service] )
Description
The authenticate_pam_toclient function authenticates a user by means of the PAM (Pluggable Authentication Method) APIs on the policy server.
For more information on how to configure PAM, consult the documentation for your platform.
The service parameter identifies the name of the PAM service to use to authenticate the user. This can be any valid service name configured in the PAM system configuration. It defaults to the PAM service "login".
This function returns 0 to indicate failure and 1 to indicate success.
Example
if (user=="paul" && basename(command)=="useradd")
{
if (!authenticate_pam_toclient(user, "sshd"))
{
reject;
}
runuser="root";
accept;
}
Syntax
string basename ( string pathname )
Description
basename returns the filename portion of a pathname. It does not check that either the filename or path exist.
Example
print(basename("/var/adm/pm.log"));
Returns: "pm.log"