Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Check that a file requested in a manifest is a regular file or symlink.
John Hood committed 5 years ago
commit 53495e3154ea3ac7b6e5c9fe78b4948673dbfed7
parent 8b6755f
1 file changed +6 -0
modified libpkg/pkg_create.c
@@ -95,6 +95,12 @@ pkg_create_from_dir(struct pkg *pkg, const char *root,
			return (EPKG_FATAL);
		}

+
		if (!(S_ISREG(st.st_mode) || S_ISLNK(st.st_mode))) {
+
			pkg_emit_error("file '%s' is not a regular file", fpath);
+
			kh_destroy_hardlinks(hardlinks);
+
			return (EPKG_FATAL);
+
		}
+

		if (file->size == 0)
			file->size = (int64_t)st.st_size;