aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authorantoine <antoine@FreeBSD.org>2014-04-02 02:34:03 +0800
committerantoine <antoine@FreeBSD.org>2014-04-02 02:34:03 +0800
commit7cb65e934f5bed92ba80e594135ae90aac4449a6 (patch)
tree5c929d346c5fe7d21e2a600b746db4fe2e934e89 /ports-mgmt
parent0a71474fc86675ee72c1db0123a41a9746e5b366 (diff)
downloadfreebsd-ports-gnome-7cb65e934f5bed92ba80e594135ae90aac4449a6.tar.gz
freebsd-ports-gnome-7cb65e934f5bed92ba80e594135ae90aac4449a6.tar.zst
freebsd-ports-gnome-7cb65e934f5bed92ba80e594135ae90aac4449a6.zip
Detect invalid packages that list directories as a file in plist
Exp-run by: bdrewery With hat: portmgr
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/pkg/Makefile1
-rw-r--r--ports-mgmt/pkg/files/patch-libpkg__pkg_ports.c18
2 files changed, 19 insertions, 0 deletions
diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile
index a7e76ab67e6a..7059515e3306 100644
--- a/ports-mgmt/pkg/Makefile
+++ b/ports-mgmt/pkg/Makefile
@@ -2,6 +2,7 @@
PORTNAME= pkg
DISTVERSION= 1.2.7
+PORTREVISION= 1
CATEGORIES= ports-mgmt
MASTER_SITES= \
http://files.etoilebsd.net/${PORTNAME}/ \
diff --git a/ports-mgmt/pkg/files/patch-libpkg__pkg_ports.c b/ports-mgmt/pkg/files/patch-libpkg__pkg_ports.c
new file mode 100644
index 000000000000..bd6538c46bc4
--- /dev/null
+++ b/ports-mgmt/pkg/files/patch-libpkg__pkg_ports.c
@@ -0,0 +1,18 @@
+--- ./libpkg/pkg_ports.c.orig 2014-03-15 13:15:46.000000000 +0000
++++ ./libpkg/pkg_ports.c 2014-04-01 18:20:02.000000000 +0000
+@@ -318,9 +318,14 @@
+ buf = NULL;
+ regular = false;
+
+- if (S_ISREG(st.st_mode))
++ if (S_ISDIR(st.st_mode)) {
++ pkg_emit_error("Plist error, directory listed as a file: %s", line);
++ free_file_attr(a);
++ return (EPKG_FATAL);
++ } else if (S_ISREG(st.st_mode))
+ regular = true;
+
++
+ /* special case for hardlinks */
+ if (st.st_nlink > 1)
+ regular = is_hardlink(p->hardlinks, &st);