ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/netproc.c
(Generate patch)

Comparing ray/src/util/netproc.c (file contents):
Revision 2.2 by greg, Wed Feb 7 16:42:45 1996 UTC vs.
Revision 2.3 by greg, Tue Feb 20 15:55:01 1996 UTC

# Line 14 | Line 14 | static char SCCSid[] = "$SunId$ LBL";
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>
# Line 54 | Line 44 | static char    *ourshell;      /* our user's shell */
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  
# Line 177 | Line 169 | register PSERVER       *ps;
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  
# Line 205 | Line 198 | int    (*compf)();
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] = ";";

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines