]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/search.c
ITS#2764, #2781 revert backend.c patch, just catch the NULL referral
[openldap] / servers / slapd / search.c
index 39ca34f4b17eae260057f353906d94d74c88d9f4..816df11c40041e09535737d48ae5f8bc0e8d92a3 100644 (file)
@@ -1,10 +1,18 @@
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2003 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
-/* Portions
- * Copyright (c) 1995 Regents of the University of Michigan.
+/* Portions Copyright (c) 1995 Regents of the University of Michigan.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms are permitted
@@ -159,7 +167,7 @@ do_search(
 
        /* attributes */
        siz = sizeof(AttributeName);
-       off = 0;
+       off = offsetof(AttributeName,an_name);
        if ( ber_scanf( op->o_ber, "{M}}", &op->ors_attrs, &siz, off ) == LBER_ERROR ) {
                send_ldap_discon( op, rs, LDAP_PROTOCOL_ERROR, "decoding attrs error" );
                rs->sr_err = SLAPD_DISCONNECT;
@@ -401,6 +409,9 @@ return_results:;
        if ( ( op->o_sync_mode & SLAP_SYNC_PERSIST ) )
                return rs->sr_err;
 
+       if ( ( op->o_sync_slog_size != -1 ) )
+               return rs->sr_err;
+
        if( op->o_req_dn.bv_val != NULL) sl_free( op->o_req_dn.bv_val, op->o_tmpmemctx );
        if( op->o_req_ndn.bv_val != NULL) sl_free( op->o_req_ndn.bv_val, op->o_tmpmemctx );