From 9f55af00ce6a06dd5f4a78f23855ac449d92322b Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Wed, 12 Nov 2008 00:11:53 +0000 Subject: [PATCH] ITS#5408 part 11 - notice Abandon. --- servers/slapd/back-ldif/ldif.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 312f68ed41..88f19b0134 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -406,6 +406,9 @@ ldif_write_entry( int fd, entry_length; char *entry_as_string, *tmpfname; + if ( op->o_abandon ) + return SLAPD_ABANDON; + if ( parentdir != NULL && mkdir( parentdir, 0750 ) < 0 ) { save_errno = errno; Debug( LDAP_DEBUG_ANY, "ldif_write_entry: %s \"%s\": %s\n", @@ -499,6 +502,12 @@ ldif_read_entry( char *entry_as_string; struct berval rdn; + /* TODO: Does slapd prevent Abandon of Bind as per rfc4511? + * If so we need not check for LDAP_REQ_BIND here. + */ + if ( op->o_abandon && op->o_tag != LDAP_REQ_BIND ) + return SLAPD_ABANDON; + rc = ldif_read_file( path, entryp ? &entry_as_string : NULL ); switch ( rc ) { @@ -896,6 +905,9 @@ ldif_prepare_create( Entry *parent = NULL; int rc = LDAP_SUCCESS; + if ( op->o_abandon ) + return SLAPD_ABANDON; + dn2path( be, ndn, dnpath ); if ( stat( dnpath->bv_val, &st ) == 0 ) { /* entry .ldif file */ @@ -1282,6 +1294,10 @@ ldif_back_delete( Operation *op, SlapReply *rs ) } ldap_pvt_thread_rdwr_wlock(&li->li_rdwr); + if ( op->o_abandon ) { + rc = SLAPD_ABANDON; + goto done; + } dn2path( op->o_bd, &op->o_req_ndn, &path ); ldif2dir_len( path ); @@ -1318,6 +1334,7 @@ ldif_back_delete( Operation *op, SlapReply *rs ) } SLAP_FREE(path.bv_val); + done: ldap_pvt_thread_rdwr_wunlock(&li->li_rdwr); rs->sr_err = rc; send_ldap_result( op, rs ); -- 2.39.5