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";
}
Syntax
int ldap_count_entries(int ldapid, ldapresult searchresult[, boolean trace] )
Description
ldap_count_entries returns the number of LDAP entries found by a previous call to ldap_search.
If the optional trace parameter is set to true, any errors or warnings from the LDAP function are written to stdout.
Example
# search for all Users at base level
searchresults= ldap_search( ldapid, 'ou=Users,dn=ldap,dn=domain,dn=com',
'onelevel', '(objectClass=*)' );
if (ldap_count_entries(ldapid, searchresults) == 0)
{
reject "Found no users";
}