- Added range checks to port values given on command line

This commit is contained in:
Steve Dickson 2006-09-13 13:30:49 +00:00
parent 1432ea60bb
commit 27ecbd39be
2 changed files with 67 additions and 1 deletions

View File

@ -0,0 +1,60 @@
--- ypserv-2.19/rpc.yppasswdd/yppasswdd.c.orig 2006-01-10 14:22:20.000000000 -0500
+++ ypserv-2.19/rpc.yppasswdd/yppasswdd.c 2006-09-13 09:26:02.000000000 -0400
@@ -333,6 +333,12 @@
break;
case '\253':
my_port = atoi (optarg);
+ if (my_port <= 0 || my_port > 0xffff) {
+ /* Invalid port number */
+ fprintf (stdout, "Warning: rpc.yppasswdd: Invalid port %d (0x%x)\n",
+ my_port, my_port);
+ my_port = -1;
+ }
if (debug_flag)
log_msg ("Using port %d\n", my_port);
break;
--- ypserv-2.19/rpc.ypxfrd/ypxfrd.c.orig 2006-01-10 14:22:20.000000000 -0500
+++ ypserv-2.19/rpc.ypxfrd/ypxfrd.c 2006-09-13 09:26:09.000000000 -0400
@@ -199,6 +199,12 @@
break;
case 'p':
my_port = atoi(optarg);
+ if (my_port <= 0 || my_port > 0xffff) {
+ /* Invalid port number */
+ fprintf (stdout, "Warning: rpc.ypxfrd: Invalid port %d (0x%x)\n",
+ my_port, my_port);
+ my_port = -1;
+ }
if (debug_flag)
log_msg("Using port %d\n", my_port);
break;
--- ypserv-2.19/yppush/yppush.c.orig 2005-05-31 05:14:40.000000000 -0400
+++ ypserv-2.19/yppush/yppush.c 2006-09-13 09:26:17.000000000 -0400
@@ -649,6 +649,12 @@
log_msg ("yppush cannot run in parallel with a fixed port");
return 1;
}
+ if (my_port <= 0 || my_port > 0xffff) {
+ /* Invalid port number */
+ fprintf (stdout, "Warning: yppush: Invalid port %d (0x%x)\n",
+ my_port, my_port);
+ my_port = -1;
+ }
break;
default:
Usage (1);
--- ypserv-2.19/ypserv/ypserv.c.orig 2006-09-13 09:00:40.000000000 -0400
+++ ypserv-2.19/ypserv/ypserv.c 2006-09-13 09:26:32.000000000 -0400
@@ -492,6 +492,12 @@
break;
case 'p':
my_port = atoi (optarg);
+ if (my_port <= 0 || my_port > 0xffff) {
+ /* Invalid port number */
+ fprintf (stdout, "Warning: ypserv: Invalid port %d (0x%x)\n",
+ my_port, my_port);
+ my_port = -1;
+ }
if (debug_flag)
log_msg ("Using port %d\n", my_port);
break;

View File

@ -4,7 +4,7 @@ Summary: The NIS (Network Information Service) server.
Url: http://www.linux-nis.org/nis/ypserv/index.html
Name: ypserv
Version: 2.19
Release: 2
Release: 3
License: GPL
Group: System Environment/Daemons
Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
@ -20,6 +20,7 @@ Patch3: ypserv-2.11-nomap.patch
Patch4: ypserv-2.11-iface-binding3.patch
Patch6: ypserv-2.13-yplib-memleak.patch
Patch7: ypserv-2.13-ypxfr-zeroresp.patch
Patch8: ypserv-2.19-inval-ports.patch
Obsoletes: yppasswd
BuildRequires: gdbm-devel
Buildroot: %{_tmppath}/%{name}-root
@ -49,6 +50,7 @@ machines.
%patch4 -p1 -b .iface
%patch6 -p1 -b .memleak
%patch7 -p1 -b .respzero
%patch8 -p1 -b .ports
%build
cp etc/README etc/README.etc
@ -134,6 +136,10 @@ exit 0
%{_includedir}/*/*
%changelog
* Wed Sep 13 2006 Steve Dickson <steved@redhat.com> - 2.19-3
- Added range checks to port values given on command line
(bz 205354)
* Tue Jul 25 2006 Steve Dickson <steved@redhat.com> - 2.19-2
- fixed typo in ypxfrd initscript (bz 185403)