Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Aug 2017 10:55:42 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r322231 - vendor/illumos/dist/lib/libzfs/common
Message-ID:  <201708081055.v78AtgCF034780@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Aug  8 10:55:42 2017
New Revision: 322231
URL: https://svnweb.freebsd.org/changeset/base/322231

Log:
  8430 dir_is_empty_readdir() doesn't properly handle error from fdopendir()
  
  illumos/illumos-gate@ba6e7e6505150388de6dc6a88741164118a421bf
  https://github.com/illumos/illumos-gate/commit/ba6e7e6505150388de6dc6a88741164118a421bf
  
  https://www.illumos.org/issues/8430
    we should close dirfd if fdopendir() fails.
  
  Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com>
  Reviewed by: Matthew Ahrens <mahrens@delphix.com>
  Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
  Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
  Reviewed by: Igor Kozhukhov <igor@dilos.org>
  Approved by: Robert Mustacchi <rm@joyent.com>
  Author: Sowrabha Gopal <sowrabha.gopal@delphix.com>

Modified:
  vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c

Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c
==============================================================================
--- vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c	Tue Aug  8 10:52:01 2017	(r322230)
+++ vendor/illumos/dist/lib/libzfs/common/libzfs_mount.c	Tue Aug  8 10:55:42 2017	(r322231)
@@ -209,6 +209,7 @@ dir_is_empty_readdir(const char *dirname)
 	}
 
 	if ((dirp = fdopendir(dirfd)) == NULL) {
+		(void) close(dirfd);
 		return (B_TRUE);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201708081055.v78AtgCF034780>