1 /* init.c - initialize passwd backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2006 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
12 * A copy of this license is available in the file LICENSE in the
13 * top-level directory of the distribution or, alternatively, at
14 * <http://www.OpenLDAP.org/license.html>.
21 #include <ac/socket.h>
24 #include "back-passwd.h"
26 ldap_pvt_thread_mutex_t passwd_mutex;
28 AttributeDescription *ad_sn;
29 AttributeDescription *ad_desc;
32 passwd_back_initialize(
36 ldap_pvt_thread_mutex_init( &passwd_mutex );
38 bi->bi_open = passwd_back_open;
41 bi->bi_destroy = passwd_back_destroy;
44 bi->bi_db_config = passwd_back_db_config;
47 bi->bi_db_destroy = 0;
51 bi->bi_op_search = passwd_back_search;
52 bi->bi_op_compare = 0;
57 bi->bi_op_abandon = 0;
61 bi->bi_chk_referrals = 0;
63 bi->bi_connection_init = 0;
64 bi->bi_connection_destroy = 0;
77 rc = slap_str2ad( "sn", &ad_sn, &text );
78 if ( rc != LDAP_SUCCESS ) {
79 Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
80 "slap_str2ad(\"%s\") returned %d: %s\n",
84 rc = slap_str2ad( "description", &ad_desc, &text );
85 if ( rc != LDAP_SUCCESS ) {
86 Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
87 "slap_str2ad(\"%s\") returned %d: %s\n",
88 "description", rc, text );
100 ldap_pvt_thread_mutex_destroy( &passwd_mutex );
104 #if SLAPD_PASSWD == SLAPD_MOD_DYNAMIC
106 /* conditionally define the init_module() function */
107 SLAP_BACKEND_INIT_MODULE( passwd )
109 #endif /* SLAPD_PASSWD == SLAPD_MOD_DYNAMIC */