|
Line
Link Here
|
| 0 |
-- session.c.orig 2007-05-10 17:20:53.000000000 -0400 |
0 |
++ session.c 2007-05-10 17:22:07.000000000 -0400 |
|
Lines 87-92
Link Here
|
| 87 |
#include "session.h" |
87 |
#include "session.h" |
| 88 |
#include "kex.h" |
88 |
#include "kex.h" |
| 89 |
#include "monitor_wrap.h" |
89 |
#include "monitor_wrap.h" |
|
|
90 |
#include "misc.h" |
| 90 |
#if defined(KRB5) && defined(USE_AFS) |
91 |
#if defined(KRB5) && defined(USE_AFS) |
| 91 |
#include <kafs.h> |
92 |
#include <kafs.h> |
|
Lines 1861-1869
Link Here
|
| 1861 |
session_subsystem_req(Session *s) |
1862 |
session_subsystem_req(Session *s) |
| 1862 |
{ |
1863 |
{ |
| 1863 |
struct stat st; |
1864 |
struct stat st; |
| 1864 |
u_int len; |
1865 |
u_int len, arglen = 0; |
| 1865 |
int success = 0; |
1866 |
int success = 0; |
| 1866 |
char *prog, *cmd, *subsys = packet_get_string(&len); |
1867 |
char *prog, *cmd, *arg, *p, *subsys = packet_get_string(&len); |
| 1867 |
u_int i; |
1868 |
u_int i; |
| 1868 |
|
1869 |
|
| 1869 |
packet_check_eom(); |
1870 |
packet_check_eom(); |
|
Lines 1878-1886
Link Here
|
| 1878 |
strerror(errno)); |
1879 |
strerror(errno)); |
| 1879 |
break; |
1880 |
break; |
| 1880 |
} |
1881 |
} |
| 1881 |
debug("subsystem: exec() %s", cmd); |
1882 |
|
|
|
1883 |
// Munch on arguments to do tilde expansion; entire subsystem argument processing should probably be refactored |
| 1884 |
p = xstrdup(""); |
| 1885 |
arglen = strlen(p) + 1; |
| 1886 |
while ((arg = strdelim(&cmd)) != NULL && *arg != '\0') { |
| 1887 |
arg = tilde_expand_filename(arg, s->pw->pw_uid); |
| 1888 |
arglen += 1 + strlen(arg); |
| 1889 |
p = xrealloc(p, 1, arglen); |
| 1890 |
strlcat(p, arg, arglen); |
| 1891 |
strlcat(p, " ", arglen); |
| 1892 |
debug("Processed subsystem arg: %s", arg); |
| 1893 |
} |
| 1894 |
|
| 1895 |
debug("subsystem: exec() %s", p); |
| 1882 |
s->is_subsystem = 1; |
1896 |
s->is_subsystem = 1; |
| 1883 |
do_exec(s, cmd); |
1897 |
do_exec(s, p); |
| 1884 |
success = 1; |
1898 |
success = 1; |
| 1885 |
break; |
1899 |
break; |
| 1886 |
} |
1900 |
} |