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
c56564e2
Commit
c56564e2
authored
18 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
disconnect without notice
parent
963eaf63
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
doc/man/man5/slapo-retcode.5
+15
-1
15 additions, 1 deletion
doc/man/man5/slapo-retcode.5
servers/slapd/overlays/retcode.c
+36
-1
36 additions, 1 deletion
servers/slapd/overlays/retcode.c
with
51 additions
and
2 deletions
doc/man/man5/slapo-retcode.5
+
15
−
1
View file @
c56564e2
...
...
@@ -58,7 +58,7 @@ If not defined, the suffix of the database is used.
.hy 0
.B retcode\-item <RDN> <errCode> [op=<oplist>] [text=<message>]
.B [ref=<referral>] [sleeptime=<sec>] [matched=<DN>]
.B [unsolicited=<OID>[:<data>]]
.B [unsolicited=<OID>[:<data>]]
[flags=disconnect[,...]]
.RS
A dynamically generated entry, located below \fBretcode\-parent\fP.
The \fBerrCode\fP is the number of the response code;
...
...
@@ -79,6 +79,9 @@ The \fBunsolicited\fP field can be used to cause the return
of an RFC 4511 unsolicited response message; if \fBOID\fP
is not "0", an extended response is generated, with the optional
\fBdata\fP appended.
If \fBflags\fP contains \fBdisconnect\fP,
.BR slapd (8)
disconnects abruptly, without notice.
.RE
.TP
.B retcode\-indir
...
...
@@ -181,6 +184,17 @@ in RFC 4511 unsolicited response:
SINGLE-VALUE )
.RE
.LP
If TRUE,
.BR slapd (8)
disconnects abruptly without notice:
.RS 4
( 1.3.6.1.4.1.4203.666.11.4.1.8
NAME ( 'errDisconnect' )
DESC 'Disconnect without notice'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )
.RE
.LP
The abstract class that triggers the overlay:
.RS 4
( 1.3.6.1.4.1.4203.666.11.4.3.0
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/overlays/retcode.c
+
36
−
1
View file @
c56564e2
...
...
@@ -43,6 +43,8 @@ static AttributeDescription *ad_errSleepTime;
static
AttributeDescription
*
ad_errMatchedDN
;
static
AttributeDescription
*
ad_errUnsolicitedOID
;
static
AttributeDescription
*
ad_errUnsolicitedData
;
static
AttributeDescription
*
ad_errDisconnect
;
static
ObjectClass
*
oc_errAbsObject
;
static
ObjectClass
*
oc_errObject
;
static
ObjectClass
*
oc_errAuxObject
;
...
...
@@ -75,6 +77,10 @@ typedef struct retcode_item_t {
slap_mask_t
rdi_mask
;
struct
berval
rdi_unsolicited_oid
;
struct
berval
rdi_unsolicited_data
;
unsigned
rdi_flags
;
#define RDI_DISCONNECT (0x1U)
struct
retcode_item_t
*
rdi_next
;
}
retcode_item_t
;
...
...
@@ -407,6 +413,10 @@ retcode_op_func( Operation *op, SlapReply *rs )
rs
->
sr_text
=
"retcode not found"
;
}
else
{
if
(
rdi
->
rdi_flags
&
RDI_DISCONNECT
)
{
return
rs
->
sr_err
=
SLAPD_DISCONNECT
;
}
rs
->
sr_err
=
rdi
->
rdi_err
;
rs
->
sr_text
=
rdi
->
rdi_text
.
bv_val
;
rs
->
sr_matched
=
rdi
->
rdi_matched
.
bv_val
;
...
...
@@ -560,6 +570,12 @@ retcode_entry_response( Operation *op, SlapReply *rs, BackendInfo *bi, Entry *e
}
}
/* disconnect */
a
=
attr_find
(
e
->
e_attrs
,
ad_errDisconnect
);
if
(
a
!=
NULL
&&
bvmatch
(
&
a
->
a_nvals
[
0
],
&
slap_true_bv
)
)
{
return
rs
->
sr_err
=
SLAPD_DISCONNECT
;
}
/* error code */
a
=
attr_find
(
e
->
e_attrs
,
ad_errCode
);
if
(
a
==
NULL
)
{
...
...
@@ -983,10 +999,22 @@ retcode_db_config(
&
rdi
.
rdi_unsolicited_oid
);
}
}
else
if
(
strncasecmp
(
argv
[
i
],
"flags="
,
STRLENOF
(
"flags="
)
)
==
0
)
{
if
(
strcasecmp
(
&
argv
[
i
][
STRLENOF
(
"flags="
)
],
"disconnect"
)
==
0
)
{
rdi
.
rdi_flags
|=
RDI_DISCONNECT
;
}
else
{
fprintf
(
stderr
,
"%s: line %d: retcode: "
"unknown flag
\"
%s
\"
.
\n
"
,
fname
,
lineno
,
&
argv
[
i
][
STRLENOF
(
"flags="
)
]
);
return
1
;
}
}
else
{
fprintf
(
stderr
,
"%s: line %d: retcode: "
"unknown option
\"
%s
\"
.
\n
"
,
fname
,
lineno
,
argv
[
i
]
);
fname
,
lineno
,
argv
[
i
]
);
return
1
;
}
}
...
...
@@ -1269,6 +1297,12 @@ retcode_initialize( void )
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 "
"SINGLE-VALUE )"
,
&
ad_errUnsolicitedData
},
{
"( 1.3.6.1.4.1.4203.666.11.4.1.8 "
"NAME ( 'errDisconnect' ) "
"DESC 'Disconnect without notice' "
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 "
"SINGLE-VALUE )"
,
&
ad_errDisconnect
},
{
NULL
}
};
...
...
@@ -1289,6 +1323,7 @@ retcode_initialize( void )
"$ errMatchedDN "
"$ errUnsolicitedOID "
"$ errUnsolicitedData "
"$ errDisconnect "
") )"
,
&
oc_errAbsObject
},
{
"( 1.3.6.1.4.1.4203.666.11.4.3.1 "
...
...
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