From 0beaa38406f98d9d9ee17524bb907688dc9361b7 Mon Sep 17 00:00:00 2001 From: lukem Date: Thu, 26 Dec 2002 12:53:59 +0000 Subject: [PATCH] If we're going to replace strtok() with strtok_r(), and the caller of the latter is invoked recursively, use static (instead of automatic) storage for the "last" pointer so that we remember where we're up to ... Fixes bug with hosts.deny rules such as "rpcbind: ALL EXCEPT some.domain". --- lib/libwrap/hosts_access.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/libwrap/hosts_access.c b/lib/libwrap/hosts_access.c index 4f204384f5dd..51063e4d118e 100644 --- a/lib/libwrap/hosts_access.c +++ b/lib/libwrap/hosts_access.c @@ -1,4 +1,4 @@ -/* $NetBSD: hosts_access.c,v 1.16 2002/06/22 11:52:40 itojun Exp $ */ +/* $NetBSD: hosts_access.c,v 1.17 2002/12/26 12:53:59 lukem Exp $ */ /* * This module implements a simple access control language that is based on @@ -24,7 +24,7 @@ #if 0 static char sccsid[] = "@(#) hosts_access.c 1.21 97/02/12 02:13:22"; #else -__RCSID("$NetBSD: hosts_access.c,v 1.16 2002/06/22 11:52:40 itojun Exp $"); +__RCSID("$NetBSD: hosts_access.c,v 1.17 2002/12/26 12:53:59 lukem Exp $"); #endif #endif @@ -202,7 +202,8 @@ char *list; struct request_info *request; int (*match_fn) __P((char *, struct request_info *)); { - char *tok, *last; + char *tok; + static char *last; int l; /*