From 8e636bc949ae29795a67f9dfa7e18d12fc865c83 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 15 Aug 2022 16:50:10 +0100 Subject: [PATCH 1/1] prefork-interp: require -U (for future-proofing) Signed-off-by: Ian Jackson --- cprogs/prefork-interp.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cprogs/prefork-interp.c b/cprogs/prefork-interp.c index 6ee253f..dfc8aca 100644 --- a/cprogs/prefork-interp.c +++ b/cprogs/prefork-interp.c @@ -95,8 +95,11 @@ void fusagemessage(FILE *f) { fprintf(f, "usage: #!/usr/bin/prefork-interp []\n"); } +static int laundering; + const struct cmdinfo cmdinfos[]= { PREFORK_CMDINFOS + { 0, 'U', 0, .iassignto= &laundering, .arg= 'U' }, { 0 } }; @@ -381,6 +384,11 @@ static FILE *connect_or_spawn(void) { } static void make_executor_argv(const char *const *argv) { + switch (laundering) { + case 'U': break; + default: die("need -U (specifying unlaundered argument handling)"); + } + const char *arg; #define EACH_NEW_ARG(EACH) { \ arg = interp; { EACH } \ -- 2.30.2