rpms/ypserv/devel ypserv-2.21-iface.patch, NONE, 1.1 ypserv-2.21-path.patch, NONE, 1.1 .cvsignore, 1.12, 1.13 sources, 1.12, 1.13 ypserv.spec, 1.47, 1.48 ypserv-2.11-iface-binding3.patch, 1.4, NONE ypserv-2.11-nomap.patch, 1.2, NONE ypserv-2.11-path.patch, 1.2, NONE ypserv-2.13-yplib-memleak.patch, 1.2, NONE ypserv-2.19-debuginfo.patch, 1.2, NONE ypserv-2.19-quieter.patch, 1.2, NONE

Karel Klíč kklic at fedoraproject.org
Thu Jan 14 10:59:19 UTC 2010


Author: kklic

Update of /cvs/extras/rpms/ypserv/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5146

Modified Files:
	.cvsignore sources ypserv.spec 
Added Files:
	ypserv-2.21-iface.patch ypserv-2.21-path.patch 
Removed Files:
	ypserv-2.11-iface-binding3.patch ypserv-2.11-nomap.patch 
	ypserv-2.11-path.patch ypserv-2.13-yplib-memleak.patch 
	ypserv-2.19-debuginfo.patch ypserv-2.19-quieter.patch 
Log Message:
New version ypserv 2.21

ypserv-2.21-iface.patch:
 ypserv.8 |    9 ++++++-
 ypserv.c |   73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 2 files changed, 76 insertions(+), 6 deletions(-)

--- NEW FILE ypserv-2.21-iface.patch ---
diff -up ypserv-2.21/ypserv/ypserv.8.iface ypserv-2.21/ypserv/ypserv.8
--- ypserv-2.21/ypserv/ypserv.8.iface	2009-04-02 15:46:39.000000000 +0200
+++ ypserv-2.21/ypserv/ypserv.8	2010-01-13 17:48:38.860249643 +0100
@@ -171,7 +171,7 @@ ypserv \- NIS Server
 .SH "Synopsis"
 .fam C
 .HP \w'\fB/usr/sbin/ypserv\fR\ 'u
-\fB/usr/sbin/ypserv\fR [\-d\ [\fIpath\fR]] [\-p\ \fIport\fR]
+\fB/usr/sbin/ypserv\fR [\-d\ [\fIpath\fR]] [\-p\ \fIport\fR] [\-i\ \fIiface\fR]
 .fam
 .SH "DESCRIPTION"
 .PP
@@ -212,13 +212,18 @@ parses the file
 .RS 4
 Causes the server to run in debugging mode\&. Normally,
 \fBypserv\fR
-reports only errors (access violations, dbm failures) using the syslog(3) facility\&. In debug mode, the server does not background itself and prints extra status messages to stderr for each request that it revceives\&.
+reports only errors (access violations, dbm failures) using the syslog(3) facility\&. In debug mode, the server does not background itself and prints extra status messages to stderr for each request that it receives\&.
 \fBpath\fR
 is an optionally parameter\&.
 \fBypserv\fR
 is using this directory instead of /var/yp
 .RE
 .PP
+\fB\-i\fR, \fB\-\-iface\fR \fIiface\fR
+.RS 4
+Causes the server to only be available via interface iface. Use this if you want ypserv to only provide service on a particular network interfaces.
+.RE
+.PP
 \fB\-p\fR, \fB\-\-port\fR \fIport\fR
 .RS 4
 \fBypserv\fR
diff -up ypserv-2.21/ypserv/ypserv.c.iface ypserv-2.21/ypserv/ypserv.c
--- ypserv-2.21/ypserv/ypserv.c.iface	2009-06-12 11:20:59.000000000 +0200
+++ ypserv-2.21/ypserv/ypserv.c	2010-01-13 16:20:14.388249858 +0100
@@ -33,12 +33,15 @@
 #include <getopt.h>
 #endif
 #include <sys/file.h>
+#include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
 #include <arpa/inet.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_clnt.h>
+#include <linux/if.h>
+#include <netinet/in.h>
 #if defined(HAVE_RPC_SVC_SOC_H)
 #include <rpc/svc_soc.h> /* for svcudp_create() */
 #endif /* HAVE_RPC_SVC_SOC_H */
@@ -64,6 +67,8 @@
 #define YPOLDVERS 1
 #endif
 
+struct in_addr my_iface_num = {INADDR_ANY};
+
 static char *path_ypdb = YPMAPDIR;
 
 static void
@@ -96,7 +101,25 @@ ypprog_2 (struct svc_req *rqstp, registe
   bool_t retval;
   xdrproc_t _xdr_argument, _xdr_result;
   bool_t (*local) (char *, void *, struct svc_req *);
+  struct sockaddr_in *rqhost;
+  struct in_addr rqnetwork;
 
+  if (my_iface_num.s_addr != INADDR_ANY) {
+  	/*
+	 * If we are suppost only listen on one interface
+	 * make this request comes from that inteface
+	 * otherwise ignore it.
+	 */
+	rqhost = svc_getcaller (rqstp->rq_xprt);
+	rqnetwork.s_addr = inet_netof(rqhost->sin_addr);
+  	if (rqnetwork.s_addr != inet_netof(my_iface_num)) {
+      if (debug_flag) {
+		log_msg("Ignoring request from %s: wrong network\n",
+			inet_ntoa(rqhost->sin_addr));
+	  }
+	  return;
+  	}
+  }
   switch (rqstp->rq_proc)
     {
     case YPPROC_NULL:
@@ -254,6 +277,36 @@ mysvc_run (void)
 }
 #endif
 
+static void
+get_inet_for_iface (char *iface, uint32_t *iface_num)
+{
+  struct ifreq ifr;
+  struct in_addr inaddr;
+  int fd;
+
+  *iface_num = INADDR_ANY;
+
+  fd = socket (AF_INET, SOCK_DGRAM, 0);
+  if(fd < 0)
+    return;
+
+  memset(&ifr, '\0', sizeof(ifr));
+  strncpy (ifr.ifr_name, iface,
+      IFNAMSIZ > strlen (iface) ? strlen (iface) : IFNAMSIZ);
+
+  if (ioctl (fd, SIOCGIFADDR, &ifr) < 0)
+    {
+	  log_msg("ifr_name error: %d\n", errno);
+      close (fd);
+      return;
+    }
+  memcpy(&inaddr, &ifr.ifr_netmask.sa_data[2], sizeof(struct in_addr));
+  *iface_num = inaddr.s_addr;
+
+  close (fd);
+}
+
+
 /* Create a pidfile on startup */
 static void
 create_pidfile (void)
@@ -403,7 +456,7 @@ sig_child (int sig UNUSED)
 static void
 Usage (int exitcode)
 {
-  fputs ("usage: ypserv [-d [path]] [-p port]\n", stderr);
+  fputs ("usage: ypserv [-d [path]] [-p port] [-i interface]\n", stderr);
   fputs ("       ypserv --version\n", stderr);
 
   exit (exitcode);
@@ -414,6 +467,7 @@ main (int argc, char **argv)
 {
   SVCXPRT *transp_udp, *transp_tcp;
   int my_port = -1, my_socket, result;
+  char *my_iface = NULL;
   struct sockaddr_in s_in;
 
   openlog ("ypserv", LOG_PID, LOG_DAEMON);
@@ -426,12 +480,13 @@ main (int argc, char **argv)
 	{"version", no_argument, NULL, 'v'},
 	{"debug", no_argument, NULL, 'd'},
 	{"port", required_argument, NULL, 'p'},
+	{"iface", required_argument, NULL, 'i'},
 	{"usage", no_argument, NULL, 'u'},
 	{"help", no_argument, NULL, 'h'},
 	{NULL, 0, NULL, '\0'}
       };
 
-      c = getopt_long (argc, argv, "vdp:buh", long_options, &option_index);
+      c = getopt_long (argc, argv, "vdp:i:buh", long_options, &option_index);
       if (c == -1)
 	break;
       switch (c)
@@ -448,6 +503,11 @@ main (int argc, char **argv)
 	  if (debug_flag)
 	    log_msg ("Using port %d\n", my_port);
 	  break;
+	case 'i':
+	  my_iface = optarg;
+	  if (debug_flag)
+            log_msg ("Using interface %s\n", my_iface);
+	  break;
 	case 'u':
 	case 'h':
 	  Usage (0);
@@ -554,6 +614,11 @@ main (int argc, char **argv)
   pmap_unset (YPPROG, YPVERS);
   pmap_unset (YPPROG, YPOLDVERS);
 
+  if (my_iface)
+    {
+      get_inet_for_iface (my_iface, &my_iface_num.s_addr);
+    }
+
   if (my_port >= 0)
     {
       my_socket = socket (AF_INET, SOCK_DGRAM, 0);
@@ -565,7 +630,7 @@ main (int argc, char **argv)
 
       memset ((char *) &s_in, 0, sizeof (s_in));
       s_in.sin_family = AF_INET;
-      s_in.sin_addr.s_addr = htonl (INADDR_ANY);
+      s_in.sin_addr.s_addr = htonl (my_iface_num.s_addr);
       s_in.sin_port = htons (my_port);
 
       result = bind (my_socket, (struct sockaddr *) &s_in,
@@ -611,7 +676,7 @@ main (int argc, char **argv)
 
       memset (&s_in, 0, sizeof (s_in));
       s_in.sin_family = AF_INET;
-      s_in.sin_addr.s_addr = htonl (INADDR_ANY);
+      s_in.sin_addr.s_addr = htonl (my_iface_num.s_addr);
       s_in.sin_port = htons (my_port);
 
       result = bind (my_socket, (struct sockaddr *) &s_in,

ypserv-2.21-path.patch:
 Makefile.in |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE ypserv-2.21-path.patch ---
diff -up ypserv-2.21/scripts/Makefile.in.path ypserv-2.21/scripts/Makefile.in
--- ypserv-2.21/scripts/Makefile.in.path	2009-06-12 11:32:02.000000000 +0200
+++ ypserv-2.21/scripts/Makefile.in	2010-01-13 16:09:15.056375015 +0100
@@ -168,7 +168,7 @@ AUTOMAKE_OPTIONS = 1.7 gnits
 #
 CLEANFILES = *~ ${SCRIPTS}
 EXTRA_DIST = ${MANS} ${XMLS}
-varypdir = /var/yp
+varypdir = ${prefix}/../var/yp
 man_MANS = pwupdate.8 ypinit.8
 XMLS = pwupdate.8.xml ypinit.8.xml
 libexec_SCRIPTS = ypxfr_1perhour ypxfr_1perday ypxfr_2perday \


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/ypserv/devel/.cvsignore,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- .cvsignore	13 Feb 2006 16:28:40 -0000	1.12
+++ .cvsignore	14 Jan 2010 10:59:18 -0000	1.13
@@ -1 +1 @@
-ypserv-2.19.tar.bz2
+ypserv-2.21.tar.bz2


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/ypserv/devel/sources,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -p -r1.12 -r1.13
--- sources	13 Feb 2006 16:28:40 -0000	1.12
+++ sources	14 Jan 2010 10:59:18 -0000	1.13
@@ -1 +1 @@
-f6f856fc8143040ba8db61a1717ae815  ypserv-2.19.tar.bz2
+e94915050af69842c13a5fa79b800c3d  ypserv-2.21.tar.bz2


Index: ypserv.spec
===================================================================
RCS file: /cvs/extras/rpms/ypserv/devel/ypserv.spec,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -r1.47 -r1.48
--- ypserv.spec	7 Jan 2010 10:27:11 -0000	1.47
+++ ypserv.spec	14 Jan 2010 10:59:19 -0000	1.48
@@ -3,8 +3,8 @@
 Summary: The NIS (Network Information Service) server
 Url: http://www.linux-nis.org/nis/ypserv/index.html
 Name: ypserv
-Version: 2.19
-Release: 15%{?dist}
+Version: 2.21
+Release: 1%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 Source0: ftp://ftp.kernel.org/pub/linux/utils/net/NIS/ypserv-%{version}.tar.bz2
@@ -20,17 +20,13 @@ Requires(preun): initscripts
 Requires(postun): initscripts
 
 Patch0: ypserv-2.5-redhat.patch
-Patch1: ypserv-2.11-path.patch
+Patch1: ypserv-2.21-path.patch
 Patch2: ypserv-2.5-nfsnobody2.patch
-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
-Patch9: ypserv-2.13-nonedomain.patch
-Patch10: ypserv-2.19-quieter.patch
-Patch11: ypserv-2.19-debuginfo.patch
-Patch12: ypserv-2.19-slp-warning.patch
+Patch3: ypserv-2.21-iface.patch
+Patch4: ypserv-2.13-ypxfr-zeroresp.patch
+Patch5: ypserv-2.19-inval-ports.patch
+Patch6: ypserv-2.13-nonedomain.patch
+Patch7: ypserv-2.19-slp-warning.patch
 Obsoletes: yppasswd
 BuildRequires: gdbm-devel
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -56,15 +52,11 @@ machines.
 %patch0 -p1 -b .redhat
 %patch1 -p1 -b .path
 %patch2 -p1 -b .nfsnobody
-%patch3 -p1 -b .nomap
-%patch4 -p1 -b .iface
-%patch6 -p1 -b .memleak
-%patch7 -p1 -b .respzero
-%patch8 -p1 -b .ports
-%patch9 -p1 -b .nonedomain
-%patch10 -p1 -b .quieter
-%patch11 -p1 -b .debuginfo
-%patch12 -p1 -b .slp-warning
+%patch3 -p1 -b .iface
+%patch4 -p1 -b .respzero
+%patch5 -p1 -b .ports
+%patch6 -p1 -b .nonedomain
+%patch7 -p1 -b .slp-warning
 
 %build
 cp etc/README etc/README.etc
@@ -150,6 +142,14 @@ exit 0
 %{_includedir}/*/*
 
 %changelog
+* Wed Jan 13 2010 Karel Klic <kklic at redhat.com> - 2.21-1
+- Updated to new upstream version
+- Removed ypserv-2.11-nomap.patch, it has been applied by upstream
+- Removed ypserv-2.19-quieter.patch, it has been applied by upstream
+- Removed ypserv-2.13-yplib-memleak.patch, upstream version fixes the problem
+- Removed ypserv-2.19-debuginfo.patch, upstream version no longer needs it
+- Ported -path, -iface patches to the new version
+
 * Thu Jan  7 2010 Karel Klic <kklic at redhat.com> - 2.19-15
 - Removed Prereq use in the spec file
 - Removed usage of RPM_SOURCE_DIR from the spec file


--- ypserv-2.11-iface-binding3.patch DELETED ---


--- ypserv-2.11-nomap.patch DELETED ---


--- ypserv-2.11-path.patch DELETED ---


--- ypserv-2.13-yplib-memleak.patch DELETED ---


--- ypserv-2.19-debuginfo.patch DELETED ---


--- ypserv-2.19-quieter.patch DELETED ---



More information about the scm-commits mailing list