*/
if ( !be_isroot( be, op->o_ndn )) {
if ( be_issuffix( be, "" ) || be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
- p = (Entry *)&rootp;
+ p = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
rc = access_allowed( be, conn, op, p,
/* no parent, must be root to delete */
if( ! be_isroot( be, op->o_ndn ) ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
-
- p = (Entry *)&rootp;
+ p = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
rc = access_allowed( be, conn, op, p,
char *p_dn = NULL, *p_ndn = NULL;
char *new_dn = NULL, *new_ndn = NULL;
int isroot = -1;
- const static Entry roote = { NOID, "", "", NULL, NULL };
Entry *e, *p = NULL;
Entry *matched;
int rc;
if ( ! isroot ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, op->o_ndn ) ) {
- p = (Entry *)&roote;
+ p = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
rc = access_allowed( be, conn, op, p,
if ( ! isroot ) {
if ( be_issuffix( be, "" ) || be_isupdate( be, op->o_ndn ) ) {
- np = (Entry *)&roote;
+ np = (Entry *)&slap_entry_root;
/* check parent for "children" acl */
rc = access_allowed( be, conn, op, np,
ID id, cursor;
ID candidates[BDB_IDL_UM_SIZE];
Entry *e = NULL;
- const static Entry roote = { NOID, "", "", NULL, NULL };
struct berval **v2refs = NULL;
Entry *matched = NULL;
char *realbase = NULL;
if ( *nbase == '\0' ) {
/* DIT root special case */
- e = (Entry *) &roote;
+ e = (Entry *) &slap_entry_root;
rc = 0;
} else
#ifdef BDB_ALIASES
return rc;
}
- if (!manageDSAit && e != &roote && is_entry_referral( e ) ) {
+ if (!manageDSAit && e != &slap_entry_root && is_entry_referral( e ) ) {
/* entry is a referral, don't allow add */
char *matched_dn = ch_strdup( e->e_dn );
struct berval **erefs = get_entry_referrals( be,
* FIXME: hack to make "" base work */
cursor = e->e_id == NOID ? 1 : e->e_id;
- if ( e != &roote ) {
+ if ( e != &slap_entry_root ) {
bdb_entry_return( be, e );
}
e = NULL;
if ( !be_isroot( be, op->o_ndn ) ) {
if ( be_issuffix( be, "" )
|| be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
- p = (Entry *)&rootp;
+ p = (Entry *)&slap_entry_root;
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE );
if( ! be_isroot( be, op->o_ndn ) ) {
if ( be_issuffix( be, "" )
|| be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
- p = (Entry *)&rootp;
+ p = (Entry *)&slap_entry_root;
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE );
if ( ! be_isroot ) {
if ( be_issuffix( be, "" )
|| be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
- p = (Entry *)&rootp;
+ p = (Entry *)&slap_entry_root;
rc = access_allowed( be, conn, op, p,
children, NULL, ACL_WRITE );
if ( ! be_isroot ) {
if ( be_issuffix( be, "" )
|| be_isupdate( be, op->o_ndn ) ) {
- static const Entry rootp = { NOID, "", "", NULL, NULL };
- np = (Entry *)&rootp;
+ np = (Entry *)&slap_entry_root;
rc = access_allowed( be, conn, op, np,
children, NULL, ACL_WRITE );
if ( *nbase == '\0' ) {
/* DIT root special case */
- static const Entry root = { NOID, "", "", NULL, NULL };
- e = (Entry *) &root;
+ e = (Entry *) &slap_entry_root;
/* need normalized dn below */
realbase = ch_strdup( e->e_ndn );
static unsigned char *ecur; /* pointer to end of currently used ebuf */
static int emaxsize;/* max size of ebuf */
+/*
+ * Empty root entry
+ */
+const Entry slap_entry_root = { NOID, "", "", NULL, NULL };
+
int entry_destroy(void)
{
free( ebuf );
* entry.c
*/
+extern const Entry slap_entry_root;
+
LDAP_SLAPD_F (int) entry_destroy LDAP_P((void));
LDAP_SLAPD_F (Entry *) str2entry LDAP_P(( char *s ));