* [nfs-utils PATCH V2 1/2] Replace non-thread-safe strtok function calls in gssd
@ 2017-02-09 23:01 Frank Sorenson
2017-02-16 10:23 ` Steve Dickson
0 siblings, 1 reply; 2+ messages in thread
From: Frank Sorenson @ 2017-02-09 23:01 UTC (permalink / raw)
To: linux-nfs
Author: Frank Sorenson <sorenson@redhat.com>
Date: 2017-02-09 16:35:51 -0600
gssd: replace non-thread-safe strtok with strsep
gssd uses the non-thread-safe strtok() function, which
can lead to incorrect program behavior.
Replace strtok() with the thread-safe strsep().
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
index d74d372..30c6ace 100644
--- a/utils/gssd/gssd_proc.c
+++ b/utils/gssd/gssd_proc.c
@@ -729,10 +729,11 @@ handle_gssd_upcall(struct clnt_upcall_info *info)
char *target = NULL;
char *service = NULL;
char *enctypes = NULL;
+ char *pbuf = info->lbuf;
printerr(2, "\n%s: '%s' (%s)\n", __func__, info->lbuf, clp->relpath);
- for (p = strtok(info->lbuf, " "); p; p = strtok(NULL, " ")) {
+ while ((p = strsep(&pbuf, " "))) {
if (!strncmp(p, "mech=", strlen("mech=")))
mech = p + strlen("mech=");
else if (!strncmp(p, "uid=", strlen("uid=")))
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [nfs-utils PATCH V2 1/2] Replace non-thread-safe strtok function calls in gssd
2017-02-09 23:01 [nfs-utils PATCH V2 1/2] Replace non-thread-safe strtok function calls in gssd Frank Sorenson
@ 2017-02-16 10:23 ` Steve Dickson
0 siblings, 0 replies; 2+ messages in thread
From: Steve Dickson @ 2017-02-16 10:23 UTC (permalink / raw)
To: Frank Sorenson, linux-nfs
On 02/09/2017 06:01 PM, Frank Sorenson wrote:
> Author: Frank Sorenson <sorenson@redhat.com>
> Date: 2017-02-09 16:35:51 -0600
>
> gssd: replace non-thread-safe strtok with strsep
>
> gssd uses the non-thread-safe strtok() function, which
> can lead to incorrect program behavior.
>
> Replace strtok() with the thread-safe strsep().
>
> Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Committed....
steved.
>
> diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
> index d74d372..30c6ace 100644
> --- a/utils/gssd/gssd_proc.c
> +++ b/utils/gssd/gssd_proc.c
> @@ -729,10 +729,11 @@ handle_gssd_upcall(struct clnt_upcall_info *info)
> char *target = NULL;
> char *service = NULL;
> char *enctypes = NULL;
> + char *pbuf = info->lbuf;
>
> printerr(2, "\n%s: '%s' (%s)\n", __func__, info->lbuf, clp->relpath);
>
> - for (p = strtok(info->lbuf, " "); p; p = strtok(NULL, " ")) {
> + while ((p = strsep(&pbuf, " "))) {
> if (!strncmp(p, "mech=", strlen("mech=")))
> mech = p + strlen("mech=");
> else if (!strncmp(p, "uid=", strlen("uid=")))
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-02-16 10:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 23:01 [nfs-utils PATCH V2 1/2] Replace non-thread-safe strtok function calls in gssd Frank Sorenson
2017-02-16 10:23 ` Steve Dickson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.