Back to index

openldap  2.4.31
bind.c
Go to the documentation of this file.
00001 /* bind.c - monitor backend bind routine */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 2001-2012 The OpenLDAP Foundation.
00006  * Portions Copyright 2001-2003 Pierangelo Masarati.
00007  * All rights reserved.
00008  *
00009  * Redistribution and use in source and binary forms, with or without
00010  * modification, are permitted only as authorized by the OpenLDAP
00011  * Public License.
00012  *
00013  * A copy of this license is available in file LICENSE in the
00014  * top-level directory of the distribution or, alternatively, at
00015  * <http://www.OpenLDAP.org/license.html>.
00016  */
00017 /* ACKNOWLEDGEMENTS:
00018  * This work was initially developed by Pierangelo Masarati for inclusion
00019  * in OpenLDAP Software.
00020  */
00021 
00022 #include "portable.h"
00023 
00024 #include <stdio.h>
00025 
00026 #include <slap.h>
00027 #include "back-monitor.h"
00028 
00029 /*
00030  * At present, only rootdn can bind with simple bind
00031  */
00032 
00033 int
00034 monitor_back_bind( Operation *op, SlapReply *rs )
00035 {
00036        Debug(LDAP_DEBUG_ARGS, "==> monitor_back_bind: dn: %s\n", 
00037                      op->o_req_dn.bv_val, 0, 0 );
00038 
00039        if ( be_isroot_pw( op ) ) {
00040               return LDAP_SUCCESS;
00041        }
00042 
00043        rs->sr_err = LDAP_INVALID_CREDENTIALS;
00044        send_ldap_result( op, rs );
00045 
00046        return rs->sr_err;
00047 }
00048