xref: /netbsd-src/external/bsd/openldap/dist/servers/slapd/back-monitor/bind.c (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*	$NetBSD: bind.c,v 1.1.1.4 2014/05/28 09:58:50 tron Exp $	*/
2 
3 /* bind.c - monitor backend bind routine */
4 /* $OpenLDAP$ */
5 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
6  *
7  * Copyright 2001-2014 The OpenLDAP Foundation.
8  * Portions Copyright 2001-2003 Pierangelo Masarati.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted only as authorized by the OpenLDAP
13  * Public License.
14  *
15  * A copy of this license is available in file LICENSE in the
16  * top-level directory of the distribution or, alternatively, at
17  * <http://www.OpenLDAP.org/license.html>.
18  */
19 /* ACKNOWLEDGEMENTS:
20  * This work was initially developed by Pierangelo Masarati for inclusion
21  * in OpenLDAP Software.
22  */
23 
24 #include "portable.h"
25 
26 #include <stdio.h>
27 
28 #include <slap.h>
29 #include "back-monitor.h"
30 
31 /*
32  * At present, only rootdn can bind with simple bind
33  */
34 
35 int
36 monitor_back_bind( Operation *op, SlapReply *rs )
37 {
38 	Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n",
39 			op->o_req_dn.bv_val, 0, 0 );
40 
41 	if ( be_isroot_pw( op ) ) {
42 		return LDAP_SUCCESS;
43 	}
44 
45 	rs->sr_err = LDAP_INVALID_CREDENTIALS;
46 	send_ldap_result( op, rs );
47 
48 	return rs->sr_err;
49 }
50 
51