1
0
mirror of https://github.com/tmate-io/tmate-ssh-server.git synced 2020-11-18 19:53:51 -08:00

Revert "Escape sent commands"

This reverts commit c50bdfccdd6eed9182905a50716ee037ccb29be9.
This commit is contained in:
Nicolas Viennot 2016-03-28 01:42:54 -04:00
parent 1cd1bb0965
commit ea31dc236a
2 changed files with 2 additions and 17 deletions

View File

@ -177,34 +177,20 @@ args_print(struct args *args)
args_print_add(&buf, &len, " -%c ", entry->flag); args_print_add(&buf, &len, " -%c ", entry->flag);
else else
args_print_add(&buf, &len, "-%c ", entry->flag); args_print_add(&buf, &len, "-%c ", entry->flag);
#ifdef TMATE_SLAVE if (strchr(entry->value, ' ') != NULL)
if (strchr(entry->value, '\'') != NULL)
args_print_add(&buf, &len, "\"%s\"", entry->value); args_print_add(&buf, &len, "\"%s\"", entry->value);
else else
args_print_add(&buf, &len, "'%s'", entry->value); args_print_add(&buf, &len, "%s", entry->value);
#else
if (strchr(entry->value, '\'') != NULL)
args_print_add(&buf, &len, "\"%s\"", entry->value);
else
args_print_add(&buf, &len, "'%s'", entry->value);
#endif
} }
/* And finally the argument vector. */ /* And finally the argument vector. */
for (i = 0; i < args->argc; i++) { for (i = 0; i < args->argc; i++) {
if (*buf != '\0') if (*buf != '\0')
args_print_add(&buf, &len, " "); args_print_add(&buf, &len, " ");
#ifdef TMATE_SLAVE
if (strchr(args->argv[i], '\'') != NULL)
args_print_add(&buf, &len, "\"%s\"", args->argv[i]);
else
args_print_add(&buf, &len, "'%s'", args->argv[i]);
#else
if (strchr(args->argv[i], ' ') != NULL) if (strchr(args->argv[i], ' ') != NULL)
args_print_add(&buf, &len, "\"%s\"", args->argv[i]); args_print_add(&buf, &len, "\"%s\"", args->argv[i]);
else else
args_print_add(&buf, &len, "%s", args->argv[i]); args_print_add(&buf, &len, "%s", args->argv[i]);
#endif
} }
return (buf); return (buf);

View File

@ -213,7 +213,6 @@ static void tmate_exec_cmd(__unused struct tmate_session *session,
tmate_info("Local cmd: %s", cmd_str); tmate_info("Local cmd: %s", cmd_str);
if (cmd_string_parse(cmd_str, &cmdlist, NULL, 0, &cause) != 0) { if (cmd_string_parse(cmd_str, &cmdlist, NULL, 0, &cause) != 0) {
tmate_info("parse error: %s", cause);
free(cause); free(cause);
goto out; goto out;
} }