Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
François Kooman
OpenLDAP
Commits
2babdaab
Commit
2babdaab
authored
19 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Add flag for only logging successful operations
parent
9b1d798a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/overlays/accesslog.c
+24
-3
24 additions, 3 deletions
servers/slapd/overlays/accesslog.c
with
24 additions
and
3 deletions
servers/slapd/overlays/accesslog.c
+
24
−
3
View file @
2babdaab
...
...
@@ -57,6 +57,7 @@ typedef struct log_info {
int
li_age
;
int
li_cycle
;
struct
re_s
*
li_task
;
int
li_success
;
}
log_info
;
static
ConfigDriver
log_cf_gen
;
...
...
@@ -64,7 +65,8 @@ static ConfigDriver log_cf_gen;
enum
{
LOG_DB
=
1
,
LOG_OPS
,
LOG_PURGE
LOG_PURGE
,
LOG_SUCCESS
};
static
ConfigTable
log_cfats
[]
=
{
...
...
@@ -82,6 +84,10 @@ static ConfigTable log_cfats[] = {
log_cf_gen
,
"( OLcfgOvAt:4.3 NAME 'olcAccessLogPurge' "
"DESC 'Log cleanup parameters' "
"SYNTAX OMsDirectoryString SINGLE-VALUE )"
,
NULL
,
NULL
},
{
"logsuccess"
,
NULL
,
2
,
2
,
0
,
ARG_MAGIC
|
ARG_ON_OFF
|
LOG_SUCCESS
,
log_cf_gen
,
"( OLcfgOvAt:4.4 NAME 'olcAccessLogSuccess' "
"DESC 'Log successful ops only' "
"SYNTAX OMsBoolean SINGLE-VALUE )"
,
NULL
,
NULL
},
{
NULL
}
};
...
...
@@ -91,7 +97,7 @@ static ConfigOCs log_cfocs[] = {
"DESC 'Access log configuration' "
"SUP olcOverlayConfig "
"MUST olcAccessLogDB "
"MAY ( olcAccessLogOps $ olcAccessLogPurge ) )"
,
"MAY ( olcAccessLogOps $ olcAccessLogPurge
$ olcAccessLogSuccess
) )"
,
Cft_Overlay
,
log_cfats
},
{
NULL
}
};
...
...
@@ -188,7 +194,7 @@ static struct {
"SYNTAX OMsInteger "
"SINGLE-VALUE )"
,
&
ad_reqResult
},
{
"( "
LOG_SCHEMA_AT
".7 NAME 'reqAuthzID' "
"DESC 'A
U
thorization ID of requestor' "
"DESC 'A
u
thorization ID of requestor' "
"EQUALITY distinguishedNameMatch "
"SYNTAX OMsDN "
"SINGLE-VALUE )"
,
&
ad_reqAuthzID
},
...
...
@@ -556,6 +562,12 @@ log_cf_gen(ConfigArgs *c)
agebv
.
bv_len
+=
cyclebv
.
bv_len
;
value_add_one
(
&
c
->
rvalue_vals
,
&
agebv
);
break
;
case
LOG_SUCCESS
:
if
(
li
->
li_success
)
c
->
value_int
=
li
->
li_success
;
else
rc
=
1
;
break
;
}
break
;
case
LDAP_MOD_DELETE
:
...
...
@@ -583,6 +595,9 @@ log_cf_gen(ConfigArgs *c)
li
->
li_age
=
0
;
li
->
li_cycle
=
0
;
break
;
case
LOG_SUCCESS
:
li
->
li_success
=
0
;
break
;
}
break
;
default:
...
...
@@ -625,6 +640,9 @@ log_cf_gen(ConfigArgs *c)
}
}
break
;
case
LOG_SUCCESS
:
li
->
li_success
=
c
->
value_int
;
break
;
}
break
;
}
...
...
@@ -720,6 +738,9 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
if
(
rs
->
sr_type
!=
REP_RESULT
&&
rs
->
sr_type
!=
REP_EXTENDED
)
return
SLAP_CB_CONTINUE
;
if
(
li
->
li_success
&&
rs
->
sr_err
!=
LDAP_SUCCESS
)
return
SLAP_CB_CONTINUE
;
switch
(
op
->
o_tag
)
{
case
LDAP_REQ_ADD
:
logop
=
LOG_EN_ADD
;
break
;
case
LDAP_REQ_DELETE
:
logop
=
LOG_EN_DELETE
;
break
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment