svn commit: r429439 - in head/ports-mgmt/pkg: . files

Baptiste Daroussin bapt at FreeBSD.org
Sun Dec 25 15:15:39 UTC 2016


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 at 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);


More information about the svn-ports-head mailing list