HP-UX Directory Server 8.1 plug-in reference

Table Of Contents
Note:
You do not need to free the values returned by the “slapi_filter_get_ava()”,
“slapi_filter_get_type()”, and “slapi_filter_get_subfilt()” functions.
5.7.4 Converting a string to a filter
A search filter can be represented by either the data type “Slapi_Filteror as a string. In a
parameter block for a search operation, SLAPI_SEARCH_FILTER is a filter of the data type
Slapi_Filter and SLAPI_SEARCH_STRFILTER is the string representation of that filter. In
general, it is easier to specify a filter as a string than it is to construct a filter from the type
Slapi_Filter.
To convert the string representation of a filter into a filter of the data type Slapi_Filter, call
the “slapi_str2filter()” function.
When you have finished working with the filter, you should free it from memory by calling the
“slapi_filter_free()” function.
5.7.5 Creating complex filters by combining Filters
You can use AND, OR and NOT to combine different filters to create a complex filter. You can
use the “slapi_filter_join()” function to create these types of filters.
The slapi_filter_join() function returns the complex filter that you created. When you
have finished using the complex filter, you should free it from memory by calling
“slapi_filter_free()”.
Filters of the type LDAP_FILTER_NOT can have only one component. If the filter type (ftype)
is LDAP_FILTER_NOT, you must pass a NULL value for the second filter when calling
slapi_filter_join().
5.8 Checking passwords
By default, Directory Server uses the userPassword attribute to store the credentials for an
entry. The server encodes the password using the scheme specified in the
nsslapd-rootpwstoragescheme or passwordStorageScheme attributes of the cn=config
entry contained in the dse.ldif file. The scheme can be any of the following:
CLEAR
No encryption is used, and can be defined using the clear-password-storage-scheme
plug-in.
CRYPT
Uses the Unix crypt algorithm, and can be defined using the
crypt-password-storage-scheme plug-in.
SHA
Uses the Secure Hashing Algorithm, and can be defined using the
sha-password-storage-scheme plug-in.
SSHA
Uses the Salted Secure Hashing Algorithm, and can be defined using the
ssha-password-storage-scheme plug-in.
To determine if a given password is one of the values of the userPassword attribute, call the
slapi_pw_find_sv() function. This function determines which password scheme was used to
store the password and uses the appropriate comparison function to compare a given value
against the encrypted values of the userPassword attribute.
56 Front end API functions