- markus@cvs.openbsd.org 2001/10/09 19:32:49
[session.c] stat subsystem command before calling do_exec, and return error to client.
This commit is contained in:
parent
139d4cd908
commit
ae45246696
|
@ -37,6 +37,9 @@
|
||||||
- markus@cvs.openbsd.org 2001/10/09 10:12:08
|
- markus@cvs.openbsd.org 2001/10/09 10:12:08
|
||||||
[session.c]
|
[session.c]
|
||||||
chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu
|
chdir $HOME after krb_afslog(); from bbense@networking.stanford.edu
|
||||||
|
- markus@cvs.openbsd.org 2001/10/09 19:32:49
|
||||||
|
[session.c]
|
||||||
|
stat subsystem command before calling do_exec, and return error to client.
|
||||||
|
|
||||||
20011007
|
20011007
|
||||||
- (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys.
|
- (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys.
|
||||||
|
@ -6682,4 +6685,4 @@
|
||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1595 2001/10/10 05:07:44 djm Exp $
|
$Id: ChangeLog,v 1.1596 2001/10/10 05:08:06 djm Exp $
|
||||||
|
|
18
session.c
18
session.c
|
@ -33,7 +33,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: session.c,v 1.104 2001/10/09 10:12:08 markus Exp $");
|
RCSID("$OpenBSD: session.c,v 1.105 2001/10/09 19:32:49 markus Exp $");
|
||||||
|
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
#include "ssh1.h"
|
#include "ssh1.h"
|
||||||
|
@ -1672,9 +1672,10 @@ session_pty_req(Session *s)
|
||||||
static int
|
static int
|
||||||
session_subsystem_req(Session *s)
|
session_subsystem_req(Session *s)
|
||||||
{
|
{
|
||||||
|
struct stat st;
|
||||||
u_int len;
|
u_int len;
|
||||||
int success = 0;
|
int success = 0;
|
||||||
char *subsys = packet_get_string(&len);
|
char *cmd, *subsys = packet_get_string(&len);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
packet_done();
|
packet_done();
|
||||||
|
@ -1682,15 +1683,22 @@ session_subsystem_req(Session *s)
|
||||||
|
|
||||||
for (i = 0; i < options.num_subsystems; i++) {
|
for (i = 0; i < options.num_subsystems; i++) {
|
||||||
if (strcmp(subsys, options.subsystem_name[i]) == 0) {
|
if (strcmp(subsys, options.subsystem_name[i]) == 0) {
|
||||||
debug("subsystem: exec() %s", options.subsystem_command[i]);
|
cmd = options.subsystem_command[i];
|
||||||
|
if (stat(cmd, &st) < 0) {
|
||||||
|
error("subsystem: cannot stat %s: %s", cmd,
|
||||||
|
strerror(errno));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
debug("subsystem: exec() %s", cmd);
|
||||||
s->is_subsystem = 1;
|
s->is_subsystem = 1;
|
||||||
do_exec(s, options.subsystem_command[i]);
|
do_exec(s, cmd);
|
||||||
success = 1;
|
success = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!success)
|
if (!success)
|
||||||
log("subsystem request for %s failed, subsystem not found", subsys);
|
log("subsystem request for %s failed, subsystem not found",
|
||||||
|
subsys);
|
||||||
|
|
||||||
xfree(subsys);
|
xfree(subsys);
|
||||||
return success;
|
return success;
|
||||||
|
|
Loading…
Reference in New Issue