Back to index

openldap  2.4.31
unbind.c
Go to the documentation of this file.
00001 /* unbind.c - decode an ldap unbind operation and pass it to a backend db */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 1998-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 /* Portions Copyright (c) 1995 Regents of the University of Michigan.
00017  * All rights reserved.
00018  *
00019  * Redistribution and use in source and binary forms are permitted
00020  * provided that this notice is preserved and that due credit is given
00021  * to the University of Michigan at Ann Arbor. The name of the University
00022  * may not be used to endorse or promote products derived from this
00023  * software without specific prior written permission. This software
00024  * is provided ``as is'' without express or implied warranty.
00025  *
00026  */
00027 
00028 #include "portable.h"
00029 
00030 #include <stdio.h>
00031 
00032 #include <ac/socket.h>
00033 
00034 #include "slap.h"
00035 
00036 int
00037 do_unbind( Operation *op, SlapReply *rs )
00038 {
00039        Debug( LDAP_DEBUG_TRACE, "%s do_unbind\n",
00040               op->o_log_prefix, 0, 0 );
00041 
00042        /*
00043         * Parse the unbind request.  It looks like this:
00044         *
00045         *     UnBindRequest ::= NULL
00046         */
00047 
00048        Statslog( LDAP_DEBUG_STATS, "%s UNBIND\n", op->o_log_prefix,
00049               0, 0, 0, 0 );
00050 
00051        if ( frontendDB->be_unbind ) {
00052               op->o_bd = frontendDB;
00053               (void)frontendDB->be_unbind( op, rs );
00054               op->o_bd = NULL;
00055        }
00056 
00057        /* pass the unbind to all backends */
00058        (void)backend_unbind( op, rs );
00059 
00060        return 0;
00061 }
00062