1 /* init.c - initialize passwd backend */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 1998-2014 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;
31 static BI_db_init passwd_back_db_init;
34 passwd_back_initialize(
38 ldap_pvt_thread_mutex_init( &passwd_mutex );
40 bi->bi_open = passwd_back_open;
43 bi->bi_destroy = passwd_back_destroy;
45 bi->bi_db_init = passwd_back_db_init;
49 bi->bi_db_destroy = 0;
53 bi->bi_op_search = passwd_back_search;
54 bi->bi_op_compare = 0;
59 bi->bi_op_abandon = 0;
63 bi->bi_chk_referrals = 0;
65 bi->bi_connection_init = 0;
66 bi->bi_connection_destroy = 0;
68 return passwd_back_init_cf( bi );
79 rc = slap_str2ad( "sn", &ad_sn, &text );
80 if ( rc != LDAP_SUCCESS ) {
81 Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
82 "slap_str2ad(\"%s\") returned %d: %s\n",
86 rc = slap_str2ad( "description", &ad_desc, &text );
87 if ( rc != LDAP_SUCCESS ) {
88 Debug( LDAP_DEBUG_ANY, "passwd_back_open: "
89 "slap_str2ad(\"%s\") returned %d: %s\n",
90 "description", rc, text );
102 ldap_pvt_thread_mutex_destroy( &passwd_mutex );
109 struct config_reply_s *cr
112 be->be_cf_ocs = be->bd_info->bi_cf_ocs;
116 #if SLAPD_PASSWD == SLAPD_MOD_DYNAMIC
118 /* conditionally define the init_module() function */
119 SLAP_BACKEND_INIT_MODULE( passwd )
121 #endif /* SLAPD_PASSWD == SLAPD_MOD_DYNAMIC */