Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nadezhda Ivanova
OpenLDAP
Commits
328d3871
Commit
328d3871
authored
Dec 22, 2001
by
Pierangelo Masarati
Browse files
better handling of on-the-fly operational attrs by means of helpers
parent
3824672c
Changes
7
Hide whitespace changes
Inline
Side-by-side
servers/slapd/Makefile.in
View file @
328d3871
...
...
@@ -19,7 +19,7 @@ SRCS = main.c daemon.c connection.c search.c filter.c add.c charray.c \
schemaparse.c ad.c at.c mr.c syntax.c oc.c saslauthz.c
\
configinfo.c starttls.c index.c sets.c referral.c
\
root_dse.c sasl.c module.c suffixalias.c mra.c mods.c
\
limits.c backglue.c
\
limits.c backglue.c
operational.c
\
$
(
@PLAT@_SRCS
)
OBJS
=
main.o daemon.o connection.o search.o filter.o add.o charray.o
\
...
...
@@ -32,7 +32,7 @@ OBJS = main.o daemon.o connection.o search.o filter.o add.o charray.o \
schemaparse.o ad.o at.o mr.o syntax.o oc.o saslauthz.o
\
configinfo.o starttls.o index.o sets.o referral.o
\
root_dse.o sasl.o module.o suffixalias.o mra.o mods.o
\
limits.o backglue.o
\
limits.o backglue.o
operational.o
\
$
(
@PLAT@_OBJS
)
LDAP_INCDIR
=
../../include
...
...
servers/slapd/back-ldbm/operational.c
View file @
328d3871
...
...
@@ -37,16 +37,10 @@ ldbm_back_operational(
int
hs
;
hs
=
has_children
(
be
,
e
);
*
aa
=
ch_malloc
(
sizeof
(
Attribute
)
);
(
*
aa
)
->
a_desc
=
slap_schema
.
si_ad_hasSubordinates
;
(
*
aa
)
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
(
*
aa
)
->
a_vals
[
0
]
=
ber_bvstrdup
(
hs
?
"TRUE"
:
"FALSE"
);
(
*
aa
)
->
a_vals
[
1
]
=
NULL
;
(
*
aa
)
->
a_next
=
NULL
;
aa
=
&
(
*
aa
)
->
a_next
;
*
aa
=
slap_operational_hasSubordinate
(
hs
);
if
(
*
aa
!=
NULL
)
{
aa
=
&
(
*
aa
)
->
a_next
;
}
}
return
0
;
...
...
servers/slapd/back-monitor/operational.c
View file @
328d3871
...
...
@@ -42,16 +42,10 @@ monitor_back_operational(
assert
(
mp
);
hs
=
MONITOR_HAS_CHILDREN
(
mp
);
*
aa
=
ch_malloc
(
sizeof
(
Attribute
)
);
(
*
aa
)
->
a_desc
=
slap_schema
.
si_ad_hasSubordinates
;
(
*
aa
)
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
(
*
aa
)
->
a_vals
[
0
]
=
ber_bvstrdup
(
hs
?
"TRUE"
:
"FALSE"
);
(
*
aa
)
->
a_vals
[
1
]
=
NULL
;
(
*
aa
)
->
a_next
=
NULL
;
aa
=
&
(
*
aa
)
->
a_next
;
*
aa
=
slap_operational_hasSubordinate
(
hs
);
if
(
*
aa
!=
NULL
)
{
aa
=
&
(
*
aa
)
->
a_next
;
}
}
return
0
;
...
...
servers/slapd/backend.c
View file @
328d3871
...
...
@@ -1094,16 +1094,8 @@ Attribute *backend_operational(
Attribute
*
a
=
NULL
,
**
ap
=
&
a
;
#ifdef SLAPD_SCHEMA_DN
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
a
->
a_desc
=
slap_schema
.
si_ad_subschemaSubentry
;
/* Should be backend specific */
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
a
->
a_vals
[
0
]
=
ber_bvstrdup
(
SLAPD_SCHEMA_DN
);
a
->
a_vals
[
1
]
=
NULL
;
a
->
a_next
=
NULL
;
ap
=
&
a
->
a_next
;
*
ap
=
slap_operational_subschemaSubentry
();
ap
=
&
(
*
ap
)
->
a_next
;
#endif
/*
...
...
@@ -1111,7 +1103,7 @@ Attribute *backend_operational(
* and the backend supports specific operational attributes,
* add them to the attribute list
*/
if
(
(
opattrs
||
attrs
)
&&
be
->
be_operational
!=
NULL
)
{
if
(
(
opattrs
||
attrs
)
&&
be
&&
be
->
be_operational
!=
NULL
)
{
(
void
)
be
->
be_operational
(
be
,
conn
,
op
,
e
,
attrs
,
opattrs
,
ap
);
}
...
...
servers/slapd/operational.c
0 → 100644
View file @
328d3871
/* operational.c - routines to deal with on-the-fly operational attrs */
/*
* Copyright 2001 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include
"portable.h"
#include
"slap.h"
/*
* helpers for on-the-fly operational attribute generation
*/
#ifdef SLAPD_SCHEMA_DN
Attribute
*
slap_operational_subschemaSubentry
(
void
)
{
Attribute
*
a
;
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
a
->
a_desc
=
slap_schema
.
si_ad_subschemaSubentry
;
/* Should be backend specific */
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
a
->
a_vals
[
0
]
=
ber_bvstrdup
(
SLAPD_SCHEMA_DN
);
a
->
a_vals
[
1
]
=
NULL
;
a
->
a_next
=
NULL
;
return
a
;
}
#endif
/* SLAPD_SCHEMA_DN */
Attribute
*
slap_operational_hasSubordinate
(
int
hs
)
{
Attribute
*
a
;
a
=
ch_malloc
(
sizeof
(
Attribute
)
);
a
->
a_desc
=
slap_schema
.
si_ad_hasSubordinates
;
a
->
a_vals
=
ch_malloc
(
2
*
sizeof
(
struct
berval
*
)
);
a
->
a_vals
[
0
]
=
ber_bvstrdup
(
hs
?
"TRUE"
:
"FALSE"
);
a
->
a_vals
[
1
]
=
NULL
;
a
->
a_next
=
NULL
;
return
a
;
}
servers/slapd/proto-slap.h
View file @
328d3871
...
...
@@ -886,6 +886,12 @@ LDAP_SLAPD_V (char) *ldap_srvtab;
LDAP_SLAPD_V
(
int
)
krbv4_ldap_auth
();
#endif
/*
* operational.c
*/
LDAP_SLAPD_F
(
Attribute
*
)
slap_operational_subschemaSubentry
(
void
);
LDAP_SLAPD_F
(
Attribute
*
)
slap_operational_hasSubordinate
(
int
has
);
/*
* Other...
*/
...
...
servers/slapd/tools/mimic.c
View file @
328d3871
...
...
@@ -220,3 +220,16 @@ int read_root_dse_file ( const char *file )
{
return
0
;
}
Attribute
*
slap_operational_subschemaSubentry
(
void
)
{
return
NULL
;
}
Attribute
*
slap_operational_hasSubordinate
(
int
hs
)
{
return
NULL
;
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment