Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Dec 2016 15:15:38 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
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
Message-ID:  <201612251515.uBPFFc5r071052@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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