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
7aee3a9f
Commit
7aee3a9f
authored
17 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
import fix to ITS#5172
parent
22c16917
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
CHANGES
+1
-0
1 addition, 0 deletions
CHANGES
servers/slapd/back-ldif/ldif.c
+42
-8
42 additions, 8 deletions
servers/slapd/back-ldif/ldif.c
with
43 additions
and
8 deletions
CHANGES
+
1
−
0
View file @
7aee3a9f
...
...
@@ -15,6 +15,7 @@ OpenLDAP 2.4.6 Engineering
Fixed slapd-config objectclass handling (ITS#4884)
Fixed slapd-ldap SASL idassert w/o authcId
Fixed slapd-ldap search control parsing (ITS#5138)
Fixed slapd-ldif directory separators in DN (ITS#5172)
Fixed slapd-meta leak when binding as rootdn (ITS#5155)
Fixed slapd-meta conn caching on bind failure (ITS#5154)
Fixed slapd-monitor database registration (ITS#4965)
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-ldif/ldif.c
+
42
−
8
View file @
7aee3a9f
...
...
@@ -82,25 +82,56 @@ static ConfigOCs ldifocs[] = {
};
static
void
dn2path
(
struct
berval
*
dn
,
struct
berval
*
suffixdn
,
struct
berval
*
base_path
,
dn2path
(
struct
berval
*
orig_
dn
,
struct
berval
*
suffixdn
,
struct
berval
*
base_path
,
struct
berval
*
res
)
{
char
*
ptr
,
*
sep
,
*
end
;
int
nsep
=
0
;
struct
berval
dn
;
assert
(
dn
!=
NULL
);
assert
(
!
BER_BVISNULL
(
dn
)
);
assert
(
orig_
dn
!=
NULL
);
assert
(
!
BER_BVISNULL
(
orig_
dn
)
);
assert
(
suffixdn
!=
NULL
);
assert
(
!
BER_BVISNULL
(
suffixdn
)
);
assert
(
dnIsSuffix
(
dn
,
suffixdn
)
);
assert
(
dnIsSuffix
(
orig_
dn
,
suffixdn
)
);
res
->
bv_len
=
dn
->
bv_len
+
base_path
->
bv_len
+
1
+
STRLENOF
(
LDIF
);
dn
=
*
orig_dn
;
for
(
ptr
=
dn
.
bv_val
,
end
=
&
dn
.
bv_val
[
dn
.
bv_len
];
ptr
<
end
;
ptr
++
)
{
if
(
ptr
[
0
]
==
LDAP_DIRSEP
[
0
]
)
{
nsep
++
;
}
}
if
(
nsep
)
{
char
*
p
;
dn
.
bv_len
+=
2
*
nsep
;
dn
.
bv_val
=
ch_malloc
(
dn
.
bv_len
+
1
);
for
(
ptr
=
orig_dn
->
bv_val
,
end
=
&
orig_dn
->
bv_val
[
orig_dn
->
bv_len
],
p
=
dn
.
bv_val
;
ptr
<
end
;
ptr
++
,
p
++
)
{
static
const
char
hex
[]
=
"0123456789ABCDEF"
;
if
(
ptr
[
0
]
==
LDAP_DIRSEP
[
0
]
)
{
*
p
++
=
'\\'
;
/* FIXME: fs-escape */
*
p
++
=
hex
[(
LDAP_DIRSEP
[
0
]
&
0xF0U
)
>>
4
];
*
p
=
hex
[
LDAP_DIRSEP
[
0
]
&
0x0FU
];
}
else
{
p
[
0
]
=
ptr
[
0
];
}
}
p
[
0
]
=
'\0'
;
}
res
->
bv_len
=
dn
.
bv_len
+
base_path
->
bv_len
+
1
+
STRLENOF
(
LDIF
);
res
->
bv_val
=
ch_malloc
(
res
->
bv_len
+
1
);
ptr
=
lutil_strcopy
(
res
->
bv_val
,
base_path
->
bv_val
);
*
ptr
++
=
LDAP_DIRSEP
[
0
];
ptr
=
lutil_strcopy
(
ptr
,
suffixdn
->
bv_val
);
end
=
dn
->
bv_val
+
dn
->
bv_len
-
suffixdn
->
bv_len
-
1
;
while
(
end
>
dn
->
bv_val
)
{
for
(
sep
=
end
-
1
;
sep
>=
dn
->
bv_val
&&
!
DN_SEPARATOR
(
*
sep
);
sep
--
);
end
=
dn
.
bv_val
+
dn
.
bv_len
-
suffixdn
->
bv_len
-
1
;
while
(
end
>
dn
.
bv_val
)
{
for
(
sep
=
end
-
1
;
sep
>=
dn
.
bv_val
&&
!
DN_SEPARATOR
(
*
sep
);
sep
--
);
*
ptr
++
=
LDAP_DIRSEP
[
0
];
ptr
=
lutil_strncopy
(
ptr
,
sep
+
1
,
end
-
sep
-
1
);
end
=
sep
;
...
...
@@ -125,6 +156,9 @@ dn2path(struct berval * dn, struct berval * suffixdn, struct berval * base_path,
}
}
#endif
if
(
dn
.
bv_val
!=
orig_dn
->
bv_val
)
{
ch_free
(
dn
.
bv_val
);
}
}
static
char
*
slurp_file
(
int
fd
)
{
...
...
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