|
@@ -52,6 +52,8 @@
|
|
|
#include "../../char_msg_val.h"
|
|
|
#include "exec_hf.h"
|
|
|
|
|
|
+extern int exec_bash_safety;
|
|
|
+
|
|
|
/* should be environment variables set by header fields ? */
|
|
|
unsigned int setvars=1;
|
|
|
|
|
@@ -256,7 +258,7 @@ static int print_hf_var(struct hf_wrapper *w, int offset)
|
|
|
memcpy(envvar, w->prefix, w->prefix_len); c=envvar+w->prefix_len;
|
|
|
memcpy(c, hname, hlen ); c+=hlen;
|
|
|
*c=EV_ASSIGN;c++;
|
|
|
- if (!strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,4))) {
|
|
|
+ if (exec_bash_safety && !strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,4))) {
|
|
|
memcpy(c, w->u.hf->body.s+offset+2, w->u.hf->body.len-2 );
|
|
|
c+=(w->u.hf->body.len-2);
|
|
|
} else {
|
|
@@ -265,7 +267,7 @@ static int print_hf_var(struct hf_wrapper *w, int offset)
|
|
|
}
|
|
|
for (wi=w->next_same; wi; wi=wi->next_same) {
|
|
|
*c=HF_SEPARATOR;c++;
|
|
|
- if (!strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,4))) {
|
|
|
+ if (exec_bash_safety && !strncmp(w->u.hf->body.s,"() {",MIN(w->u.hf->body.len,4))) {
|
|
|
memcpy(c, w->u.hf->body.s+offset+2, w->u.hf->body.len-2 );
|
|
|
c+=(w->u.hf->body.len-2);
|
|
|
} else {
|