10#define eval_pv perl_eval_pv
14#define call_argv perl_call_argv
17extern char *
Who =
"PERL!";
22static PerlInterpreter *my_perl = 0;
24static void usage(
void) {
25 logmsg(
Who,100,USAGE,
"sslargs file sub args");
28static stralloc newenv = {0};
29static char *trivenv[] = { 0 };
30static char **perlenv = trivenv;
31static char **origenv = 0;
34 if (!stralloc_append(&newenv,c))
35 logmsg(
Who,111,FATAL,
"out of memory");
38#define EXTERN_C extern
44 char *
prog[] = {
"", *argv };
58 my_perl = perl_alloc();
59 if (!my_perl) logmsg(
Who,111,FATAL,
"out of memory");
60 perl_construct(my_perl);
62 logmsg(
Who,111,FATAL,
"perl_parse failed");
64 if (perl_run(my_perl))
65 logmsg(
Who,111,FATAL,
"perl_run failed");
68 if (!stralloc_copys(&newenv,
"%ENV=("))
69 logmsg(
Who,111,FATAL,
"out of memory");
71 for (i = 0; origenv[i]; ++i) {
74 split = str_chr(x,
'=');
76 for (j = 0; j < split; ++j) {
77 if (*x ==
'\'' || *x ==
'\\')
env_append(
"\\");
85 if (*x ==
'\'' || *x ==
'\\')
env_append(
"\\");
100 if (
call_argv(*argv,G_VOID|G_DISCARD,argv + 1))
101 logmsg(
Who,111,FATAL,
"interpreter failed");
void server(int argc, char **argv)
void env_append(const char *c)
Header file to be used with sqmail; previously called ssl.h. (name clash)