* [PR PATCH] runit: add chpst -C patch
@ 2023-04-13 5:34 classabbyamp
2023-04-13 5:37 ` classabbyamp
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: classabbyamp @ 2023-04-13 5:34 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
There is a new pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages runit-chpst-pwd
https://github.com/void-linux/void-packages/pull/43418
runit: add chpst -C patch
from https://github.com/void-linux/runit/commit/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb
#### Testing the changes
- I tested the changes in this PR: **briefly**
A patch file from https://github.com/void-linux/void-packages/pull/43418.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-runit-chpst-pwd-43418.patch --]
[-- Type: text/x-diff, Size: 3874 bytes --]
From 2e6251963489ff3e91b9ebfade625fd63eb0f509 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Thu, 13 Apr 2023 01:32:12 -0400
Subject: [PATCH] runit: add chpst -C patch
---
srcpkgs/runit/patches/chpst-pwd.patch | 77 +++++++++++++++++++++++++++
srcpkgs/runit/template | 2 +-
2 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/runit/patches/chpst-pwd.patch
diff --git a/srcpkgs/runit/patches/chpst-pwd.patch b/srcpkgs/runit/patches/chpst-pwd.patch
new file mode 100644
index 000000000000..c8ee7ed893ca
--- /dev/null
+++ b/srcpkgs/runit/patches/chpst-pwd.patch
@@ -0,0 +1,77 @@
+From 2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Mon, 14 Feb 2022 14:25:22 -0500
+Subject: [PATCH] chpst: add -C to change working directory
+
+---
+ man/chpst.8 | 8 ++++++++
+ src/chpst.c | 9 +++++++--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git runit-2.1.2/man/chpst.8 runit-2.1.2/man/chpst.8
+index 43c0b8d..e0829b6 100644
+--- runit-2.1.2/man/chpst.8
++++ runit-2.1.2/man/chpst.8
+@@ -146,6 +146,14 @@ Change the root directory to
+ before starting
+ .IR prog .
+ .TP
++.B \-C \fIpwd
++chdir.
++Change the working directory to
++.I pwd
++before starting
++.IR prog .
++When combined with \-/, the working directory is changed after the chroot.
++.TP
+ .B \-n \fIinc
+ nice.
+ Add
+diff --git runit-2.1.2/src/chpst.c runit-2.1.2/src/chpst.c
+index 1cca5f4..d597b68 100644
+--- runit-2.1.2/src/chpst.c
++++ runit-2.1.2/src/chpst.c
+@@ -20,7 +20,7 @@
+ #include "openreadclose.h"
+ #include "direntry.h"
+
+-#define USAGE_MAIN " [-vP012] [-u user[:group]] [-U user[:group]] [-b argv0] [-e dir] [-/ root] [-n nice] [-l|-L lock] [-m n] [-d n] [-o n] [-p n] [-f n] [-c n] prog"
++#define USAGE_MAIN " [-vP012] [-u user[:group]] [-U user[:group]] [-b argv0] [-e dir] [-/ root] [-C pwd] [-n nice] [-l|-L lock] [-m n] [-d n] [-o n] [-p n] [-f n] [-c n] prog"
+ #define FATAL "chpst: fatal: "
+ #define WARNING "chpst: warning: "
+
+@@ -60,6 +60,7 @@ long limitt =-2;
+ long nicelvl =0;
+ const char *lock =0;
+ const char *root =0;
++const char *pwd =0;
+ unsigned int lockdelay;
+
+ void suidgid(char *user, unsigned int ext) {
+@@ -286,7 +287,7 @@ int main(int argc, const char **argv) {
+ if (str_equal(progname, "setlock")) setlock(argc, argv);
+ if (str_equal(progname, "softlimit")) softlimit(argc, argv);
+
+- while ((opt =getopt(argc, argv, "u:U:b:e:m:d:o:p:f:c:r:t:/:n:l:L:vP012V"))
++ while ((opt =getopt(argc, argv, "u:U:b:e:m:d:o:p:f:c:r:t:/:C:n:l:L:vP012V"))
+ != opteof)
+ switch(opt) {
+ case 'u': set_user =(char*)optarg; break;
+@@ -305,6 +306,7 @@ int main(int argc, const char **argv) {
+ case 'r': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitr =ul; break;
+ case 't': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitt =ul; break;
+ case '/': root =optarg; break;
++ case 'C': pwd =optarg; break;
+ case 'n':
+ switch (*optarg) {
+ case '-':
+@@ -337,6 +339,9 @@ int main(int argc, const char **argv) {
+ if (chdir(root) == -1) fatal2("unable to change directory", root);
+ if (chroot(".") == -1) fatal("unable to change root directory");
+ }
++ if (pwd) {
++ if (chdir(pwd) == -1) fatal2("unable to change directory", pwd);
++ }
+ if (nicelvl) {
+ errno =0;
+ if (nice(nicelvl) == -1) if (errno) fatal("unable to set nice level");
diff --git a/srcpkgs/runit/template b/srcpkgs/runit/template
index 97c61ccbbaa6..fa0ee3cea552 100644
--- a/srcpkgs/runit/template
+++ b/srcpkgs/runit/template
@@ -1,7 +1,7 @@
# Template file for 'runit'
pkgname=runit
version=2.1.2
-revision=14
+revision=15
build_wrksrc="${pkgname}-${version}/src"
build_style="gnu-makefile"
short_desc="UNIX init scheme with service supervision"
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: runit: add chpst -C patch
2023-04-13 5:34 [PR PATCH] runit: add chpst -C patch classabbyamp
@ 2023-04-13 5:37 ` classabbyamp
2023-04-14 2:21 ` [PR PATCH] [Updated] " classabbyamp
2023-04-14 2:24 ` [PR PATCH] [Merged]: " classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2023-04-13 5:37 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 336 bytes --]
New comment by classabbyamp on void-packages repository
https://github.com/void-linux/void-packages/pull/43418#issuecomment-1506374046
Comment:
check failing because chpst has a "test" that checks the usage output... maybe we could get https://github.com/void-linux/runit/pull/23 in and get rid of all the patches at the same time :)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Updated] runit: add chpst -C patch
2023-04-13 5:34 [PR PATCH] runit: add chpst -C patch classabbyamp
2023-04-13 5:37 ` classabbyamp
@ 2023-04-14 2:21 ` classabbyamp
2023-04-14 2:24 ` [PR PATCH] [Merged]: " classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2023-04-14 2:21 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 496 bytes --]
There is an updated pull request by classabbyamp against master on the void-packages repository
https://github.com/classabbyamp/void-packages runit-chpst-pwd
https://github.com/void-linux/void-packages/pull/43418
runit: add chpst -C patch
from https://github.com/void-linux/runit/commit/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb
#### Testing the changes
- I tested the changes in this PR: **briefly**
A patch file from https://github.com/void-linux/void-packages/pull/43418.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-runit-chpst-pwd-43418.patch --]
[-- Type: text/x-diff, Size: 4223 bytes --]
From 4528d695e3e7d1f52f133aea9c9ccd769c0a73b4 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Thu, 13 Apr 2023 01:32:12 -0400
Subject: [PATCH] runit: add chpst -C patch
---
srcpkgs/runit/patches/chpst-pwd.patch | 77 +++++++++++++++++++++++++++
srcpkgs/runit/template | 4 +-
2 files changed, 80 insertions(+), 1 deletion(-)
create mode 100644 srcpkgs/runit/patches/chpst-pwd.patch
diff --git a/srcpkgs/runit/patches/chpst-pwd.patch b/srcpkgs/runit/patches/chpst-pwd.patch
new file mode 100644
index 000000000000..c8ee7ed893ca
--- /dev/null
+++ b/srcpkgs/runit/patches/chpst-pwd.patch
@@ -0,0 +1,77 @@
+From 2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb Mon Sep 17 00:00:00 2001
+From: "Andrew J. Hesford" <ajh@sideband.org>
+Date: Mon, 14 Feb 2022 14:25:22 -0500
+Subject: [PATCH] chpst: add -C to change working directory
+
+---
+ man/chpst.8 | 8 ++++++++
+ src/chpst.c | 9 +++++++--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git runit-2.1.2/man/chpst.8 runit-2.1.2/man/chpst.8
+index 43c0b8d..e0829b6 100644
+--- runit-2.1.2/man/chpst.8
++++ runit-2.1.2/man/chpst.8
+@@ -146,6 +146,14 @@ Change the root directory to
+ before starting
+ .IR prog .
+ .TP
++.B \-C \fIpwd
++chdir.
++Change the working directory to
++.I pwd
++before starting
++.IR prog .
++When combined with \-/, the working directory is changed after the chroot.
++.TP
+ .B \-n \fIinc
+ nice.
+ Add
+diff --git runit-2.1.2/src/chpst.c runit-2.1.2/src/chpst.c
+index 1cca5f4..d597b68 100644
+--- runit-2.1.2/src/chpst.c
++++ runit-2.1.2/src/chpst.c
+@@ -20,7 +20,7 @@
+ #include "openreadclose.h"
+ #include "direntry.h"
+
+-#define USAGE_MAIN " [-vP012] [-u user[:group]] [-U user[:group]] [-b argv0] [-e dir] [-/ root] [-n nice] [-l|-L lock] [-m n] [-d n] [-o n] [-p n] [-f n] [-c n] prog"
++#define USAGE_MAIN " [-vP012] [-u user[:group]] [-U user[:group]] [-b argv0] [-e dir] [-/ root] [-C pwd] [-n nice] [-l|-L lock] [-m n] [-d n] [-o n] [-p n] [-f n] [-c n] prog"
+ #define FATAL "chpst: fatal: "
+ #define WARNING "chpst: warning: "
+
+@@ -60,6 +60,7 @@ long limitt =-2;
+ long nicelvl =0;
+ const char *lock =0;
+ const char *root =0;
++const char *pwd =0;
+ unsigned int lockdelay;
+
+ void suidgid(char *user, unsigned int ext) {
+@@ -286,7 +287,7 @@ int main(int argc, const char **argv) {
+ if (str_equal(progname, "setlock")) setlock(argc, argv);
+ if (str_equal(progname, "softlimit")) softlimit(argc, argv);
+
+- while ((opt =getopt(argc, argv, "u:U:b:e:m:d:o:p:f:c:r:t:/:n:l:L:vP012V"))
++ while ((opt =getopt(argc, argv, "u:U:b:e:m:d:o:p:f:c:r:t:/:C:n:l:L:vP012V"))
+ != opteof)
+ switch(opt) {
+ case 'u': set_user =(char*)optarg; break;
+@@ -305,6 +306,7 @@ int main(int argc, const char **argv) {
+ case 'r': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitr =ul; break;
+ case 't': if (optarg[scan_ulong(optarg, &ul)]) usage(); limitt =ul; break;
+ case '/': root =optarg; break;
++ case 'C': pwd =optarg; break;
+ case 'n':
+ switch (*optarg) {
+ case '-':
+@@ -337,6 +339,9 @@ int main(int argc, const char **argv) {
+ if (chdir(root) == -1) fatal2("unable to change directory", root);
+ if (chroot(".") == -1) fatal("unable to change root directory");
+ }
++ if (pwd) {
++ if (chdir(pwd) == -1) fatal2("unable to change directory", pwd);
++ }
+ if (nicelvl) {
+ errno =0;
+ if (nice(nicelvl) == -1) if (errno) fatal("unable to set nice level");
diff --git a/srcpkgs/runit/template b/srcpkgs/runit/template
index 97c61ccbbaa6..661d141f1ec7 100644
--- a/srcpkgs/runit/template
+++ b/srcpkgs/runit/template
@@ -1,7 +1,7 @@
# Template file for 'runit'
pkgname=runit
version=2.1.2
-revision=14
+revision=15
build_wrksrc="${pkgname}-${version}/src"
build_style="gnu-makefile"
short_desc="UNIX init scheme with service supervision"
@@ -11,6 +11,8 @@ homepage="http://smarden.org/runit/"
distfiles="http://smarden.org/runit/runit-$version.tar.gz"
checksum=6fd0160cb0cf1207de4e66754b6d39750cff14bb0aa66ab49490992c0c47ba18
patch_args=-Np0
+# FIXME: this is caused by some bonk tests that should be fixed in void-linux/runit at some point
+make_check=no
build_options="static"
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PR PATCH] [Merged]: runit: add chpst -C patch
2023-04-13 5:34 [PR PATCH] runit: add chpst -C patch classabbyamp
2023-04-13 5:37 ` classabbyamp
2023-04-14 2:21 ` [PR PATCH] [Updated] " classabbyamp
@ 2023-04-14 2:24 ` classabbyamp
2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2023-04-14 2:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
There's a merged pull request on the void-packages repository
runit: add chpst -C patch
https://github.com/void-linux/void-packages/pull/43418
Description:
from https://github.com/void-linux/runit/commit/2b8000f1ebd07fd68ee0e3c32737d97bcd1687fb
#### Testing the changes
- I tested the changes in this PR: **briefly**
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-04-14 2:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 5:34 [PR PATCH] runit: add chpst -C patch classabbyamp
2023-04-13 5:37 ` classabbyamp
2023-04-14 2:21 ` [PR PATCH] [Updated] " classabbyamp
2023-04-14 2:24 ` [PR PATCH] [Merged]: " classabbyamp
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).