Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] xbps-src: pre-pkg: allow only white-listed directories.
Date: Sun, 17 May 2020 14:08:59 +0200	[thread overview]
Message-ID: <20200517120859.sax-uwlBhtrvdCj0HxNIuO3oGANAcm7xnUe-9MjhVVg@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-22035@inbox.vuxu.org>

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

There is an updated 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: 1418 bytes --]

From bd593e72953839ef24c34b4cf22da7c48d77986a 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..51cb5337c25 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|shlib-provides)
+			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

  reply	other threads:[~2020-05-17 12:09 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-17 11:44 [PR PATCH] " sgn
2020-05-17 12:08 ` sgn [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200517120859.sax-uwlBhtrvdCj0HxNIuO3oGANAcm7xnUe-9MjhVVg@z \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).