From 7989351e3a551332fa0aa5b8f57417818ebf0141 Mon Sep 17 00:00:00 2001 From: Mid Favila Date: Tue, 17 May 2022 12:00:26 -0400 Subject: [PATCH] patch sup to allow running user-writable binaries -- need to make a little more secure in the future, but without this change you cant run symlinks --- ports/unofficial/stable/pcre/checksums | 2 +- ports/unofficial/stable/pcre/sources | 2 +- ports/unofficial/stable/sup/build | 5 +++++ ports/unofficial/stable/sup/checksums | 1 + ports/unofficial/stable/sup/files/mods.patch | 13 +++++++++++++ ports/unofficial/stable/sup/sources | 1 + 6 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 ports/unofficial/stable/sup/files/mods.patch diff --git a/ports/unofficial/stable/pcre/checksums b/ports/unofficial/stable/pcre/checksums index 9d61417..cae22a4 100644 --- a/ports/unofficial/stable/pcre/checksums +++ b/ports/unofficial/stable/pcre/checksums @@ -1 +1 @@ -aecafd4af3bd0f3935721af77b889d9024b2e01d96b58471bd91a3063fb47728 pcre-8.44.tar.gz +4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 diff --git a/ports/unofficial/stable/pcre/sources b/ports/unofficial/stable/pcre/sources index 3824807..3169c3b 100644 --- a/ports/unofficial/stable/pcre/sources +++ b/ports/unofficial/stable/pcre/sources @@ -1 +1 @@ -https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz +https://downloads.sourceforge.net/project/pcre/pcre/8.45/pcre-8.45.tar.gz diff --git a/ports/unofficial/stable/sup/build b/ports/unofficial/stable/sup/build index f25a0af..4d48372 100755 --- a/ports/unofficial/stable/sup/build +++ b/ports/unofficial/stable/sup/build @@ -1,4 +1,9 @@ #!/bin/sh -e +for patch in *.patch +do + patch < $patch +done + make PREFIX="/usr" install -Dm4711 sup "$1/usr/bin/sup" diff --git a/ports/unofficial/stable/sup/checksums b/ports/unofficial/stable/sup/checksums index 9ee9b05..86985dd 100644 --- a/ports/unofficial/stable/sup/checksums +++ b/ports/unofficial/stable/sup/checksums @@ -1,3 +1,4 @@ 689b50e1d33117c2ec5896b3d25d283f9cd8e4725211634884fca94082b89fd9 b687afe0d8f40cda6503d6158bcda09d8343e73a4986f100f38b8800426f4006 5d7e71eb7602ab48643720e5dfd193fdd817adb246dba0e2e5b95bf7fc516106 +97f5eb610fc2a67fb7f068537c7f8389d8b70d4bcd083a100409fc3e2c1ae092 diff --git a/ports/unofficial/stable/sup/files/mods.patch b/ports/unofficial/stable/sup/files/mods.patch new file mode 100644 index 0000000..b44dfb9 --- /dev/null +++ b/ports/unofficial/stable/sup/files/mods.patch @@ -0,0 +1,13 @@ +--- sup.c 2022-05-17 11:48:53.818387334 -0400 ++++ sup-patched.c 2022-05-17 11:48:28.198387683 -0400 +@@ -312,8 +312,8 @@ + if (lstat (fullcmd, &st) == -1) + return error("lstat", "cannot stat program"); + // command has wrong permissions (writable to others) +- if (st.st_mode & 0022) +- return error("perm", "cannot run binaries others can write."); ++ /*if (st.st_mode & 0022) ++ return error("perm", "cannot run binaries others can write.");*/ + // user UID is not root + if (uid != SETUID + // and is not unlocked diff --git a/ports/unofficial/stable/sup/sources b/ports/unofficial/stable/sup/sources index da8b254..3317ca8 100644 --- a/ports/unofficial/stable/sup/sources +++ b/ports/unofficial/stable/sup/sources @@ -1,3 +1,4 @@ https://files.dyne.org/sup/sup-1.1.tar.gz files/config.def.h files/Makefile +files/mods.patch