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
f21649c9
Commit
f21649c9
authored
23 years ago
by
Pierangelo Masarati
Browse files
Options
Downloads
Patches
Plain Diff
fix backend suffix allocation bug; add better versioning to main entry
parent
e754997d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/back-monitor/init.c
+33
-13
33 additions, 13 deletions
servers/slapd/back-monitor/init.c
with
33 additions
and
13 deletions
servers/slapd/back-monitor/init.c
+
33
−
13
View file @
f21649c9
...
...
@@ -41,11 +41,6 @@
#include
"slap.h"
#include
"back-monitor.h"
/*
* database monitor can be defined once only
*/
static
int
monitor_defined
=
0
;
/*
* used by many functions to add description to entries
*/
...
...
@@ -206,8 +201,14 @@ monitor_back_db_init(
Entry
*
e
,
*
e_tmp
;
struct
monitorentrypriv
*
mp
;
int
i
;
char
buf
[
1024
],
*
ndn
;
char
buf
[
1024
],
*
ndn
,
*
end_of_line
;
const
char
*
text
;
struct
berval
val
,
*
bv
[
2
]
=
{
&
val
,
NULL
};
/*
* database monitor can be defined once only
*/
static
int
monitor_defined
=
0
;
if
(
monitor_defined
)
{
#ifdef NEW_LOGGING
...
...
@@ -226,7 +227,6 @@ monitor_back_db_init(
charray_add
(
&
be
->
be_suffix
,
ndn
);
dn_normalize
(
ndn
);
ber_bvecadd
(
&
be
->
be_nsuffix
,
ber_bvstr
(
ndn
)
);
ch_free
(
ndn
);
mi
=
(
struct
monitorinfo
*
)
ch_calloc
(
sizeof
(
struct
monitorinfo
),
1
);
ldap_pvt_thread_mutex_init
(
&
mi
->
mi_cache_mutex
);
...
...
@@ -242,10 +242,14 @@ monitor_back_db_init(
#endif
return
(
-
1
);
}
/*
* Create all the subsystem specific entries
*/
e_tmp
=
NULL
;
for
(
i
=
0
;
monitor_subsys
[
i
].
mss_name
!=
NULL
;
i
++
)
{
int
len
=
strlen
(
monitor_subsys
[
i
].
mss_name
);
monitor_subsys
[
i
].
mss_rdn
=
ch_calloc
(
sizeof
(
char
),
4
+
len
);
strcpy
(
monitor_subsys
[
i
].
mss_rdn
,
"cn="
);
...
...
@@ -316,7 +320,6 @@ monitor_back_db_init(
/*
* creates the "cn=Monitor" entry
* and all the subsystem specific entries
*/
snprintf
(
buf
,
sizeof
(
buf
),
"dn: %s
\n
"
...
...
@@ -327,10 +330,8 @@ monitor_back_db_init(
#else
/* !SLAPD_MONITORSUBENTRY */
"objectClass: extensibleObject
\n
"
#endif
/* !SLAPD_MONITORSUBENTRY */
"cn: Monitor
\n
"
"description: %s"
,
SLAPD_MONITOR_DN
,
/* (char *) Versionstr */
"slapd 2.0"
"cn: Monitor"
,
SLAPD_MONITOR_DN
);
e
=
str2entry
(
buf
);
if
(
e
==
NULL
)
{
...
...
@@ -345,6 +346,25 @@ monitor_back_db_init(
#endif
return
(
-
1
);
}
val
.
bv_val
=
(
char
*
)
Versionstr
;
end_of_line
=
strchr
(
Versionstr
,
'\n'
);
if
(
end_of_line
)
{
val
.
bv_len
=
end_of_line
-
Versionstr
;
}
else
{
val
.
bv_len
=
strlen
(
Versionstr
);
}
if
(
attr_merge
(
e
,
monitor_ad_desc
,
bv
)
)
{
#ifdef NEW_LOGGING
LDAP_LOG
((
"operation"
,
LDAP_LEVEL_CRIT
,
"unable to add description to '%s' entry
\n
"
,
SLAPD_MONITOR_DN
));
#else
Debug
(
LDAP_DEBUG_ANY
,
"unable to add description to '%s' entry
\n
%s%s"
,
SLAPD_MONITOR_DN
,
""
,
""
);
#endif
return
(
-
1
);
}
mp
=
(
struct
monitorentrypriv
*
)
ch_calloc
(
sizeof
(
struct
monitorentrypriv
),
1
);
e
->
e_private
=
(
void
*
)
mp
;
...
...
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