mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
use an "unknown" listener name/url when faking connections
This commit is contained in:
parent
fc87692576
commit
1277616c40
@ -17,4 +17,5 @@
|
||||
*/
|
||||
|
||||
const struct berval slap_empty_bv = { 0, "" };
|
||||
const struct berval slap_unknown_bv = { sizeof("unknown") - 1, "unknown" };
|
||||
|
||||
|
@ -387,8 +387,6 @@ LDAP_SLAPD_F (void) slapd_clr_read LDAP_P((ber_socket_t s, int wake));
|
||||
#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 ));
|
||||
@ -548,6 +546,13 @@ LDAP_SLAPD_F (int) test_filter LDAP_P((
|
||||
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
|
||||
*/
|
||||
|
@ -11,11 +11,19 @@
|
||||
*/
|
||||
|
||||
#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 );
|
||||
|
||||
@ -184,11 +192,9 @@ fakeConnection(
|
||||
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 );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user