From 73d9b77a11b4516905caf579abb559736f715ea6 Mon Sep 17 00:00:00 2001 From: Philip McGrath Date: Mon, 11 Apr 2022 20:43:18 -0400 Subject: [PATCH] Zuo: patch zuo_process for "/bin/sh" on Guix If: 1. The nonstandard but ubiquitous macro `_PATH_BSHELL` from is defined; and 2. `zuo_process` is called with the exact path "/bin/sh"; and 3. The path specified by `_PATH_BSHELL` exists; then `zuo_process` will execute the file specified by `_PATH_BSHELL` instead of "/bin/sh". Checking that the path specified by `_PATH_BSHELL` exists safeguards against obscure errors if attempting to use stand-alone executables built by the patched Racket in non-Guix envoronments. --- racket/src/zuo/zuo.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/racket/src/zuo/zuo.c b/racket/src/zuo/zuo.c index 17f161826d..c4fb3929bb 100644 --- a/racket/src/zuo/zuo.c +++ b/racket/src/zuo/zuo.c @@ -15,6 +15,7 @@ #include #include #ifdef ZUO_UNIX +# include /* PATCHED for Guix */ # include # include # include @@ -5730,7 +5731,10 @@ static void zuo_pipe(zuo_raw_handle_t *_r, zuo_raw_handle_t *_w) zuo_t *zuo_process(zuo_t *command_and_args) { const char *who = "process"; - zuo_t *command = _zuo_car(command_and_args); + /* BEGIN PATCH for Guix */ + zuo_t *_guix_orig_command = _zuo_car(command_and_args); + zuo_t *command; + /* END PATCH for Guix */ zuo_t *args = _zuo_cdr(command_and_args), *rev_args = z.o_null; zuo_t *options = z.o_empty_hash, *opt; zuo_t *dir, *l, *p_handle, *result; @@ -5741,7 +5745,19 @@ zuo_t *zuo_process(zuo_t *command_and_args) void *env; int as_child, exact_cmdline; - check_path_string(who, command); + /* BEGIN PATCH for Guix */ + check_path_string(who, _guix_orig_command); +#if defined(_PATH_BSHELL) + command = + ((z.o_false == zuo_string_eql(_guix_orig_command, zuo_string("/bin/sh"))) + || (z.o_false == zuo_stat(zuo_string(_PATH_BSHELL), z.o_false, z.o_true))) + ? _guix_orig_command + : zuo_string(_PATH_BSHELL); +#else + command = _guix_orig_command; +#endif + /* END PATCH for Guix */ + for (l = args; l->tag == zuo_pair_tag; l = _zuo_cdr(l)) { zuo_t *a = _zuo_car(l); if (a == z.o_null) { base-commit: 87eee6e2adb8c6bc11e60619c706fa6295096085 -- 2.32.0 ss='content'>
AgeCommit message (Expand)Author
2022-12-25services: ganeti: Label mcron jobs....* gnu/services/ganeti.scm (ganeti-watcher-jobs): Label job as "ganeti-watcher". (ganeti-cleaner-jobs): Labels jobs as "ganeti master cleaner" and "ganeti node cleaner". Marius Bakke
2022-12-17services: ganeti: Add support for cluster hooks....* gnu/services/ganeti.scm (<ganeti-configuration>): Add HOOKS. (hooks->directory): Rename to ... (debootstrap-hooks->directory): ... this, for clarity. (debootstrap-configuration-compiler): Adjust accordingly. (ganeti-directory): Add HOOKS when set. (ganeti-etc-service): Pass HOOKS. * doc/guix.texi (Virtualization Services): Mention it. Marius Bakke
2022-11-03services: ganeti: OS variants can be a directory....* gnu/services/ganeti.scm (<ganeti-os>)[extension]: Default to #f. (ganeti-os->directory): Only add extension if set. Support a file-like object for VARIANTS. * doc/guix.texi (Virtualization Services): Document this change and add example. Update Ganeti URLs while at it. Marius Bakke
2021-11-30services: Accept <inferior-package>s in lieu of <package>s....* gnu/services/authentication.scm (fprintd-configuration) (nslcd-configuration): Substitute file-like objects for package ones. * gnu/services/cgit.scm (cgit-configuration, opaque-cgit-configuration): Likewise. * gnu/services/cups.scm (package-list?, cups-configuration): Likewise. * gnu/services/dns.scm (verify-knot-configuration) (ddclient-configuration): Likewise. * gnu/services/docker.scm (docker-configuration): Likewise. * gnu/services/file-sharing.scm (transmission-daemon-configuration): Likewise. * gnu/services/getmail.scm (getmail-configuration): Likewise. * gnu/services/mail.scm (dovecot-configuration) (opaque-dovecot-configuration): Likewise. * gnu/services/messaging.scm (prosody-configuration) (opaque-prosody-configuration): Likewise. * gnu/services/monitoring.scm (zabbix-server-configuration) (zabbix-agent-configuration): Likewise. * gnu/services/networking.scm (opendht-configuration): Likewise. * gnu/services/pm.scm (tlp-configuration): Likewise. * gnu/services/telephony.scm (jami-configuration): Likewise. * gnu/services/virtualization.scm (libvirt-configuration) (qemu-guest-agent-configuration): Likewise. * gnu/services/vpn.scm (openvpn-client-configuration): Likewise. Tobias Geerinckx-Rice
2021-10-11services: ganeti: Don't start the metadata daemon automatically....* gnu/services/ganeti.scm (ganeti-metad-service)[auto-start?]: New field. Marius Bakke