Newlines are used as argument delimiters in the protocol, which will cause problems.
#include "lib.h"
#include "ioloop.h"
#include "str.h"
+#include "strescape.h"
#include "net.h"
#include "write-full.h"
#include "eacces-error.h"
str_append(str, "-\n");
if (args != NULL) {
for(; *args != NULL; args++) {
- str_append(str, *args);
+ str_append_tabescaped(str, *args);
str_append_c(str, '\n');
}
}
#include "lib.h"
#include "array.h"
#include "str.h"
+#include "strescape.h"
#include "env-util.h"
#include "execv-const.h"
#include "write-full.h"
if (close(conn->fd) < 0)
i_error("close(conn->fd) failed: %m");
- for (; *args != NULL; args++)
- array_append(&exec_args, args, 1);
+ for (; *args != NULL; args++) {
+ const char *arg = t_str_tabunescape(*args);
+ array_append(&exec_args, &arg, 1);
+ }
array_append_zero(&exec_args);
env_clean();