Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src: pre-pkg: allow only white-listed directories.
@ 2020-05-17 11:44 sgn
  2020-05-17 12:08 ` [PR PATCH] [Updated] " sgn
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: sgn @ 2020-05-17 11:44 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 354 bytes --]

There is a new pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages pkg-lint-allow-only-whitelist
https://github.com/void-linux/void-packages/pull/22035

xbps-src: pre-pkg: allow only white-listed directories.


A patch file from https://github.com/void-linux/void-packages/pull/22035.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-pkg-lint-allow-only-whitelist-22035.patch --]
[-- Type: text/x-diff, Size: 1403 bytes --]

From 5a41f09421120dd025a24621e5696e278f0c9ecc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx+sgn@gmail.com>
Date: Sun, 17 May 2020 18:42:43 +0700
Subject: [PATCH] xbps-src: pre-pkg: allow only white-listed directories.

---
 common/hooks/pre-pkg/99-pkglint.sh | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/common/hooks/pre-pkg/99-pkglint.sh b/common/hooks/pre-pkg/99-pkglint.sh
index d2c281e39db..afce5617ffb 100644
--- a/common/hooks/pre-pkg/99-pkglint.sh
+++ b/common/hooks/pre-pkg/99-pkglint.sh
@@ -21,13 +21,30 @@ hook() {
 		fi
 	done
 	
-	for f in sys dev home root run var/run tmp usr/local destdir; do
+	for f in var/run usr/local; do
 		if [ -d ${PKGDESTDIR}/${f} ]; then
 			msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n"
 			error=1
 		fi
 	done
 
+	for f in "$PKGDESTDIR"/*; do
+		f="${f##*/}"
+		case "$f" in
+		lib|bin|sbin|lib64|lib32|usr|var|opt|etc|boot) ;;
+		INSTALL|REMOVE|rdeps|shlib-requires)
+			if [ ! -f "${PKGDESTDIR}/$f" ]; then
+				msg_red "${pkgver}: /${f} is not allowed\n"
+				error=1
+			fi
+			;;
+		*)
+			msg_red "${pkgver}: /${f} directory is not allowed, remove it!\n"
+			error=1
+			;;
+		esac
+	done
+
 	# Check that configuration files really exist.
 	for f in $(expand_destdir "${conf_files}"); do
 		if [ ! -f "${PKGDESTDIR}/${f}" ]; then

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2020-05-31  2:11 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-17 11:44 [PR PATCH] xbps-src: pre-pkg: allow only white-listed directories sgn
2020-05-17 12:08 ` [PR PATCH] [Updated] " sgn
2020-05-19 22:50 ` sgn
2020-05-19 22:56 ` Chocimier
2020-05-19 23:07 ` [PR PATCH] [Updated] " sgn
2020-05-19 23:12 ` sgn
2020-05-19 23:12 ` sgn
2020-05-19 23:15 ` jnbr
2020-05-19 23:19 ` q66
2020-05-19 23:23 ` [PR PATCH] [Updated] " sgn
2020-05-19 23:26 ` sgn
2020-05-19 23:27 ` sgn
2020-05-21 15:33 ` [PR PATCH] [Updated] " sgn
2020-05-22 17:35 ` Chocimier
2020-05-23 11:48 ` [PR PATCH] [Updated] " sgn
2020-05-23 11:56 ` sgn
2020-05-31  2:11 ` [PR PATCH] [Merged]: " sgn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).