Syntax
string sprintf ( string format [, expression expr, ...])
Description
The sprintf function returns a formatted string.
For more information about formatting parameters, see the printf(3) man page.
Example
printf("User= %-8.8s Application: %s\n", user, app);
Prints the same as:
a=sprintf("User= %-8.8s Application: %s", user, app);
print(a);
Syntax
syslog ( string format [, expression expr, ...])
Description
syslog sends a formatted message to syslog as a LOG_INFO message.
For more information about configuring syslog messages, see the syslog(3) man page.
Example
syslog("Accepted request from %s@%s", user, submithost);
These are the built-in LDAP functions available to use within the pmpolicy file.
Syntax
int ldap_bind(integer ldapid, string userdn [, string password [, boolean trace]] )
Description
ldap_ bind binds an LDAP connection to the specified credentials. The LDAP ID must be a valid LDAP connection ID returned by ldap_open. You can require an optional password.
If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
If successful, it returns 0; otherwise it returns non-zero or an undefined variable.
Example
rc=ldap_bind(ldapid, "cn=admin", "Secretpassword");
if ((!defined rc) || (rc != 0))
{
reject "Bind to ldap directory failed";
}