Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
David Barchiesi
OpenLDAP
Commits
c93e6981
Commit
c93e6981
authored
16 years ago
by
Quanah Gibson-Mount
Browse files
Options
Downloads
Patches
Plain Diff
ITS#5906
parent
4793af4a
No related branches found
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES
+1
-0
1 addition, 0 deletions
CHANGES
servers/slapd/overlays/rwm.c
+21
-35
21 additions, 35 deletions
servers/slapd/overlays/rwm.c
with
22 additions
and
35 deletions
CHANGES
+
1
−
0
View file @
c93e6981
...
...
@@ -31,6 +31,7 @@ OpenLDAP 2.4.14 Engineering
Fixed slapd-meta double response sending (ITS#5854)
Fixed slapd-meta alias deref for retry (ITS#5889)
Fixed slapo-ppolicy to not be global (ITS#5858)
Fixed slapo-rwm with back-config (ITS#5906)
Updated contrib/addpartial module (ITS#5764)
Added contrib/cloak module (ITS#5872)
Build Environment
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/overlays/rwm.c
+
21
−
35
View file @
c93e6981
...
...
@@ -1830,7 +1830,6 @@ rwm_db_config(
enum
{
/* rewrite */
RWM_CF_REWRITE
=
1
,
RWM_CF_SUFFIXMASSAGE
,
/* map */
RWM_CF_MAP
,
...
...
@@ -1841,8 +1840,10 @@ enum {
};
static
slap_verbmasks
t_f_mode
[]
=
{
{
BER_BVC
(
"true"
),
RWM_F_SUPPORT_T_F
},
{
BER_BVC
(
"yes"
),
RWM_F_SUPPORT_T_F
},
{
BER_BVC
(
"discover"
),
RWM_F_SUPPORT_T_F_DISCOVER
},
{
BER_BVC
(
"false"
),
RWM_F_NONE
},
{
BER_BVC
(
"no"
),
RWM_F_NONE
},
{
BER_BVNULL
,
0
}
};
...
...
@@ -1852,7 +1853,7 @@ static ConfigDriver rwm_cf_gen;
static
ConfigTable
rwmcfg
[]
=
{
{
"rwm-rewrite"
,
"rewrite"
,
2
,
0
,
STRLENOF
(
"rwm-rewrite"
),
ARG_MAGIC
|
ARG_QUOTE
|
RWM_CF_REWRITE
,
rwm_cf_gen
,
ARG_MAGIC
|
RWM_CF_REWRITE
,
rwm_cf_gen
,
"( OLcfgOvAt:16.1 NAME 'olcRwmRewrite' "
"DESC 'Rewrites strings' "
"EQUALITY caseIgnoreMatch "
...
...
@@ -1861,7 +1862,7 @@ static ConfigTable rwmcfg[] = {
NULL
,
NULL
},
{
"rwm-suffixmassage"
,
"[virtual]> <real"
,
2
,
3
,
0
,
ARG_MAGIC
|
RWM_CF_
SUFFIXMASSAG
E
,
rwm_cf_gen
,
2
,
3
,
0
,
ARG_MAGIC
|
RWM_CF_
REWRIT
E
,
rwm_cf_gen
,
NULL
,
NULL
,
NULL
},
{
"rwm-t-f-support"
,
"true|false|discover"
,
...
...
@@ -1955,6 +1956,7 @@ rwm_cf_gen( ConfigArgs *c )
BackendDB
db
;
char
*
argv0
;
int
idx0
=
0
;
int
rc
=
0
;
db
=
*
c
->
be
;
...
...
@@ -2059,37 +2061,26 @@ rwm_cf_gen( ConfigArgs *c )
return
rc
;
}
if
(
strncasecmp
(
c
->
argv
[
0
],
"olcRwm"
,
STRLENOF
(
"olcRwm"
)
)
==
0
)
{
idx0
=
1
;
}
switch
(
c
->
type
)
{
case
RWM_CF_REWRITE
:
argv0
=
c
->
argv
[
0
];
c
->
argv
[
0
]
+=
STRLENOF
(
"rwm-"
);
rc
=
rwm_rw_config
(
&
db
,
c
->
fname
,
c
->
lineno
,
c
->
argc
,
c
->
argv
);
c
->
argv
[
0
]
=
argv0
;
if
(
rc
)
{
argv0
=
c
->
argv
[
idx0
];
if
(
strncasecmp
(
argv0
,
"rwm-"
,
STRLENOF
(
"rwm-"
)
)
!=
0
)
{
return
1
;
}
c
->
argv
[
idx0
]
+=
STRLENOF
(
"rwm-"
);
if
(
strcasecmp
(
c
->
argv
[
idx0
],
"suffixmassage"
)
==
0
)
{
rc
=
rwm_suffixmassage_config
(
&
db
,
c
->
fname
,
c
->
lineno
,
c
->
argc
-
idx0
,
&
c
->
argv
[
idx0
]
);
}
else
{
char
*
line
;
struct
berval
bv
;
line
=
ldap_charray2str
(
c
->
argv
,
"
\"
\"
"
);
if
(
line
!=
NULL
)
{
int
len
=
strlen
(
c
->
argv
[
0
]
);
ber_str2bv
(
line
,
0
,
0
,
&
bv
);
AC_MEMCPY
(
&
bv
.
bv_val
[
len
],
&
bv
.
bv_val
[
len
+
1
],
bv
.
bv_len
-
(
len
+
1
)
);
bv
.
bv_val
[
bv
.
bv_len
-
1
]
=
'"'
;
ber_bvarray_add
(
&
rwmap
->
rwm_bva_rewrite
,
&
bv
);
}
rc
=
rwm_rw_config
(
&
db
,
c
->
fname
,
c
->
lineno
,
c
->
argc
-
idx0
,
&
c
->
argv
[
idx0
]
);
}
break
;
case
RWM_CF_SUFFIXMASSAGE
:
argv0
=
c
->
argv
[
0
];
c
->
argv
[
0
]
+=
STRLENOF
(
"rwm-"
);
rc
=
rwm_suffixmassage_config
(
&
db
,
c
->
fname
,
c
->
lineno
,
c
->
argc
,
c
->
argv
);
c
->
argv
[
0
]
=
argv0
;
c
->
argv
[
idx0
]
=
argv0
;
if
(
rc
)
{
return
1
;
...
...
@@ -2097,14 +2088,9 @@ rwm_cf_gen( ConfigArgs *c )
char
*
line
;
struct
berval
bv
;
/* FIXME: not optimal; in fact, this keeps track
* of the fact that a set of rules was added
* using the rwm-suffixmassage shortcut, but the
* rules are not clarified */
line
=
ldap_charray2str
(
c
->
argv
,
"
\"
\"
"
);
line
=
ldap_charray2str
(
&
c
->
argv
[
idx0
],
"
\"
\"
"
);
if
(
line
!=
NULL
)
{
int
len
=
strlen
(
c
->
argv
[
0
]
);
int
len
=
strlen
(
c
->
argv
[
idx
0
]
);
ber_str2bv
(
line
,
0
,
0
,
&
bv
);
AC_MEMCPY
(
&
bv
.
bv_val
[
len
],
&
bv
.
bv_val
[
len
+
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