Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Detect invalid packages that list directories in plist
Antoine Brodin committed 12 years ago
commit 3f20d05181a6b174d3a66f89202046a1497d8f4b
parent 17cff4a
1 file changed +6 -1
modified libpkg/pkg_ports.c
@@ -321,9 +321,14 @@ file(struct plist *p, char *line, struct file_attr *a)
		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);