diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | session.c | 21 |
2 files changed, 12 insertions, 14 deletions
@@ -18,6 +18,9 @@ | |||
18 | - markus@cvs.openbsd.org 2001/06/19 14:09:45 | 18 | - markus@cvs.openbsd.org 2001/06/19 14:09:45 |
19 | [session.c sshd.8] | 19 | [session.c sshd.8] |
20 | disable x11-fwd if use_login is enabled; from lukem@wasabisystems.com | 20 | disable x11-fwd if use_login is enabled; from lukem@wasabisystems.com |
21 | - markus@cvs.openbsd.org 2001/06/19 15:40:45 | ||
22 | [session.c] | ||
23 | allocate and free at the same level. | ||
21 | 24 | ||
22 | 20010615 | 25 | 20010615 |
23 | - (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL | 26 | - (stevesk) don't set SA_RESTART and set SIGCHLD to SIG_DFL |
@@ -5670,4 +5673,4 @@ | |||
5670 | - Wrote replacements for strlcpy and mkdtemp | 5673 | - Wrote replacements for strlcpy and mkdtemp |
5671 | - Released 1.0pre1 | 5674 | - Released 1.0pre1 |
5672 | 5675 | ||
5673 | $Id: ChangeLog,v 1.1294 2001/06/21 03:14:49 mouring Exp $ | 5676 | $Id: ChangeLog,v 1.1295 2001/06/21 03:17:42 mouring Exp $ |
@@ -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 | ||