Magellan Linux

Annotation of /trunk/netkit-rsh/netkit-rsh-0.17-nohost.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: 1647 byte(s)
new files

1 niro 97 --- netkit-rsh-0.17/rexecd/rexecd.8.nohost 2004-12-03 15:20:17.436174216 +0100
2     +++ netkit-rsh-0.17/rexecd/rexecd.8 2004-12-03 15:39:39.972441840 +0100
3     @@ -40,6 +40,16 @@
4     .Nd remote execution server
5     .Sh SYNOPSIS
6     .Nm rexecd
7     +[
8     +\fB\-D\fP
9     +]
10     +.Sh OPTIONS
11     +.Nm Rexec
12     +accepts one option:
13     +.Pp
14     +.Bl -tag -width Ds
15     +.It Sy -D
16     +Disable reverse DNS look up and in the log will be used client IP addresses.
17     .Sh DESCRIPTION
18     .Nm Rexecd
19     is the server for the
20     --- netkit-rsh-0.17/rexecd/rexecd.c.nohost 2004-12-03 15:09:37.163510456 +0100
21     +++ netkit-rsh-0.17/rexecd/rexecd.c 2004-12-03 15:20:04.832090328 +0100
22     @@ -82,7 +82,9 @@
23     #include <string.h>
24     #include <paths.h>
25     #include <grp.h>
26     -
27     +#include <arpa/inet.h>
28     +
29     +
30     #ifdef USE_SHADOW
31     #include <shadow.h>
32     #endif
33     @@ -141,16 +143,22 @@
34     refuse(&from_host);
35     remote = hosts_info(&from_host);
36     #else
37     + if (argc > 1 && argv[1] && strcmp(argv[1], "-D")==0)
38     {
39     - struct hostent *h = gethostbyaddr((const char *)&from.sin_addr,
40     - sizeof(struct in_addr),
41     - AF_INET);
42     - if (!h || !h->h_name) {
43     - write(0, "\1Where are you?\n", 16);
44     - return 1;
45     + /* use IP in logs -- this is workaround */
46     + remote = strdup(inet_ntoa(from.sin_addr));
47     }
48     - /* Be advised that this may be utter nonsense. */
49     - remote = strdup(h->h_name);
50     + else
51     + {
52     + struct hostent *h = gethostbyaddr((const char *)&from.sin_addr,
53     + sizeof(struct in_addr),
54     + AF_INET);
55     + if (!h || !h->h_name) {
56     + write(0, "\1Where are you?\n", 16);
57     + return 1;
58     + }
59     + /* Be advised that this may be utter nonsense. */
60     + remote = strdup(h->h_name);
61     }
62     #endif
63     syslog(allow_severity, "connect from %.128s", remote);