version 1.332, 2023/01/06 02:41:49 |
version 1.333, 2023/01/06 02:42:34 |
|
|
{ |
{ |
struct stat st; |
struct stat st; |
int r, success = 0; |
int r, success = 0; |
char *prog, *cmd; |
char *prog, *cmd, *type; |
u_int i; |
u_int i; |
|
|
if ((r = sshpkt_get_cstring(ssh, &s->subsys, NULL)) != 0 || |
if ((r = sshpkt_get_cstring(ssh, &s->subsys, NULL)) != 0 || |
|
|
s->is_subsystem = SUBSYSTEM_EXT; |
s->is_subsystem = SUBSYSTEM_EXT; |
debug("subsystem: exec() %s", cmd); |
debug("subsystem: exec() %s", cmd); |
} |
} |
|
xasprintf(&type, "session:subsystem:%s", |
|
options.subsystem_name[i]); |
|
channel_set_xtype(ssh, s->chanid, type); |
|
free(type); |
success = do_exec(ssh, s, cmd) == 0; |
success = do_exec(ssh, s, cmd) == 0; |
break; |
break; |
} |
} |
|
|
|
|
if ((r = sshpkt_get_end(ssh)) != 0) |
if ((r = sshpkt_get_end(ssh)) != 0) |
sshpkt_fatal(ssh, r, "%s: parse packet", __func__); |
sshpkt_fatal(ssh, r, "%s: parse packet", __func__); |
|
|
|
channel_set_xtype(ssh, s->chanid, "session:shell"); |
|
|
return do_exec(ssh, s, NULL) == 0; |
return do_exec(ssh, s, NULL) == 0; |
} |
} |
|
|
|
|
if ((r = sshpkt_get_cstring(ssh, &command, NULL)) != 0 || |
if ((r = sshpkt_get_cstring(ssh, &command, NULL)) != 0 || |
(r = sshpkt_get_end(ssh)) != 0) |
(r = sshpkt_get_end(ssh)) != 0) |
sshpkt_fatal(ssh, r, "%s: parse packet", __func__); |
sshpkt_fatal(ssh, r, "%s: parse packet", __func__); |
|
|
|
channel_set_xtype(ssh, s->chanid, "session:command"); |
|
|
success = do_exec(ssh, s, command) == 0; |
success = do_exec(ssh, s, command) == 0; |
free(command); |
free(command); |