Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Feb 2016 22:35:10 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r409566 - in head/ports-mgmt/pkg: . files
Message-ID:  <201602252235.u1PMZAfp012804@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Feb 25 22:35:10 2016
New Revision: 409566
URL: https://svnweb.freebsd.org/changeset/ports/409566

Log:
  Add missing patch for r409562

Added:
  head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch   (contents, props changed)
Modified:
  head/ports-mgmt/pkg/Makefile

Modified: head/ports-mgmt/pkg/Makefile
==============================================================================
--- head/ports-mgmt/pkg/Makefile	Thu Feb 25 22:27:41 2016	(r409565)
+++ head/ports-mgmt/pkg/Makefile	Thu Feb 25 22:35:10 2016	(r409566)
@@ -30,7 +30,7 @@ CFLAGS+=	-Wno-error
 EXTRA_PATCHES=	${FILESDIR}/extra-patch-docs_pkg.8
 .endif
 
-EXTRA_PATCHES+=	${FILESDIR}/0001-Fix-installation-of-hardlinks.patch:-p1
+EXTRA_PATCHES+=	${FILESDIR}/0001-Fix-installation-of-hardlinks.patch
 
 .include <bsd.port.pre.mk>
 

Added: head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/ports-mgmt/pkg/files/0001-Fix-installation-of-hardlinks.patch	Thu Feb 25 22:35:10 2016	(r409566)
@@ -0,0 +1,77 @@
+commit 34f3802a9e68f60e54671dca159c9e788063e291
+Author: Vsevolod Stakhov <vsevolod@highsecure.ru>
+Date:   Tue Feb 23 11:08:32 2016 +0000
+
+    Fix installation of hardlinks
+    
+    In case of hardlinks, `pathname` var was incorrectly restored from `rpath`
+    which is intended to be a temporary name. Hence, renaming was meaningless
+    afterwards.
+    
+    Issue: #1394
+    Reported by: many
+
+diff --git libpkg/pkg_add.c libpkg/pkg_add.c
+index adabb59..497e0fb 100644
+--- libpkg/pkg_add.c
++++ libpkg/pkg_add.c
+@@ -1,8 +1,9 @@
+ /*-
+  * Copyright (c) 2011-2013 Baptiste Daroussin <bapt@FreeBSD.org>
+  * Copyright (c) 2011-2012 Julien Laffaye <jlaffaye@FreeBSD.org>
++ * Copyright (c) 2016, Vsevolod Stakhov
+  * All rights reserved.
+- * 
++ *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+@@ -12,7 +13,7 @@
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+- * 
++ *
+  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+@@ -118,7 +119,7 @@ attempt_to_merge(bool renamed, struct pkg_config_file *rcf,
+ 		pkg_debug(3, "Empty configuration content for local package");
+ 		return;
+ 	}
+-	
++
+ 	pkg_debug(1, "Config file found %s", pathname);
+ 	file_to_buffer(pathname, &localconf, &sz);
+ 
+@@ -182,7 +183,7 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
+ 	int	retcode = EPKG_OK;
+ 	int	ret = 0, cur_file = 0;
+ 	char	path[MAXPATHLEN], pathname[MAXPATHLEN], rpath[MAXPATHLEN];
+-	char	linkpath[MAXPATHLEN], bd[MAXPATHLEN], *cp;
++	char	linkpath[MAXPATHLEN], tmppath[MAXPATHLEN], bd[MAXPATHLEN], *cp;
+ 	const char *lp;
+ 	struct stat st;
+ 	const struct stat *aest;
+@@ -244,17 +245,16 @@ do_extract(struct archive *a, struct archive_entry *ae, const char *location,
+ 
+ 		archive_entry_set_pathname(ae, rpath);
+ 		/*
+-		 * Deal with hardlinks to rooted path.  Use pathname as
+-		 * temporary work space, restore it from rpath for use below.
++		 * Deal with hardlinks to rooted path.  Use tmppath as
++		 * temporary work space
+ 		 */
+ 		lp = archive_entry_hardlink(ae);
+ 		if (lp != NULL) {
+ 			pkg_absolutepath(lp, linkpath, sizeof(linkpath));
+-			snprintf(pathname, sizeof(pathname), "%s%s%s",
++			snprintf(tmppath, sizeof(tmppath), "%s%s%s",
+ 			    location ? location : "", *linkpath == '/' ? "" : "/",
+ 			    linkpath);
+-			archive_entry_set_hardlink(ae, pathname);
+-			strcpy(pathname, rpath);
++			archive_entry_set_hardlink(ae, tmppath);
+ 		}
+ 
+ 		/* load in memory the content of config files */



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