| 14 |
|
#include <fcntl.h> |
| 15 |
|
#include "netproc.h" |
| 16 |
|
#include "vfork.h" |
| 17 |
– |
/* Remote shell location */ |
| 18 |
– |
#ifdef sgi |
| 19 |
– |
#define RSH "/usr/bsd/rsh" |
| 20 |
– |
#endif |
| 21 |
– |
#ifdef _AUX_SOURCE |
| 22 |
– |
#define RSH "/usr/bin/remsh" |
| 23 |
– |
#endif |
| 24 |
– |
#ifndef RSH |
| 25 |
– |
#define RSH "/usr/ucb/rsh" |
| 26 |
– |
#endif |
| 17 |
|
/* select call compatibility stuff */ |
| 18 |
|
#ifndef FD_SETSIZE |
| 19 |
|
#include <sys/param.h> |
| 44 |
|
static fd_set errdesc; /* error file descriptors */ |
| 45 |
|
static int maxfd; /* maximum assigned descriptor */ |
| 46 |
|
|
| 47 |
+ |
extern char *remsh; /* externally defined remote shell program */ |
| 48 |
+ |
|
| 49 |
|
extern char *malloc(), *realloc(); |
| 50 |
|
extern char *getenv(); |
| 51 |
|
|
| 169 |
|
char *command; |
| 170 |
|
int (*compf)(); |
| 171 |
|
{ |
| 172 |
< |
char *av[12]; |
| 172 |
> |
char udirt[128]; |
| 173 |
> |
char *av[16]; |
| 174 |
|
int pfd[2], pid; |
| 175 |
|
register int i; |
| 176 |
|
|
| 198 |
|
close(pfd[1]); |
| 199 |
|
} |
| 200 |
|
if (ps->hostname[0]) { /* rsh command */ |
| 201 |
< |
av[i=0] = RSH; |
| 201 |
> |
av[i=0] = remsh; |
| 202 |
|
av[++i] = ps->hostname; |
| 203 |
< |
av[++i] = "-n"; /* no stdin */ |
| 204 |
< |
if (ps->username[0]) { |
| 203 |
> |
av[++i] = "-n"; /* no stdin */ |
| 204 |
> |
if (ps->username[0]) { /* different user */ |
| 205 |
|
av[++i] = "-l"; |
| 206 |
|
av[++i] = ps->username; |
| 207 |
+ |
av[++i] = "cd"; |
| 208 |
+ |
udirt[0] = '~'; |
| 209 |
+ |
strcpy(udirt+1, ouruser); |
| 210 |
+ |
av[++i] = udirt; |
| 211 |
+ |
av[++i] = ";"; |
| 212 |
|
} |
| 213 |
< |
if (ps->directory[0]) { |
| 213 |
> |
if (ps->directory[0]) { /* change directory */ |
| 214 |
|
av[++i] = "cd"; |
| 215 |
|
av[++i] = ps->directory; |
| 216 |
|
av[++i] = ";"; |