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
9effc2b8
Commit
9effc2b8
authored
20 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
cleanup of rewrite code and docs
parent
47e79480
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/man/man5/slapo-rwm.5
+12
-9
12 additions, 9 deletions
doc/man/man5/slapo-rwm.5
include/rewrite.h
+6
-7
6 additions, 7 deletions
include/rewrite.h
libraries/librewrite/xmap.c
+1
-1
1 addition, 1 deletion
libraries/librewrite/xmap.c
with
19 additions
and
17 deletions
doc/man/man5/slapo-rwm.5
+
12
−
9
View file @
9effc2b8
...
...
@@ -188,15 +188,15 @@ n
as return code if the rule matches; the flag does not alter the recursive
behavior of the rule, so, to have it performed only once, it must be used
in combination with `:', e.g.
.B `:U{
16
}'
returns the value `
16' after exactly one execution of the rule, if the
pattern matches.
.B `:U{
32
}'
returns the value `
32' (indicating noSuchObject) after exactly
one execution of the rule, if the
pattern matches.
As a consequence, its behavior is equivalent to `@', with the return
code set to
.BR n ;
or, in other words, `@' is equivalent to `U{0}'.
By convention, the freely available codes are above 16 included;
the others are reserved
.
Positive errors are allowed, indicating the related LDAP error codes
as specified in \fIdraft-ietf-ldapbis-protocol\fP
.
.LP
The ordering of the flags can be significant.
For instance: `IG{2}' means ignore errors and jump two lines ahead
...
...
@@ -400,26 +400,29 @@ rwm-rewriteEngine on
rwm-rewriteEngine on
# all dataflow from client to server referring to DNs
rwm-rewriteContext default
rwm-rewriteRule "(.
*)
<virtualnamingcontext>$" "$1<realnamingcontext>" ":"
rwm-rewriteRule "(.
+,)?
<virtualnamingcontext>$" "$1<realnamingcontext>" ":"
# empty filter rule
rwm-rewriteContext searchFilter
# all dataflow from server to client
rwm-rewriteContext searchEntryDN
rwm-rewriteRule "(.
*)
<realnamingcontext>$" "$1<virtualnamingcontext>" ":"
rwm-rewriteRule "(.
+,)?
<realnamingcontext>$" "$1<virtualnamingcontext>" ":"
rwm-rewriteContext searchAttrDN alias searchEntryDN
rwm-rewriteContext matchedDN alias searchEntryDN
# misc empty rules
rwm-rewriteContext referralAttrDN
rwm-rewriteContext referralDN
# Everything defined here goes into the `default' context.
# This rule changes the naming context of anything sent
# to `dc=home,dc=net' to `dc=OpenLDAP, dc=org'
rwm-rewriteRule "(.
*)
dc=home,[ ]?dc=net$"
rwm-rewriteRule "(.
+,)?
dc=home,[ ]?dc=net$"
"$1dc=OpenLDAP, dc=org" ":"
# since a pretty/normalized DN does not include spaces
# after rdn separators, e.g. `,', this rule suffices:
rwm-rewriteRule "(.
*)
dc=home,dc=net$"
rwm-rewriteRule "(.
+,)?
dc=home,dc=net$"
"$1dc=OpenLDAP,dc=org" ":"
# Start a new context (ends input of the previous one).
...
...
This diff is collapsed.
Click to expand it.
include/rewrite.h
+
6
−
7
View file @
9effc2b8
...
...
@@ -38,8 +38,7 @@
* Rewrite internal status returns
*/
#define REWRITE_SUCCESS LDAP_SUCCESS
#define REWRITE_ERR LDAP_OPERATIONS_ERROR
#define REWRITE_NO_SUCH_OBJECT LDAP_NO_SUCH_OBJECT
#define REWRITE_ERR LDAP_OTHER
/*
* Rewrite modes (input values for rewrite_info_init); determine the
...
...
@@ -66,11 +65,11 @@
* REWRITE_REGEXEC_UNWILLING the server should issue an 'unwilling
* to perform' error
*/
#define REWRITE_REGEXEC_OK
0x0000
#define REWRITE_REGEXEC_ERR
0x0001
#define REWRITE_REGEXEC_STOP
0x0002
#define REWRITE_REGEXEC_UNWILLING
0x0003
#define REWRITE_REGEXEC_USER
0x0004
/* and above
...
*/
#define REWRITE_REGEXEC_OK
(0)
#define REWRITE_REGEXEC_ERR
(-1)
#define REWRITE_REGEXEC_STOP
(-2)
#define REWRITE_REGEXEC_UNWILLING
(-3)
#define REWRITE_REGEXEC_USER
(1)
/* and above
: LDAP errors
*/
/*
* Rewrite variable flags
...
...
This diff is collapsed.
Click to expand it.
libraries/librewrite/xmap.c
+
1
−
1
View file @
9effc2b8
...
...
@@ -259,7 +259,7 @@ rewrite_xmap_apply(
ldap_pvt_thread_mutex_unlock
(
&
xpasswd_mutex
);
#endif
/* USE_REWRITE_LDAP_PVT_THREADS */
rc
=
REWRITE
_NO_SUCH_OBJECT
;
rc
=
LDAP
_NO_SUCH_OBJECT
;
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