diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 21 |
1 files changed, 8 insertions, 13 deletions
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.91 2001/06/19 14:09:45 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.92 2001/06/19 15:40:45 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -150,7 +150,7 @@ extern int startup_pipe; | |||
150 | extern void destroy_sensitive_data(void); | 150 | extern void destroy_sensitive_data(void); |
151 | 151 | ||
152 | /* original command from peer. */ | 152 | /* original command from peer. */ |
153 | char *original_command = NULL; | 153 | const char *original_command = NULL; |
154 | 154 | ||
155 | /* data */ | 155 | /* data */ |
156 | #define MAX_SESSIONS 10 | 156 | #define MAX_SESSIONS 10 |
@@ -309,12 +309,12 @@ do_authenticated1(Authctxt *authctxt) | |||
309 | if (type == SSH_CMSG_EXEC_CMD) { | 309 | if (type == SSH_CMSG_EXEC_CMD) { |
310 | command = packet_get_string(&dlen); | 310 | command = packet_get_string(&dlen); |
311 | debug("Exec command '%.500s'", command); | 311 | debug("Exec command '%.500s'", command); |
312 | packet_integrity_check(plen, 4 + dlen, type); | 312 | do_exec(s, command); |
313 | xfree(command); | ||
313 | } else { | 314 | } else { |
314 | command = NULL; | 315 | do_exec(s, NULL); |
315 | packet_integrity_check(plen, 0, type); | ||
316 | } | 316 | } |
317 | do_exec(s, command); | 317 | packet_done(); |
318 | session_close(s); | 318 | session_close(s); |
319 | return; | 319 | return; |
320 | 320 | ||
@@ -608,13 +608,7 @@ do_exec(Session *s, const char *command) | |||
608 | else | 608 | else |
609 | do_exec_no_pty(s, command); | 609 | do_exec_no_pty(s, command); |
610 | 610 | ||
611 | if (command != NULL) | 611 | original_command = NULL; |
612 | xfree(command); | ||
613 | |||
614 | if (original_command != NULL) { | ||
615 | xfree(original_command); | ||
616 | original_command = NULL; | ||
617 | } | ||
618 | } | 612 | } |
619 | 613 | ||
620 | 614 | ||
@@ -1698,6 +1692,7 @@ session_exec_req(Session *s) | |||
1698 | char *command = packet_get_string(&len); | 1692 | char *command = packet_get_string(&len); |
1699 | packet_done(); | 1693 | packet_done(); |
1700 | do_exec(s, command); | 1694 | do_exec(s, command); |
1695 | xfree(command); | ||
1701 | return 1; | 1696 | return 1; |
1702 | } | 1697 | } |
1703 | 1698 | ||