Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Dubner
OpenLDAP
Commits
fc49135a
Commit
fc49135a
authored
Jan 01, 1999
by
Kurt Zeilenga
Browse files
Import unprotected strtok fix from -devel. Yes, you have to edit 8 files
to add a simple mutex. Should be two (proto-slap.h & init.c).
parent
2532c072
Changes
9
Hide whitespace changes
Inline
Side-by-side
servers/slapd/charray.c
View file @
fc49135a
...
...
@@ -128,10 +128,16 @@ str2charray( char *str, char *brkstr )
res
=
(
char
**
)
ch_malloc
(
(
i
+
1
)
*
sizeof
(
char
*
)
);
i
=
0
;
pthread_mutex_lock
(
&
strtok_mutex
);
for
(
s
=
strtok
(
str
,
brkstr
);
s
!=
NULL
;
s
=
strtok
(
NULL
,
brkstr
)
)
{
res
[
i
++
]
=
ch_strdup
(
s
);
}
pthread_mutex_unlock
(
&
strtok_mutex
);
res
[
i
]
=
NULL
;
free
(
str
);
...
...
servers/slapd/init.c
View file @
fc49135a
...
...
@@ -17,6 +17,7 @@ init( void )
pthread_mutex_init
(
&
active_threads_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
new_conn_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
currenttime_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
strtok_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
entry2str_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
replog_mutex
,
pthread_mutexattr_default
);
pthread_mutex_init
(
&
ops_mutex
,
pthread_mutexattr_default
);
...
...
servers/slapd/main.c
View file @
fc49135a
...
...
@@ -36,6 +36,7 @@ char **g_argv;
*/
time_t
currenttime
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
int
active_threads
;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
...
...
servers/slapd/proto-slap.h
View file @
fc49135a
...
...
@@ -241,6 +241,7 @@ extern long ops_completed;
extern
long
ops_initiated
;
extern
pthread_mutex_t
active_threads_mutex
;
extern
pthread_mutex_t
currenttime_mutex
;
extern
pthread_mutex_t
strtok_mutex
;
extern
pthread_mutex_t
entry2str_mutex
;
extern
pthread_mutex_t
new_conn_mutex
;
extern
pthread_mutex_t
num_sent_mutex
;
...
...
servers/slapd/tools/ldbmtest.c
View file @
fc49135a
...
...
@@ -49,6 +49,7 @@ pthread_mutex_t entry2str_mutex;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
pthread_mutex_t
replog_mutex
;
pthread_mutex_t
ops_mutex
;
pthread_mutex_t
regex_mutex
;
...
...
servers/slapd/tools/ldif2id2children.c
View file @
fc49135a
...
...
@@ -31,6 +31,7 @@ pthread_mutex_t entry2str_mutex;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
pthread_mutex_t
replog_mutex
;
pthread_mutex_t
ops_mutex
;
pthread_mutex_t
regex_mutex
;
...
...
servers/slapd/tools/ldif2id2entry.c
View file @
fc49135a
...
...
@@ -28,6 +28,7 @@ pthread_mutex_t entry2str_mutex;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
pthread_mutex_t
replog_mutex
;
pthread_mutex_t
ops_mutex
;
pthread_mutex_t
regex_mutex
;
...
...
servers/slapd/tools/ldif2index.c
View file @
fc49135a
...
...
@@ -30,6 +30,7 @@ pthread_mutex_t entry2str_mutex;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
pthread_mutex_t
replog_mutex
;
pthread_mutex_t
ops_mutex
;
pthread_mutex_t
regex_mutex
;
...
...
servers/slapd/tools/ldif2ldbm.c
View file @
fc49135a
...
...
@@ -34,6 +34,7 @@ pthread_mutex_t entry2str_mutex;
pthread_mutex_t
active_threads_mutex
;
pthread_mutex_t
new_conn_mutex
;
pthread_mutex_t
currenttime_mutex
;
pthread_mutex_t
strtok_mutex
;
pthread_mutex_t
replog_mutex
;
pthread_mutex_t
ops_mutex
;
pthread_mutex_t
regex_mutex
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment