From 219acd907bf041b7c42b3c8874e22c5b86bafcb2 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 b0394dfab0..56df3e6664 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);