Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
openldap
OpenLDAP
Commits
e53214b2
Commit
e53214b2
authored
Jul 27, 2002
by
Kurt Zeilenga
Browse files
ITS#1965: use snprintf
parent
1677f178
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slurpd/args.c
View file @
e53214b2
...
...
@@ -113,15 +113,16 @@ doargs(
g
->
one_shot_mode
=
1
;
break
;
case
'r'
:
/* slapd replog file */
strncpy
(
g
->
slapd_replogfile
,
optarg
,
sizeof
(
g
->
slapd_replogfile
)
-
1
);
g
->
slapd_replogfile
[
sizeof
(
g
->
slapd_replogfile
)
-
1
]
=
'\0'
;
snprintf
(
g
->
slapd_replogfile
,
sizeof
g
->
slapd_replogfile
,
"%s"
,
optarg
);
rflag
++
;
break
;
case
't'
:
/* dir to use for our copies of replogs */
g
->
slurpd_rdir
=
(
char
*
)
malloc
(
strlen
(
optarg
)
+
sizeof
(
"/replica"
));
sprintf
(
g
->
slurpd_rdir
,
"%s"
LDAP_DIRSEP
"replica"
,
optarg
);
break
;
case
't'
:
{
/* dir to use for our copies of replogs */
size_t
sz
;
g
->
slurpd_rdir
=
(
char
*
)
malloc
(
sz
=
(
strlen
(
optarg
)
+
sizeof
(
"/replica"
)));
snprintf
(
g
->
slurpd_rdir
,
sz
,
"%s"
LDAP_DIRSEP
"replica"
,
optarg
);
}
break
;
default:
usage
(
g
->
myname
);
return
(
-
1
);
...
...
@@ -135,11 +136,13 @@ doargs(
}
/* Set location/name of our private copy of the slapd replog file */
sprintf
(
g
->
slurpd_replogfile
,
"%s"
LDAP_DIRSEP
"%s"
,
g
->
slurpd_rdir
,
snprintf
(
g
->
slurpd_replogfile
,
sizeof
g
->
slurpd_replogfile
,
"%s"
LDAP_DIRSEP
"%s"
,
g
->
slurpd_rdir
,
DEFAULT_SLURPD_REPLOGFILE
);
/* Set location/name of the slurpd status file */
sprintf
(
g
->
slurpd_status_file
,
"%s"
LDAP_DIRSEP
"%s"
,
g
->
slurpd_rdir
,
snprintf
(
g
->
slurpd_status_file
,
sizeof
g
->
slurpd_status_file
,
"%s"
LDAP_DIRSEP
"%s"
,
g
->
slurpd_rdir
,
DEFAULT_SLURPD_STATUS_FILE
);
ber_set_option
(
NULL
,
LBER_OPT_DEBUG_LEVEL
,
&
ldap_debug
);
...
...
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