char *s;
restriction_t **rpp;
{
- char *sp = NULL, *tp, *ap;
+ char *sp = NULL, *tp, *ap, *save;
static const char *delims = "\t\n\f\v\r ,";
krb5_deltat dt;
krb5_flags flag;
code = ENOMEM;
} else {
memset(*rpp, 0, sizeof(**rpp));
- for (tp=strtok(sp, delims); tp; tp=strtok((char *)NULL, delims)) {
+ for (tp = strtok_r(sp, delims, &save); tp;
+ tp = strtok_r(NULL, delims, &save)) {
flag = 0;
if (!krb5_string_to_flags(tp, "+", "-", &flag)) {
/* OK, but was it in the positive or negative sense? */
(*rpp)->mask |= KADM5_POLICY_CLR;
} else {
/* everything else needs an argument ... */
- if (!(ap = strtok((char *)NULL, delims))) {
+ if (!(ap = strtok_r(NULL, delims, &save))) {
code = EINVAL;
break;
}
pkinit_identity_opts *idopts,
const char *residual)
{
- char *s, *cp, *vp;
+ char *s, *cp, *vp, *save;
krb5_error_code retval = ENOMEM;
if (residual == NULL || residual[0] == '\0')
if (s == NULL)
return retval;
- for ((cp = strtok(s, ":")); cp; (cp = strtok(NULL, ":"))) {
+ for (cp = strtok_r(s, ":", &save); cp; cp = strtok_r(NULL, ":", &save)) {
vp = strchr(cp, '=');
/* If there is no "=", this is a pkcs11 module name */
pkinit_identity_opts *idopts,
const char *residual)
{
- char *certname, *keyname;
+ char *certname, *keyname, *save;
krb5_error_code retval = ENOMEM;
if (residual == NULL || residual[0] == '\0')
if (certname == NULL)
goto cleanup;
- certname = strtok(certname, ",");
- keyname = strtok(NULL, ",");
+ certname = strtok_r(certname, ",", &save);
+ keyname = strtok_r(NULL, ",", &save);
idopts->cert_filename = strdup(certname);
if (idopts->cert_filename == NULL)