mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
new package: add package 'portmap'
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
8464ab8f52
commit
7dbd87b3a1
11
packages/network/portmap/build
Executable file
11
packages/network/portmap/build
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options $1
|
||||
|
||||
cd $PKG_BUILD
|
||||
make FACILITY=LOG_AUTH \
|
||||
ZOMBIES='-DIGNORE_SIGCHLD -Dlint' \
|
||||
LIBS="-lnsl" \
|
||||
AUX="" \
|
||||
HOSTS_ACCESS="" \
|
||||
|
30
packages/network/portmap/init.d/26_portmap
Executable file
30
packages/network/portmap/init.d/26_portmap
Executable file
@ -0,0 +1,30 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||
# http://www.openelec.tv
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
# starting portmap
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
|
||||
. /etc/profile
|
||||
|
||||
progress "starting portmap"
|
||||
portmap
|
10
packages/network/portmap/install
Executable file
10
packages/network/portmap/install
Executable file
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
. config/options $1
|
||||
|
||||
mkdir -p $INSTALL/sbin
|
||||
cp $PKG_BUILD/portmap $INSTALL/sbin/
|
||||
|
||||
mkdir -p $INSTALL/usr/sbin
|
||||
cp $PKG_BUILD/pmap_set $INSTALL/usr/sbin/
|
||||
cp $PKG_BUILD/pmap_dump $INSTALL/usr/sbin/
|
16
packages/network/portmap/meta
Normal file
16
packages/network/portmap/meta
Normal file
@ -0,0 +1,16 @@
|
||||
PKG_NAME="portmap"
|
||||
PKG_VERSION="4"
|
||||
PKG_REV="1"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="OSS"
|
||||
PKG_SITE="ftp://ftp.porcupine.org/pub/security/"
|
||||
PKG_URL="ftp://ftp.porcupine.org/pub/security/${PKG_NAME}_${PKG_VERSION}.tar.gz"
|
||||
PKG_DEPENDS=""
|
||||
PKG_BUILD_DEPENDS="toolchain"
|
||||
PKG_PRIORITY="optional"
|
||||
PKG_SECTION="network"
|
||||
PKG_SHORTDESC="portmap: RPC portmapper"
|
||||
PKG_LONGDESC="This is an RPC portmapper that prevents theft of NIS (YP), NFS, and other sensitive information via the portmapper. As an option, the program supports access control in the style of the tcp wrapper (log_tcp) package."
|
||||
PKG_IS_ADDON="no"
|
||||
|
||||
PKG_AUTORECONF="no"
|
18
packages/network/portmap/patches/portmap-4-errno.patch
Normal file
18
packages/network/portmap/patches/portmap-4-errno.patch
Normal file
@ -0,0 +1,18 @@
|
||||
--- portmap_4/portmap.c.old 1996-05-31 09:52:59.000000000 -0400
|
||||
+++ portmap_4/portmap.c 2002-12-13 11:44:16.000000000 -0500
|
||||
@@ -94,6 +94,7 @@
|
||||
#ifdef SYSV40
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
+#include <errno.h>
|
||||
|
||||
extern char *strerror();
|
||||
#include <stdlib.h>
|
||||
@@ -124,7 +125,6 @@
|
||||
static void callit();
|
||||
struct pmaplist *pmaplist;
|
||||
int debugging = 0;
|
||||
-extern int errno;
|
||||
|
||||
#include "pmap_check.h"
|
||||
|
27
packages/network/portmap/patches/portmap-4-linux.patch
Normal file
27
packages/network/portmap/patches/portmap-4-linux.patch
Normal file
@ -0,0 +1,27 @@
|
||||
--- portmap_4/Makefile.orig Fri May 31 09:50:40 1996
|
||||
+++ portmap_4/Makefile Fri Aug 9 17:40:43 1996
|
||||
@@ -67,9 +67,9 @@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
-COPT = -Dconst= -Dperror=xperror $(HOSTS_ACCESS) $(CHECK_PORT) \
|
||||
+COPT = -Dconst= $(HOSTS_ACCESS) $(CHECK_PORT) \
|
||||
$(SYS) -DFACILITY=$(FACILITY) $(ULONG) $(ZOMBIES) $(SA_LEN)
|
||||
-CFLAGS = $(COPT) -O $(NSARCHS) $(SETPGRP)
|
||||
+CFLAGS = $(COPT) $(RPM_OPT_FLAGS) $(NSARCHS) $(SETPGRP)
|
||||
OBJECTS = portmap.o pmap_check.o from_local.o $(AUX)
|
||||
|
||||
all: portmap pmap_dump pmap_set
|
||||
--- portmap_4/Makefile.bad 1996-05-31 09:50:40.000000000 -0400
|
||||
+++ portmap_4/Makefile 2002-12-12 09:54:00.000000000 -0500
|
||||
@@ -74,8 +74,8 @@
|
||||
|
||||
all: portmap pmap_dump pmap_set
|
||||
|
||||
-portmap: $(OBJECTS) $(WRAP_DIR)/libwrap.a
|
||||
- $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(WRAP_DIR)/libwrap.a $(LIBS)
|
||||
+portmap: $(OBJECTS)
|
||||
+ $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
|
||||
|
||||
pmap_dump: pmap_dump.c
|
||||
$(CC) $(CFLAGS) -o $@ $? $(LIBS)
|
51
packages/network/portmap/patches/portmap-4-loopback.patch
Normal file
51
packages/network/portmap/patches/portmap-4-loopback.patch
Normal file
@ -0,0 +1,51 @@
|
||||
--- portmap_4/portmap.c.orig 2004-08-12 10:48:13.405000000 -0400
|
||||
+++ portmap_4/portmap.c 2004-08-12 10:58:13.666000000 -0400
|
||||
@@ -126,6 +126,7 @@
|
||||
static void callit();
|
||||
struct pmaplist *pmaplist;
|
||||
int debugging = 0;
|
||||
+int localhost_only = 0;
|
||||
|
||||
#include "pmap_check.h"
|
||||
|
||||
@@ -140,13 +141,17 @@
|
||||
int len = sizeof(struct sockaddr_in);
|
||||
register struct pmaplist *pml;
|
||||
|
||||
- while ((c = getopt(argc, argv, "dv")) != EOF) {
|
||||
+ while ((c = getopt(argc, argv, "dlv")) != EOF) {
|
||||
switch (c) {
|
||||
|
||||
case 'd':
|
||||
debugging = 1;
|
||||
break;
|
||||
|
||||
+ case 'l':
|
||||
+ localhost_only = 1;
|
||||
+ break;
|
||||
+
|
||||
case 'v':
|
||||
verboselog = 1;
|
||||
break;
|
||||
@@ -154,6 +159,7 @@
|
||||
default:
|
||||
(void) fprintf(stderr, "usage: %s [-dv]\n", argv[0]);
|
||||
(void) fprintf(stderr, "-d: debugging mode\n");
|
||||
+ (void) fprintf(stderr, "-l: listen on localhost only\n");
|
||||
(void) fprintf(stderr, "-v: verbose logging\n");
|
||||
exit(1);
|
||||
}
|
||||
@@ -176,7 +182,12 @@
|
||||
exit(1);
|
||||
}
|
||||
|
||||
- addr.sin_addr.s_addr = 0;
|
||||
+ if (localhost_only) {
|
||||
+ addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
|
||||
+ syslog(LOG_NOTICE, "Only binding to LOOPBACK address!");
|
||||
+ } else {
|
||||
+ addr.sin_addr.s_addr = 0;
|
||||
+ }
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons(PMAPPORT);
|
||||
if (bind(sock, (struct sockaddr *)&addr, len) != 0) {
|
42
packages/network/portmap/patches/portmap-4-pie.patch
Normal file
42
packages/network/portmap/patches/portmap-4-pie.patch
Normal file
@ -0,0 +1,42 @@
|
||||
--- portmap_4/Makefile.pie 2003-10-28 20:18:32.000000000 -0800
|
||||
+++ portmap_4/Makefile 2003-10-28 20:18:32.000000000 -0800
|
||||
@@ -74,8 +74,11 @@
|
||||
|
||||
all: portmap pmap_dump pmap_set
|
||||
|
||||
+$(OBJECTS): %.o: %.c
|
||||
+ $(CC) $(CFLAGS) -fpie -c $<
|
||||
+
|
||||
portmap: $(OBJECTS)
|
||||
- $(CC) $(CFLAGS) -o $@ $(OBJECTS) $(LIBS)
|
||||
+ $(CC) $(CFLAGS) -o $@ -pie $(OBJECTS) $(LIBS)
|
||||
|
||||
pmap_dump: pmap_dump.c
|
||||
$(CC) $(CFLAGS) -o $@ $? $(LIBS)
|
||||
--- portmap_4/pmap_check.h.pie 2003-10-28 20:26:34.000000000 -0800
|
||||
+++ portmap_4/pmap_check.h 2003-10-28 20:26:49.000000000 -0800
|
||||
@@ -6,6 +6,6 @@
|
||||
extern int check_setunset();
|
||||
extern int check_privileged_port();
|
||||
extern int check_callit();
|
||||
-extern int verboselog;
|
||||
-extern int allow_severity;
|
||||
-extern int deny_severity;
|
||||
+extern int verboselog __attribute__ ((visibility ("hidden")));
|
||||
+extern int allow_severity __attribute__ ((visibility ("hidden")));
|
||||
+extern int deny_severity __attribute__ ((visibility ("hidden")));
|
||||
--- portmap_4/pmap_check.c.pie 2003-10-28 20:27:38.000000000 -0800
|
||||
+++ portmap_4/pmap_check.c 2003-10-28 20:27:40.000000000 -0800
|
||||
@@ -63,9 +63,9 @@
|
||||
|
||||
static void logit();
|
||||
static void toggle_verboselog();
|
||||
-int verboselog = 0;
|
||||
-int allow_severity = LOG_INFO;
|
||||
-int deny_severity = LOG_WARNING;
|
||||
+int verboselog __attribute ((visibility ("hidden"))) = 0;
|
||||
+int allow_severity __attribute ((visibility ("hidden"))) = LOG_INFO;
|
||||
+int deny_severity __attribute ((visibility ("hidden"))) = LOG_WARNING;
|
||||
|
||||
/* A handful of macros for "readability". */
|
||||
|
12
packages/network/portmap/patches/portmap-4-sigpipe.patch
Normal file
12
packages/network/portmap/patches/portmap-4-sigpipe.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- portmap_4/portmap.c.sigpipe Sun Feb 11 17:45:11 2001
|
||||
+++ portmap_4/portmap.c Sun Feb 11 17:45:51 2001
|
||||
@@ -228,6 +228,9 @@
|
||||
#else
|
||||
(void)signal(SIGCHLD, reap);
|
||||
#endif
|
||||
+ /* Dying on SIGPIPE doesn't help anyone */
|
||||
+ (void)signal(SIGPIPE, SIG_IGN);
|
||||
+
|
||||
svc_run();
|
||||
syslog(LOG_ERR, "run_svc returned unexpectedly");
|
||||
abort();
|
Loading…
x
Reference in New Issue
Block a user