1 /* unbind.c - sock backend unbind function */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2007-2013 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>.
17 * This work was initially developed by Brian Candler for inclusion
18 * in OpenLDAP Software.
25 #include <ac/socket.h>
26 #include <ac/string.h>
29 #include "back-sock.h"
37 struct sockinfo *si = (struct sockinfo *) op->o_bd->be_private;
40 if ( (fp = opensock( si->si_sockpath )) == NULL ) {
41 send_ldap_error( op, rs, LDAP_OTHER,
42 "could not open socket" );
46 /* write out the request to the unbind process */
47 fprintf( fp, "UNBIND\n" );
48 fprintf( fp, "msgid: %ld\n", (long) op->o_msgid );
49 sock_print_conn( fp, op->o_conn, si );
50 sock_print_suffixes( fp, op->o_bd );
53 /* no response to unbind */