]> git.sur5r.net Git - openldap/blob - libraries/libldap/cancel.c
append trailing slash to AD canonical if DN is exactly a domain (ITS#3000)
[openldap] / libraries / libldap / cancel.c
1 /* $OpenLDAP$ */
2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3  *
4  * Copyright 1998-2004 The OpenLDAP Foundation.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted only as authorized by the OpenLDAP
9  * Public License.
10  *
11  * A copy of this license is available in the file LICENSE in the
12  * top-level directory of the distribution or, alternatively, at
13  * <http://www.OpenLDAP.org/license.html>.
14  */
15
16 /*
17  * LDAPv3 Cancel Operation Request
18  */
19
20 #include "portable.h"
21
22 #include <stdio.h>
23 #include <ac/stdlib.h>
24
25 #include <ac/socket.h>
26 #include <ac/string.h>
27 #include <ac/time.h>
28
29 #include "ldap-int.h"
30 #include "ldap_log.h"
31
32 int
33 ldap_cancel(
34         LDAP            *ld,
35         int             cancelid,
36         LDAPControl     **sctrls,
37         LDAPControl     **cctrls,
38         int             *msgidp )
39 {
40         BerElement *cancelidber = NULL;
41         struct berval *cancelidvalp = NULL;
42         int rc;
43
44         cancelidber = ber_alloc_t( LBER_USE_DER );
45         ber_printf( cancelidber, "{i}", cancelid );
46         ber_flatten( cancelidber, &cancelidvalp );
47         rc = ldap_extended_operation( ld, LDAP_EXOP_X_CANCEL,
48                         cancelidvalp, sctrls, cctrls, msgidp );
49         ber_free( cancelidber, 1 );
50         return rc;
51 }
52
53 int
54 ldap_cancel_s(
55         LDAP            *ld,
56         int             cancelid,
57         LDAPControl     **sctrls,
58         LDAPControl     **cctrls )
59 {
60         BerElement *cancelidber = NULL;
61         struct berval *cancelidvalp = NULL;
62         int rc;
63
64         cancelidber = ber_alloc_t( LBER_USE_DER );
65         ber_printf( cancelidber, "{i}", cancelid );
66         ber_flatten( cancelidber, &cancelidvalp );
67         rc = ldap_extended_operation_s( ld, LDAP_EXOP_X_CANCEL,
68                         cancelidvalp, sctrls, cctrls, NULL, NULL );
69         ber_free( cancelidber, 1 );
70         return rc;
71 }
72