added new option (-c) which disables reverse dns checking added smp_mflags

and dist macros
This commit is contained in:
Adam Tkac 2007-04-13 12:29:34 +00:00
parent dd9bb818d8
commit 2ad61df6ae
2 changed files with 72 additions and 2 deletions

View File

@ -0,0 +1,63 @@
--- netkit-telnet-0.17/telnetd/telnetd.8.nodns 2000-07-31 01:57:10.000000000 +0200
+++ netkit-telnet-0.17/telnetd/telnetd.8 2007-04-13 10:58:27.000000000 +0200
@@ -123,6 +123,8 @@
.Xr login 1
program.
.El
+.It Fl c
+This option disables reverse dns checking. Of course that security is lower with this option
.It Fl D Ar debugmode
This option may be used for debugging purposes. This allows
.Nm telnetd
--- netkit-telnet-0.17/telnetd/telnetd.c.nodns 2007-04-13 10:49:57.000000000 +0200
+++ netkit-telnet-0.17/telnetd/telnetd.c 2007-04-13 10:49:57.000000000 +0200
@@ -83,6 +83,7 @@
int debug = 0;
int keepalive = 1;
+int nodns = 0;
char *loginprg = _PATH_LOGIN;
char *progname;
@@ -111,7 +112,7 @@
progname = *argv;
- while ((ch = getopt(argc, argv, "d:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) {
+ while ((ch = getopt(argc, argv, "cd:a:e:lhnr:I:D:B:sS:a:X:L:")) != EOF) {
switch(ch) {
#ifdef AUTHENTICATE
@@ -147,7 +148,9 @@
bftpd++;
break;
#endif /* BFTPDAEMON */
-
+ case 'c':
+ nodns++;
+ break;
case 'd':
if (strcmp(optarg, "ebug") == 0) {
debug++;
@@ -652,6 +655,9 @@
char namebuf[255];
error = getnameinfo(who, wholen, namebuf, sizeof(namebuf), NULL, 0, 0);
+
+ if ((error == EAI_AGAIN) && nodns)
+ error = getnameinfo(who, wholen, namebuf, sizeof(namebuf), NULL, 0, NI_NUMERICHOST);
if (error) {
perror("getnameinfo: localhost");
@@ -688,7 +694,10 @@
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_ADDRCONFIG;
- gethostname(host_name, sizeof(host_name));
+ if(nodns)
+ sprintf(host_name, "localhost", sizeof(host_name));
+ else
+ gethostname(host_name, sizeof(host_name));
if ((e = getaddrinfo(host_name, NULL, &hints, &res)) != 0) {
perror("getaddrinfo: localhost");
perror(gai_strerror(e));

View File

@ -1,7 +1,7 @@
Summary: The client program for the telnet remote login protocol.
Name: telnet
Version: 0.17
Release: 37
Release: 38%{?dist}
Epoch: 1
License: BSD
Group: Applications/Internet
@ -25,6 +25,7 @@ Patch16: telnet-0.17-CAN-2005-468_469.patch
Patch17: telnet-0.17-linemode.patch
Patch18: telnet-gethostbyname.patch
Patch19: netkit-telnet-0.17-ipv6.diff
Patch20: netkit-telnet-0.17-nodns.patch
BuildPreReq: ncurses-devel
Buildroot: %{_tmppath}/%{name}-root
@ -66,6 +67,7 @@ mv telnet telnet-NETKIT
#%patch17 -p1 -b .linemode
%patch18 -p1 -b .gethost
%patch19 -p1 -b .gethost
%patch20 -p1 -b .nodns
%build
export OPT_FLAGS="$RPM_OPT_FLAGS -g"
@ -99,7 +101,7 @@ perl -pi -e 's|install[ ]+-s|install|g' \
./telnetlogin/Makefile \
./telnet-NETKIT/Makefile
make
make %{?_smp_mflags}
%install
rm -rf ${RPM_BUILD_ROOT}
@ -131,6 +133,11 @@ rm -rf ${RPM_BUILD_ROOT}
%{_mandir}/man8/telnetd.8*
%changelog
* Fri Apr 13 2007 Adam Tkac <atkac redhat com> - 1:0.17-38.fc7
- added -c option which disables reverse dns checking (#223448)
- added smp_mflags to make
- start using dist macro
* Fri Jul 14 2006 Harald Hoyer <harald@redhat.com> - 1:0.17-37
- added netkit-telnet-0.17-ipv6.diff from Marek Grác,
which adds IPv6 support to telnetd