From owner-svn-ports-all@freebsd.org Sun Dec 25 15:15:39 2016 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9873EC8F90C; Sun, 25 Dec 2016 15:15:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 677BB31B; Sun, 25 Dec 2016 15:15:39 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBPFFcik071054; Sun, 25 Dec 2016 15:15:38 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBPFFc5r071052; Sun, 25 Dec 2016 15:15:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201612251515.uBPFFc5r071052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sun, 25 Dec 2016 15:15:38 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r429439 - in head/ports-mgmt/pkg: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Dec 2016 15:15:39 -0000 Author: bapt Date: Sun Dec 25 15:15:38 2016 New Revision: 429439 URL: https://svnweb.freebsd.org/changeset/ports/429439 Log: Fix file descriptor leak that might lead to errors on packages with lots of files PR: 215544 Submitted by: pasokondokoro@gmail.com Added: head/ports-mgmt/pkg/files/patch-libpkg_pkg__add.c (contents, props changed) Modified: head/ports-mgmt/pkg/Makefile Modified: head/ports-mgmt/pkg/Makefile ============================================================================== --- head/ports-mgmt/pkg/Makefile Sun Dec 25 15:08:35 2016 (r429438) +++ head/ports-mgmt/pkg/Makefile Sun Dec 25 15:15:38 2016 (r429439) @@ -2,6 +2,7 @@ PORTNAME= pkg DISTVERSION= 1.9.4 +PORTREVISION= 1 _PKG_VERSION= ${DISTVERSION} CATEGORIES= ports-mgmt MASTER_SITES= \ Added: head/ports-mgmt/pkg/files/patch-libpkg_pkg__add.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/ports-mgmt/pkg/files/patch-libpkg_pkg__add.c Sun Dec 25 15:15:38 2016 (r429439) @@ -0,0 +1,22 @@ +--- libpkg/pkg_add.c.orig 2016-12-25 15:12:01 UTC ++++ libpkg/pkg_add.c +@@ -1344,8 +1344,10 @@ pkg_add_fromdir(struct pkg *pkg, const c + } + kh_find(hls, hardlinks, st.st_ino, path); + if (path != NULL) { +- if (create_hardlink(pkg, f, path) == EPKG_FATAL) ++ if (create_hardlink(pkg, f, path) == EPKG_FATAL) { ++ close(fd); + return (EPKG_FATAL); ++ } + } else { + if (create_regfile(pkg, f, NULL, NULL, fd, NULL) == EPKG_FATAL) { + close(fd); +@@ -1353,6 +1355,7 @@ pkg_add_fromdir(struct pkg *pkg, const c + } + kh_safe_add(hls, hardlinks, f->path, st.st_ino); + } ++ close(fd); + } else { + pkg_emit_error("Invalid file type"); + return (EPKG_FATAL);