1 Submitted By: Randy McMurchy <randy_at_linuxfromscratch_dot_org>
3 Initial Package Version: 1.4.2
4 Upstream Status: Not sure
5 Origin: Internet (URL's are now lost)
6 Description: Fix the rexecd daemon so that it understands shadow
7 passwords. Fix the rshd daemon so that it properly
10 diff -Naur inetutils-1.4.2-orig/rexecd/rexecd.c inetutils-1.4.2/rexecd/rexecd.c
11 --- inetutils-1.4.2-orig/rexecd/rexecd.c 2002-12-11 12:38:00.000000000 +0000
12 +++ inetutils-1.4.2/rexecd/rexecd.c 2005-02-22 19:53:44.146962264 +0000
21 void error __P ((const char *fmt, ...));
23 * remote execute server:
25 char *cmdbuf, *cp, *namep;
41 + // Get encrypted password from /etc/shadow if possible,
42 + // else from /etc/passwd.
43 + spwd = getspnam(user);
45 + pw_field = spwd->sp_pwdp;
47 + pw_field = pwd->pw_passwd;
49 + if (*pw_field != '\0') {
50 + namep = CRYPT (pass, pw_field);
51 + if (strcmp(namep, pw_field)) {
52 + error("Password incorrect.\n");
57 if (*pwd->pw_passwd != '\0') {
58 namep = CRYPT (pass, pwd->pw_passwd);
59 if (strcmp(namep, pwd->pw_passwd)) {
65 write(STDERR_FILENO, "\0", 1);
68 diff -Naur inetutils-1.4.2-orig/rshd/rshd.c inetutils-1.4.2/rshd/rshd.c
69 --- inetutils-1.4.2-orig/rshd/rshd.c 2002-12-11 12:38:00.000000000 +0000
70 +++ inetutils-1.4.2/rshd/rshd.c 2005-02-22 19:54:33.162510768 +0000
72 dup2 (sockfd, STDERR_FILENO);
75 - /* Get the "name" of the clent form its Internet address.
76 + /* Get the "name" of the client form its Internet address.
77 * This is used for the autentication below
81 * in a remote net; look up the name and check that this
82 * address corresponds to the name.
84 - hostname = strdup (hp->h_name);
85 + const char *remotehost = strdup(hp->h_name);
89 - if (check_all || local_domain (hp->h_name))
91 + errorstr = "Out of memory\n";
92 + else if (check_all || local_domain (remotehost))
94 - char *remotehost = (char *) alloca (strlen (hp->h_name) + 1);
96 - errorstr = "Out of memory\n";
98 + errorhost = remotehost;
99 + hp = gethostbyname (remotehost);
102 - strcpy (remotehost, hp->h_name);
103 - errorhost = remotehost;
104 - hp = gethostbyname (remotehost);
107 + "Couldn't look up address for %s", remotehost);
108 + errorstr = "Couldn't look up address for your host (%s)\n";
109 + hostname = strdup(inet_ntoa(fromp->sin_addr));
113 + for (; ; hp->h_addr_list++)
116 - "Couldn't look up address for %s", remotehost);
117 - errorstr = "Couldn't look up address for your host (%s)\n";
118 - hostname = inet_ntoa (fromp->sin_addr);
119 + if (hp->h_addr_list[0] == NULL)
121 + syslog (LOG_NOTICE,
122 + "Host addr %s not listed for host %s",
123 + inet_ntoa (fromp->sin_addr), hp->h_name);
124 + errorstr = "Host address mismatch for %s\n";
125 + hostname = strdup(inet_ntoa(fromp->sin_addr));
128 + if (!memcmp (hp->h_addr_list[0],
129 + (caddr_t)&fromp->sin_addr,
130 + sizeof fromp->sin_addr))
132 + hostname = strdup(hp->h_name);
133 + break; /* equal, OK */
137 - for (; ; hp->h_addr_list++)
139 - if (hp->h_addr_list[0] == NULL)
141 - syslog (LOG_NOTICE,
142 - "Host addr %s not listed for host %s",
143 - inet_ntoa (fromp->sin_addr), hp->h_name);
144 - errorstr = "Host address mismatch for %s\n";
145 - hostname = inet_ntoa (fromp->sin_addr);
148 - if (!memcmp (hp->h_addr_list[0],
149 - (caddr_t)&fromp->sin_addr,
150 - sizeof fromp->sin_addr))
152 - hostname = hp->h_name;
153 - break; /* equal, OK */
161 - errorhost = hostname = inet_ntoa (fromp->sin_addr);
162 + errorhost = hostname = strdup(inet_ntoa(fromp->sin_addr));