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
Christopher Ng
OpenLDAP
Commits
0b93bfc4
Commit
0b93bfc4
authored
19 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
ITS#3854 fix Modify logging, add handlers for unrecognized ops.
parent
fbbfac67
Branches
Branches containing commit
Tags
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
+20
-4
20 additions, 4 deletions
servers/slapd/overlays/accesslog.c
with
20 additions
and
4 deletions
servers/slapd/overlays/accesslog.c
+
20
−
4
View file @
0b93bfc4
...
...
@@ -43,11 +43,13 @@
#define LOG_OP_UNBIND 0x080
#define LOG_OP_ABANDON 0x100
#define LOG_OP_EXTENDED 0x200
#define LOG_OP_UNKNOWN 0x400
#define LOG_OP_WRITES (LOG_OP_ADD|LOG_OP_DELETE|LOG_OP_MODIFY|LOG_OP_MODRDN)
#define LOG_OP_READS (LOG_OP_COMPARE|LOG_OP_SEARCH)
#define LOG_OP_SESSION (LOG_OP_BIND|LOG_OP_UNBIND|LOG_OP_ABANDON)
#define LOG_OP_ALL (LOG_OP_READS|LOG_OP_WRITES|LOG_OP_SESSION|LOG_OP_EXTENDED)
#define LOG_OP_ALL (LOG_OP_READS|LOG_OP_WRITES|LOG_OP_SESSION| \
LOG_OP_EXTENDED|LOG_OP_UNKNOWN)
typedef
struct
log_info
{
BackendDB
*
li_db
;
...
...
@@ -109,6 +111,7 @@ static slap_verbmasks logops[] = {
{
BER_BVC
(
"unbind"
),
LOG_OP_UNBIND
},
{
BER_BVC
(
"abandon"
),
LOG_OP_ABANDON
},
{
BER_BVC
(
"extended"
),
LOG_OP_EXTENDED
},
{
BER_BVC
(
"unknown"
),
LOG_OP_UNKNOWN
},
{
BER_BVNULL
,
0
}
};
...
...
@@ -126,6 +129,7 @@ enum {
LOG_EN_UNBIND
,
LOG_EN_ABANDON
,
LOG_EN_EXTENDED
,
LOG_EN_UNKNOWN
,
LOG_EN__COUNT
};
...
...
@@ -723,6 +727,8 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
case
LDAP_REQ_SEARCH
:
logop
=
LOG_EN_SEARCH
;
break
;
case
LDAP_REQ_BIND
:
logop
=
LOG_EN_BIND
;
break
;
case
LDAP_REQ_EXTENDED
:
logop
=
LOG_EN_EXTENDED
;
break
;
default:
/* unknown operation type */
logop
=
LOG_EN_UNKNOWN
;
break
;
}
/* Unbind and Abandon never reach here */
lo
=
logops
+
logop
+
EN_OFFSET
;
...
...
@@ -810,16 +816,22 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
if
(
m
->
sml_values
)
{
for
(
b
=
m
->
sml_values
;
!
BER_BVISNULL
(
b
);
b
++
,
i
++
)
{
char
c_op
;
vals
[
i
].
bv_len
=
a
->
a
_desc
->
ad_cname
.
bv_len
+
b
->
bv_len
+
3
;
vals
[
i
].
bv_len
=
m
->
sml
_desc
->
ad_cname
.
bv_len
+
b
->
bv_len
+
3
;
vals
[
i
].
bv_val
=
ch_malloc
(
vals
[
i
].
bv_len
+
1
);
ptr
=
lutil_strcopy
(
vals
[
i
].
bv_val
,
a
->
a
_desc
->
ad_cname
.
bv_val
);
m
->
sml
_desc
->
ad_cname
.
bv_val
);
*
ptr
++
=
':'
;
switch
(
m
->
sml_op
)
{
case
LDAP_MOD_ADD
:
c_op
=
'+'
;
break
;
case
LDAP_MOD_DELETE
:
c_op
=
'-'
;
break
;
case
LDAP_MOD_REPLACE
:
c_op
=
'='
;
break
;
case
LDAP_MOD_INCREMENT
:
c_op
=
'#'
;
break
;
/* unknown op. there shouldn't be any of these. we
* don't know what to do with it, but we shouldn't just
* ignore it.
*/
default:
c_op
=
'?'
;
break
;
}
*
ptr
++
=
c_op
;
*
ptr
++
=
' '
;
...
...
@@ -827,7 +839,7 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
vals
[
i
].
bv_val
[
vals
[
i
].
bv_len
]
=
'\0'
;
}
}
else
if
(
m
->
sml_op
==
LDAP_MOD_DELETE
)
{
vals
[
i
].
bv_len
=
a
->
a
_desc
->
ad_cname
.
bv_len
+
2
;
vals
[
i
].
bv_len
=
m
->
sml
_desc
->
ad_cname
.
bv_len
+
2
;
vals
[
i
].
bv_val
=
ch_malloc
(
vals
[
i
].
bv_len
+
1
);
ptr
=
lutil_strcopy
(
vals
[
i
].
bv_val
,
a
->
a_desc
->
ad_cname
.
bv_val
);
...
...
@@ -916,6 +928,10 @@ static int accesslog_response(Operation *op, SlapReply *rs) {
attr_merge_one
(
e
,
ad_reqData
,
op
->
ore_reqdata
,
NULL
);
}
break
;
case
LOG_EN_UNKNOWN
:
/* we don't know its parameters, don't add any */
break
;
}
op2
.
o_hdr
=
op
->
o_hdr
;
...
...
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