#define dn_match(dn1, dn2) ( ber_bvcmp((dn1), (dn2)) == 0 )
#define bvmatch(bv1, bv2) ( ((bv1)->bv_len == (bv2)->bv_len) && (memcmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
-LDAP_SLAPD_V( const struct berval ) slap_empty_bv;
-
LDAP_SLAPD_F (int) dnValidate LDAP_P((
Syntax *syntax,
struct berval *val ));
Backend *be, Connection *conn, Operation *op,
Entry *e, Filter *f ));
+/*
+ * globals.c
+ */
+
+LDAP_SLAPD_V( const struct berval ) slap_empty_bv;
+LDAP_SLAPD_V( const struct berval ) slap_unknown_bv;
+
/*
* index.c
*/
*/
#include "portable.h"
+//#include "../../../libraries/liblber/lber-int.h"
#include <slap.h>
+#include <lber_pvt.h>
#include <slapi.h>
-#include <lber.h>
-#include "../../../libraries/liblber/lber-int.h"
+/*
+ * use a fake listener when faking a connection,
+ * so it can be used in ACLs
+ */
+static struct slap_listener slap_unknown_listener = {
+ BER_BVC("unknown"), /* FIXME: use a URI form? */
+ BER_BVC("UNKNOWN")
+};
int bvptr2obj( struct berval **bvptr, struct berval **bvobj );
c->c_ndn.bv_len = 0;
c->c_groups = NULL;
- c->c_listener = NULL;
- c->c_peer_domain.bv_val = NULL;
- c->c_peer_domain.bv_len = 0;
- c->c_peer_name.bv_val = NULL;
- c->c_peer_name.bv_len = 0;
+ c->c_listener = &slap_unknown_listener;
+ ber_dupbv( &c->c_peer_domain, (struct berval *)&slap_unknown_bv );
+ ber_dupbv( &c->c_peer_name, (struct berval *)&slap_unknown_bv );
LDAP_STAILQ_INIT( &c->c_ops );