diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2021-06-29 10:15:54 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2021-06-29 10:15:54 +0100 |
commit | 9aa80713372911cec499b3adb2cd746790920916 (patch) | |
tree | b8e99dc5dd60ac2094a27cc52f74aada8df38f05 /net-misc/netkit-rsh/files/patches/190_all_nohost.patch | |
parent | b4d43e8c611df4a8061b6f88d9e9f6b1e3c83903 (diff) |
gentoo resync : 29.06.2021
Diffstat (limited to 'net-misc/netkit-rsh/files/patches/190_all_nohost.patch')
-rw-r--r-- | net-misc/netkit-rsh/files/patches/190_all_nohost.patch | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/net-misc/netkit-rsh/files/patches/190_all_nohost.patch b/net-misc/netkit-rsh/files/patches/190_all_nohost.patch new file mode 100644 index 000000000000..8258eb10576c --- /dev/null +++ b/net-misc/netkit-rsh/files/patches/190_all_nohost.patch @@ -0,0 +1,63 @@ +--- a/rexecd/rexecd.8 ++++ b/rexecd/rexecd.8 +@@ -40,6 +40,16 @@ + .Nd remote execution server + .Sh SYNOPSIS + .Nm rexecd ++[ ++\fB\-D\fP ++] ++.Sh OPTIONS ++.Nm Rexec ++accepts one option: ++.Pp ++.Bl -tag -width Ds ++.It Sy -D ++Disable reverse DNS look up and in the log will be used client IP addresses. + .Sh DESCRIPTION + .Nm Rexecd + is the server for the +--- a/rexecd/rexecd.c ++++ b/rexecd/rexecd.c +@@ -82,7 +82,9 @@ + #include <string.h> + #include <paths.h> + #include <grp.h> +- ++#include <arpa/inet.h> ++ ++ + #ifdef USE_SHADOW + #include <shadow.h> + #endif +@@ -141,16 +143,22 @@ + refuse(&from_host); + remote = hosts_info(&from_host); + #else ++ if (argc > 1 && argv[1] && strcmp(argv[1], "-D")==0) + { +- struct hostent *h = gethostbyaddr((const char *)&from.sin_addr, +- sizeof(struct in_addr), +- AF_INET); +- if (!h || !h->h_name) { +- write(0, "\1Where are you?\n", 16); +- return 1; ++ /* use IP in logs -- this is workaround */ ++ remote = strdup(inet_ntoa(from.sin_addr)); + } +- /* Be advised that this may be utter nonsense. */ +- remote = strdup(h->h_name); ++ else ++ { ++ struct hostent *h = gethostbyaddr((const char *)&from.sin_addr, ++ sizeof(struct in_addr), ++ AF_INET); ++ if (!h || !h->h_name) { ++ write(0, "\1Where are you?\n", 16); ++ return 1; ++ } ++ /* Be advised that this may be utter nonsense. */ ++ remote = strdup(h->h_name); + } + #endif + syslog(allow_severity, "connect from %.128s", remote); |