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
orbea -
OpenLDAP
Commits
eefe1236
Commit
eefe1236
authored
Jan 13, 2021
by
Howard Chu
Browse files
ITS#8307 fix slapo-accesslog: noop if logDB isn't open yet
Add be_flag for DB OPEN status
parent
efaf9a4a
Changes
3
Hide whitespace changes
Inline
Side-by-side
servers/slapd/backend.c
View file @
eefe1236
...
...
@@ -226,6 +226,7 @@ int backend_startup_one(Backend *be, ConfigReply *cr)
rc
=
be
->
bd_info
->
bi_db_open
(
be
,
cr
);
if
(
rc
==
0
)
{
(
void
)
backend_set_controls
(
be
);
be
->
be_flags
|=
SLAP_DBFLAG_OPEN
;
}
else
{
char
*
type
=
be
->
bd_info
->
bi_type
;
...
...
@@ -291,6 +292,7 @@ int backend_startup(Backend *be)
rc
);
return
rc
;
}
frontendDB
->
be_flags
|=
SLAP_DBFLAG_OPEN
;
}
/* open each backend type */
...
...
@@ -365,6 +367,7 @@ int backend_shutdown( Backend *be )
if
(
be
->
bd_info
->
bi_db_close
)
{
rc
=
be
->
bd_info
->
bi_db_close
(
be
,
NULL
);
be
->
be_flags
&=
~
SLAP_DBFLAG_OPEN
;
if
(
rc
)
return
rc
;
}
...
...
@@ -382,6 +385,7 @@ int backend_shutdown( Backend *be )
continue
;
if
(
be
->
bd_info
->
bi_db_close
)
{
be
->
bd_info
->
bi_db_close
(
be
,
NULL
);
be
->
be_flags
&=
~
SLAP_DBFLAG_OPEN
;
}
if
(
rc
!=
0
)
{
...
...
@@ -406,6 +410,7 @@ int backend_shutdown( Backend *be )
/* close frontend, if required */
if
(
frontendDB
->
bd_info
->
bi_db_close
)
{
rc
=
frontendDB
->
bd_info
->
bi_db_close
(
frontendDB
,
NULL
);
frontendDB
->
be_flags
&=
~
SLAP_DBFLAG_OPEN
;
if
(
rc
!=
0
)
{
Debug
(
LDAP_DEBUG_ANY
,
"backend_startup: bi_db_close(frontend) failed! (%d)
\n
"
,
...
...
@@ -655,6 +660,7 @@ be_db_close( void )
LDAP_STAILQ_FOREACH
(
be
,
&
backendDB
,
be_next
)
{
if
(
be
->
bd_info
->
bi_db_close
)
{
be
->
bd_info
->
bi_db_close
(
be
,
NULL
);
be
->
be_flags
&=
~
SLAP_DBFLAG_OPEN
;
}
}
...
...
servers/slapd/overlays/accesslog.c
View file @
eefe1236
...
...
@@ -1501,6 +1501,10 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
if
(
rs
->
sr_type
!=
REP_RESULT
&&
rs
->
sr_type
!=
REP_EXTENDED
)
return
SLAP_CB_CONTINUE
;
/* can't do anything if logDB isn't open */
if
(
!
SLAP_DBOPEN
(
li
->
li_db
))
return
SLAP_CB_CONTINUE
;
logop
=
accesslog_op2logop
(
op
);
lo
=
logops
+
logop
+
EN_OFFSET
;
if
(
!
(
li
->
li_ops
&
lo
->
mask
))
{
...
...
servers/slapd/slap.h
View file @
eefe1236
...
...
@@ -1872,6 +1872,7 @@ struct BackendDB {
#define SLAP_DBFLAG_MULTI_SHADOW 0x80000U
/* uses multi-provider */
#define SLAP_DBFLAG_DISABLED 0x100000U
#define SLAP_DBFLAG_LASTBIND 0x200000U
#define SLAP_DBFLAG_OPEN 0x400000U
/* db is currently open */
slap_mask_t
be_flags
;
#define SLAP_DBFLAGS(be) ((be)->be_flags)
#define SLAP_NOLASTMOD(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_NOLASTMOD)
...
...
@@ -1899,6 +1900,7 @@ struct BackendDB {
#define SLAP_SINGLE_SHADOW(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SINGLE_SHADOW)
#define SLAP_MULTIPROVIDER(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_MULTI_SHADOW)
#define SLAP_DBCLEAN(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_CLEAN)
#define SLAP_DBOPEN(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_OPEN)
#define SLAP_DBACL_ADD(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_ACL_ADD)
#define SLAP_SYNC_SUBENTRY(be) (SLAP_DBFLAGS(be) & SLAP_DBFLAG_SYNC_SUBENTRY)
...
...
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