diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-03-14 15:32:49 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-03-14 15:32:49 +0000 |
commit | e212576dba4a3d9983dd5211b2cdb1e427d35fbb (patch) | |
tree | 4e2dd1fff1eb3ad7a1f5324ad1dac8f43777cd18 /winsup | |
parent | 78d2c08cd9126d39c43c6110eca65bb53c798bd2 (diff) | |
download | newlib-e212576dba4a3d9983dd5211b2cdb1e427d35fbb.zip newlib-e212576dba4a3d9983dd5211b2cdb1e427d35fbb.tar.gz newlib-e212576dba4a3d9983dd5211b2cdb1e427d35fbb.tar.bz2 |
* environ.cc (parse_options): Use strtok_r instead of strtok.
* security.cc (convert_string_sid_to_sid): Ditto.
(aclfromtext): Ditto. Fix buffer usage.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/environ.cc | 6 | ||||
-rw-r--r-- | winsup/cygwin/security.cc | 12 |
3 files changed, 19 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 899c711..b34736d 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Wed Mar 14 16:30:00 2001 Corinna Vinschen <corinna@vinschen.de> + + * environ.cc (parse_options): Use strtok_r instead of strtok. + * security.cc (convert_string_sid_to_sid): Ditto. + (aclfromtext): Ditto. Fix buffer usage. + Wed Mar 14 10:11:00 2001 Corinna Vinschen <corinna@vinschen.de> * path.cc (lnk_suffixes): Remove. diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 77cf8da..a83c06e 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -465,7 +465,7 @@ static void __stdcall parse_options (char *buf) { int istrue; - char *p; + char *p, *lasts; parse_thing *k; if (buf == NULL) @@ -487,7 +487,9 @@ parse_options (char *buf) } buf = strcpy ((char *) alloca (strlen (buf) + 1), buf); - for (p = strtok (buf, " \t"); p != NULL; p = strtok (NULL, " \t")) + for (p = strtok_r (buf, " \t", &lasts); + p != NULL; + p = strtok_r (NULL, " \t", &lasts)) { if (!(istrue = !strncasematch (p, "no", 2))) p += 2; diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index a922365..def5685 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -92,7 +92,7 @@ PSID convert_string_sid_to_sid (PSID psid, const char *sid_str) { char sid_buf[256]; - char *t; + char *t, *lasts; DWORD cnt = 0; DWORD s = 0; DWORD i, r[8]; @@ -102,7 +102,9 @@ convert_string_sid_to_sid (PSID psid, const char *sid_str) strcpy (sid_buf, sid_str); - for (t = sid_buf + 4, i = 0; cnt < 8 && (t = strtok (t, "-")); t = NULL, ++i) + for (t = sid_buf + 4, i = 0; + cnt < 8 && (t = strtok_r (t, "-", &lasts)); + t = NULL, ++i) if (i == 0) s = strtoul (t, NULL, 10); else @@ -2110,7 +2112,11 @@ aclfromtext (char *acltextp, int *) aclent_t lacl[MAX_ACL_ENTRIES]; memset (lacl, 0, sizeof lacl); int pos = 0; - for (char *c = strtok (buf, ","); c; c = strtok (NULL, ",")) + strcpy (buf, acltextp); + char *lasts; + for (char *c = strtok_r (buf, ",", &lasts); + c; + c = strtok_r (NULL, ",", &lasts)) { if (!strncmp (c, "default", 7)) { |