Magellan Linux

Annotation of /trunk/netkit-rsh/netkit-rsh-0.17-chdir.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (hide annotations) (download)
Fri Jan 19 23:50:26 2007 UTC (17 years, 4 months ago) by niro
File size: 1294 byte(s)
new files

1 niro 97 --- netkit-rsh-0.17/rshd/rshd.c.orig Sun Jul 23 06:16:24 2000
2     +++ netkit-rsh-0.17/rshd/rshd.c Tue Dec 11 17:45:10 2001
3     @@ -388,15 +388,6 @@
4     remuser, hostname, locuser, cmdbuf);
5     }
6    
7     - if (chdir(pwd->pw_dir) < 0) {
8     - chdir("/");
9     - /*
10     - * error("No remote directory.\n");
11     - * exit(1);
12     - */
13     - }
14     -
15     -
16     if (pwd->pw_uid != 0 && !access(_PATH_NOLOGIN, F_OK)) {
17     error("Logins currently disabled.\n");
18     exit(1);
19     @@ -456,6 +447,14 @@
20     exit(1);
21     }
22     environ = envinit;
23     +
24     + if (chdir(pwd->pw_dir) < 0) {
25     + chdir("/");
26     + /*
27     + * error("No remote directory.\n");
28     + * exit(1);
29     + */
30     + }
31    
32     strncat(homedir, pwd->pw_dir, sizeof(homedir)-6);
33     homedir[sizeof(homedir)-1] = 0;
34     --- netkit-rsh-0.17/rexecd/rexecd.c.orig Sun Jul 23 06:16:22 2000
35     +++ netkit-rsh-0.17/rexecd/rexecd.c Tue Dec 11 18:28:36 2001
36     @@ -375,10 +375,6 @@
37     /* Log successful attempts. */
38     syslog(LOG_INFO, "login from %.128s as %s", remote, user);
39    
40     - if (chdir(pwd->pw_dir) < 0) {
41     - fatal("No remote directory.\n");
42     - }
43     -
44     write(2, "\0", 1);
45     if (port) {
46     /* If we have a port, dup STDERR on that port KRH */
47     @@ -408,6 +404,10 @@
48     if (setuid(pwd->pw_uid)) {
49     perror("setuid");
50     exit(1);
51     + }
52     +
53     + if (chdir(pwd->pw_dir) < 0) {
54     + fatal("No remote directory.\n");
55     }
56    
57     strcat(path, _PATH_DEFPATH);