summaryrefslogtreecommitdiffstats
path: root/lib/libshare
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libshare')
-rwxr-xr-x[-rw-r--r--]lib/libshare/nfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c
index d1b207e65..abcc1025b 100644..100755
--- a/lib/libshare/nfs.c
+++ b/lib/libshare/nfs.c
@@ -519,6 +519,7 @@ nfs_validate_shareopts(const char *shareopts)
static boolean_t
nfs_is_share_active(sa_share_impl_t impl_share)
{
+ int fd;
char line[512];
char *tab, *cur;
FILE *nfs_exportfs_temp_fp;
@@ -526,7 +527,10 @@ nfs_is_share_active(sa_share_impl_t impl_share)
if (!nfs_available())
return (B_FALSE);
- nfs_exportfs_temp_fp = fdopen(dup(nfs_exportfs_temp_fd), "r");
+ if ((fd = dup(nfs_exportfs_temp_fd)) == -1)
+ return (B_FALSE);
+
+ nfs_exportfs_temp_fp = fdopen(fd, "r");
if (nfs_exportfs_temp_fp == NULL ||
fseek(nfs_exportfs_temp_fp, 0, SEEK_SET) < 0) {