diff options
author | Mike Frysinger <vapier@gentoo.org> | 2004-10-31 05:58:05 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2004-10-31 05:58:05 +0000 |
commit | e5cacf49b5b9333d0a2371a2b79ae6084130ebfd (patch) | |
tree | e1bc285dd8a9c829ee73cb8f7c7a2d97175ea54d /net-nds/portmap/files | |
parent | arm/hppa/ia64 stable for security #69315 (Manifest recommit) (diff) | |
download | gentoo-2-e5cacf49b5b9333d0a2371a2b79ae6084130ebfd.tar.gz gentoo-2-e5cacf49b5b9333d0a2371a2b79ae6084130ebfd.tar.bz2 gentoo-2-e5cacf49b5b9333d0a2371a2b79ae6084130ebfd.zip |
Clean up ebuilds and add support for loopback-only #65199 by Elros Cyriatan.
Diffstat (limited to 'net-nds/portmap/files')
-rw-r--r-- | net-nds/portmap/files/portmap-5b-loopback-only.patch | 62 | ||||
-rw-r--r-- | net-nds/portmap/files/portmap-5b-optional-tcpd.patch | 38 | ||||
-rw-r--r-- | net-nds/portmap/files/portmap.confd | 6 | ||||
-rw-r--r-- | net-nds/portmap/files/portmap.rc6 | 8 |
4 files changed, 110 insertions, 4 deletions
diff --git a/net-nds/portmap/files/portmap-5b-loopback-only.patch b/net-nds/portmap/files/portmap-5b-loopback-only.patch new file mode 100644 index 000000000000..4684319ce574 --- /dev/null +++ b/net-nds/portmap/files/portmap-5b-loopback-only.patch @@ -0,0 +1,62 @@ +diff -u portmap_5beta/pmap_check.c portmap_5beta_elros/pmap_check.c +--- portmap_5beta/pmap_check.c 1996-07-07 10:49:10.000000000 +0200 ++++ portmap_5beta_elros/pmap_check.c 2004-09-24 01:56:47.000000000 +0200 +@@ -63,6 +63,7 @@ + static void logit(); + static void toggle_verboselog(); + int verboselog = 0; ++int listenonlyloopback = 0; + int allow_severity = LOG_INFO; + int deny_severity = LOG_WARNING; + +diff -u portmap_5beta/pmap_check.h portmap_5beta_elros/pmap_check.h +--- portmap_5beta/pmap_check.h 1996-07-06 23:06:23.000000000 +0200 ++++ portmap_5beta_elros/pmap_check.h 2004-09-24 01:55:24.000000000 +0200 +@@ -7,6 +7,7 @@ + extern int check_privileged_port(); + extern int check_callit(); + extern int verboselog; ++extern int listenonlyloopback; + extern int allow_severity; + extern int deny_severity; + +diff -u portmap_5beta/portmap.c portmap_5beta_elros/portmap.c +--- portmap_5beta/portmap.c 1996-07-06 23:06:24.000000000 +0200 ++++ portmap_5beta_elros/portmap.c 2004-09-24 01:49:47.000000000 +0200 +@@ -158,7 +158,7 @@ + int len = sizeof(struct sockaddr_in); + register struct pmaplist *pml; + +- while ((c = getopt(argc, argv, "dv")) != EOF) { ++ while ((c = getopt(argc, argv, "dvl")) != EOF) { + switch (c) { + + case 'd': +@@ -169,10 +169,15 @@ + verboselog = 1; + break; + ++ case 'l': ++ listenonlyloopback = 1; ++ break; ++ + default: + (void) fprintf(stderr, "usage: %s [-dv]\n", argv[0]); + (void) fprintf(stderr, "-d: debugging mode\n"); + (void) fprintf(stderr, "-v: verbose logging\n"); ++ (void) fprintf(stderr, "-l: listen only on loopback address (not on external address)\n"); + exit(1); + } + } +@@ -201,6 +206,11 @@ + addr.sin_addr.s_addr = 0; + addr.sin_family = AF_INET; + addr.sin_port = htons(PMAPPORT); ++ ++ if (listenonlyloopback) { ++ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); ++ } ++ + if (bind(sock, (struct sockaddr *)&addr, len) != 0) { + syslog(LOG_ERR, "cannot bind udp: %m"); + exit(1); diff --git a/net-nds/portmap/files/portmap-5b-optional-tcpd.patch b/net-nds/portmap/files/portmap-5b-optional-tcpd.patch new file mode 100644 index 000000000000..fa2d5204af86 --- /dev/null +++ b/net-nds/portmap/files/portmap-5b-optional-tcpd.patch @@ -0,0 +1,38 @@ +--- Makefile.orig 2004-10-31 01:54:48.073875024 -0400 ++++ Makefile 2004-10-31 01:54:58.395305928 -0400 +@@ -15,8 +15,6 @@ + # no access control tables. The local system, since it runs the portmap + # daemon, is always treated as an authorized host. + +-HOSTS_ACCESS= -DHOSTS_ACCESS +-WRAP_LIB = $(WRAP_DIR)/libwrap.a + + # Comment out if your RPC library does not allocate privileged ports for + # requests from processes with root privilege, or the new portmap will +@@ -87,7 +85,7 @@ + # + AUX = # daemon.o strerror.o + +-LIBS = -lwrap -lutil ++LIBS = -lutil + NSARCHS = + O = -Wall -O2 -pipe + +@@ -110,7 +108,7 @@ + + SHELL = /bin/sh + +-COPT = $(CONST) -Dperror=xperror $(HOSTS_ACCESS) $(CHECK_PORT) \ ++COPT = $(CONST) -Dperror=xperror $(CHECK_PORT) \ + $(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN) \ + $(LOOPBACK) $(SETPGRP) + CFLAGS = $(COPT) $(O) $(NSARCHS) +@@ -118,7 +116,7 @@ + + all: portmap pmap_dump pmap_set + +-portmap: $(OBJECTS) $(WRAP_DIR)/libwrap.a ++portmap: $(OBJECTS) + $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(WRAP_LIB) $(LIBS) + + pmap_dump: pmap_dump.c diff --git a/net-nds/portmap/files/portmap.confd b/net-nds/portmap/files/portmap.confd new file mode 100644 index 000000000000..3f909c4d233e --- /dev/null +++ b/net-nds/portmap/files/portmap.confd @@ -0,0 +1,6 @@ +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.confd,v 1.1 2004/10/31 05:58:05 vapier Exp $ + +# Listen on localhost only by default +#PORTMAP_OPTS="-l" diff --git a/net-nds/portmap/files/portmap.rc6 b/net-nds/portmap/files/portmap.rc6 index ca8b2f692c01..1868004bb5a2 100644 --- a/net-nds/portmap/files/portmap.rc6 +++ b/net-nds/portmap/files/portmap.rc6 @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.rc6,v 1.8 2004/09/20 18:20:26 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-nds/portmap/files/portmap.rc6,v 1.9 2004/10/31 05:58:05 vapier Exp $ depend() { need net @@ -11,11 +11,11 @@ depend() { start() { ebegin "Starting portmap" - start-stop-daemon --start --quiet --exec /sbin/portmap + start-stop-daemon --start --quiet --exec /sbin/portmap -- ${PORTMAP_OPTS} local ret=$? eend ${ret} - #without, if a service depending on portmap is started too fast, - #connecting to portmap will fail -- azarah + # without, if a service depending on portmap is started too fast, + # connecting to portmap will fail -- azarah sleep 1 return ${ret} } |