From faad85637b21ded0e454cd339c770a17a2fb28f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 11 Apr 2021 20:12:50 +0200 Subject: [PATCH] freebsd/libshare: nfs: make nfs_is_shared() thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Brian Behlendorf Reviewed-by: George Wilson Signed-off-by: Ahelenia ZiemiaƄska Closes #11886 --- lib/libshare/os/freebsd/nfs.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c index 9cd7dfa95a..130d521b7c 100644 --- a/lib/libshare/os/freebsd/nfs.c +++ b/lib/libshare/os/freebsd/nfs.c @@ -361,14 +361,10 @@ nfs_disable_share(sa_share_impl_t impl_share) return (error); } -/* - * NOTE: This function returns a static buffer and thus is not thread-safe. - */ static boolean_t nfs_is_shared(sa_share_impl_t impl_share) { - static char line[MAXLINESIZE]; - char *s, last; + char *s, last, line[MAXLINESIZE]; size_t len; char *mntpoint = impl_share->sa_mountpoint; size_t mntlen = strlen(mntpoint);