* prefork-interp [<option> ..] <interpreter> [<script> [<args> ...]]
* prefork-interp [<option>,..],<interpreter> <script> [<args> ...]
* prefork-interp '[<option> ..] <interpreter>' <script> [<args> ...]
+ *
+ * Options must specify argument laundering mode.
+ * Currently the only mode supported is:
+ * -U unlaundered: setup and executor both get all arguments and env vars
+ * ident covers only env vars specified with -E
+ * ident covers only arguments interpreter and (if present) script
*/
/*
* Process structure:
* forks for server
* [2] exits
*
- # server (pm) [1] [fd0: null],
+ * server (pm) [1] [fd0: null],
* [fd[12]: fd2-from-outer]
* right away, forks init monitor
* [2] closes outer caller fds and call(fake)
fprintf(f, "usage: #!/usr/bin/prefork-interp [<options>]\n");
}
+static int laundering;
+
const struct cmdinfo cmdinfos[]= {
PREFORK_CMDINFOS
+ { 0, 'U', 0, .iassignto= &laundering, .arg= 'U' },
{ 0 }
};
}
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 } \