summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorнаб <nabijaczleweli@nabijaczleweli.xyz>2021-04-11 20:12:50 +0200
committerTony Hutter <hutter2@llnl.gov>2021-06-23 13:22:14 -0700
commitfaad85637b21ded0e454cd339c770a17a2fb28f1 (patch)
treea78861626bdc9f88b2ada16b73301167d54f876a
parent501da8d433f3e9a56c1b61b2f2973e0553cd42f7 (diff)
freebsd/libshare: nfs: make nfs_is_shared() thread-safe
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Wilson <gwilson@delphix.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #11886
-rw-r--r--lib/libshare/os/freebsd/nfs.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/libshare/os/freebsd/nfs.c b/lib/libshare/os/freebsd/nfs.c
index 9cd7dfa95..130d521b7 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);