diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | session.c | 20 |
2 files changed, 18 insertions, 7 deletions
@@ -37,6 +37,9 @@ | |||
37 | - markus@cvs.openbsd.org 2001/10/09 10:12:08 | 37 | - markus@cvs.openbsd.org 2001/10/09 10:12:08 |
38 | [session.c] | 38 | [session.c] |
39 | chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu | 39 | chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu |
40 | - markus@cvs.openbsd.org 2001/10/09 19:32:49 | ||
41 | [session.c] | ||
42 | stat subsystem command before calling do_exec, and return error to client. | ||
40 | 43 | ||
41 | 20011007 | 44 | 20011007 |
42 | - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. | 45 | - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. |
@@ -6682,4 +6685,4 @@ | |||
6682 | - Wrote replacements for strlcpy and mkdtemp | 6685 | - Wrote replacements for strlcpy and mkdtemp |
6683 | - Released 1.0pre1 | 6686 | - Released 1.0pre1 |
6684 | 6687 | ||
6685 | $Id: ChangeLog,v 1.1595 2001/10/10 05:07:44 djm Exp $ | 6688 | $Id: ChangeLog,v 1.1596 2001/10/10 05:08:06 djm Exp $ |
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.104 2001/10/09 10:12:08 markus Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.105 2001/10/09 19:32:49 markus Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1672,25 +1672,33 @@ session_pty_req(Session *s) | |||
1672 | static int | 1672 | static int |
1673 | session_subsystem_req(Session *s) | 1673 | session_subsystem_req(Session *s) |
1674 | { | 1674 | { |
1675 | struct stat st; | ||
1675 | u_int len; | 1676 | u_int len; |
1676 | int success = 0; | 1677 | int success = 0; |
1677 | char *subsys = packet_get_string(&len); | 1678 | char *cmd, *subsys = packet_get_string(&len); |
1678 | int i; | 1679 | int i; |
1679 | 1680 | ||
1680 | packet_done(); | 1681 | packet_done(); |
1681 | log("subsystem request for %s", subsys); | 1682 | log("subsystem request for %s", subsys); |
1682 | 1683 | ||
1683 | for (i = 0; i < options.num_subsystems; i++) { | 1684 | for (i = 0; i < options.num_subsystems; i++) { |
1684 | if(strcmp(subsys, options.subsystem_name[i]) == 0) { | 1685 | if (strcmp(subsys, options.subsystem_name[i]) == 0) { |
1685 | debug("subsystem: exec() %s", options.subsystem_command[i]); | 1686 | cmd = options.subsystem_command[i]; |
1687 | if (stat(cmd, &st) < 0) { | ||
1688 | error("subsystem: cannot stat %s: %s", cmd, | ||
1689 | strerror(errno)); | ||
1690 | break; | ||
1691 | } | ||
1692 | debug("subsystem: exec() %s", cmd); | ||
1686 | s->is_subsystem = 1; | 1693 | s->is_subsystem = 1; |
1687 | do_exec(s, options.subsystem_command[i]); | 1694 | do_exec(s, cmd); |
1688 | success = 1; | 1695 | success = 1; |
1689 | } | 1696 | } |
1690 | } | 1697 | } |
1691 | 1698 | ||
1692 | if (!success) | 1699 | if (!success) |
1693 | log("subsystem request for %s failed, subsystem not found", subsys); | 1700 | log("subsystem request for %s failed, subsystem not found", |
1701 | subsys); | ||
1694 | 1702 | ||
1695 | xfree(subsys); | 1703 | xfree(subsys); |
1696 | return success; | 1704 | return success; |