From: Ian Jackson Date: Mon, 15 Aug 2022 15:50:10 +0000 (+0100) Subject: prefork-interp: require -U (for future-proofing) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=8e636bc949ae29795a67f9dfa7e18d12fc865c83;hp=a8cbf7f35996c93079752bfa39dc43ea7e4f2956;p=chiark-utils.git prefork-interp: require -U (for future-proofing) Signed-off-by: Ian Jackson --- 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 } \