mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-16 16:50:06 +02:00
208 lines
6.6 KiB
Plaintext
208 lines
6.6 KiB
Plaintext
From 54208b419757982ed670e2b875fb22b39385f3f6 Mon Sep 17 00:00:00 2001
|
|
From: Begasus <begasus@gmail.com>
|
|
Date: Sat, 28 Apr 2018 13:06:05 +0200
|
|
Subject: import previous patch
|
|
|
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
|
index a629a1f..403f049 100644
|
|
--- a/Makefile.in
|
|
+++ b/Makefile.in
|
|
@@ -76,26 +76,26 @@ dlibxlog: dlibsio dlibstr
|
|
install: build
|
|
for i in $(DAEMONDIR) $(BINDIR) $(MANDIR)/man5 $(MANDIR)/man8 ; do \
|
|
test -d $$i || mkdir -p $$i ; done
|
|
- $(INSTALL_CMD) -m 755 xinetd/xinetd $(DAEMONDIR)
|
|
- $(INSTALL_CMD) -m 755 xinetd/itox $(DAEMONDIR)
|
|
- $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DAEMONDIR)
|
|
- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(MANDIR)/man5/xinetd.conf.5
|
|
- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(MANDIR)/man8/xinetd.log.8
|
|
- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(MANDIR)/man8/xinetd.8
|
|
- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(MANDIR)/man8/itox.8
|
|
- $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(MANDIR)/man8/xconv.pl.8
|
|
+ $(INSTALL_CMD) -m 755 xinetd/xinetd $(DESTDIR)$(DAEMONDIR)
|
|
+ $(INSTALL_CMD) -m 755 xinetd/itox $(DESTDIR)$(DAEMONDIR)
|
|
+ $(INSTALL_CMD) -m 755 $(SRCDIR)/xinetd/xconv.pl $(DESTDIR)$(DAEMONDIR)
|
|
+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.conf.man $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
|
|
+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.log.man $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
|
|
+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xinetd.man $(DESTDIR)$(MANDIR)/man8/xinetd.8
|
|
+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/itox.8 $(DESTDIR)$(MANDIR)/man8/itox.8
|
|
+ $(INSTALL_CMD) -m 644 $(SRCDIR)/xinetd/xconv.pl.8 $(DESTDIR)$(MANDIR)/man8/xconv.pl.8
|
|
@echo "You must put your xinetd.conf in /etc/xinetd.conf"
|
|
@echo "There is a sample config file in xinetd/sample.conf and you can"
|
|
@echo "use xconv.pl to convert your old inetd.conf file to an xinetd format"
|
|
|
|
uninstall:
|
|
- rm -f $(DAEMONDIR)/xinetd
|
|
- rm -f $(DAEMONDIR)/itox
|
|
- rm -f $(DAEMONDIR)/xconv.pl
|
|
- rm -f $(MANDIR)/man5/xinetd.conf.5
|
|
- rm -f $(MANDIR)/man8/xinetd.log.8
|
|
- rm -f $(MANDIR)/man8/xinetd.8
|
|
- rm -f $(MANDIR)/man8/itox.8
|
|
+ rm -f $(DESTDIR)$(DAEMONDIR)/xinetd
|
|
+ rm -f $(DESTDIR)$(DAEMONDIR)/itox
|
|
+ rm -f $(DESTDIR)$(DAEMONDIR)/xconv.pl
|
|
+ rm -f $(DESTDIR)$(MANDIR)/man5/xinetd.conf.5
|
|
+ rm -f $(DESTDIR)$(MANDIR)/man8/xinetd.log.8
|
|
+ rm -f $(DESTDIR)$(MANDIR)/man8/xinetd.8
|
|
+ rm -f $(DESTDIR)$(MANDIR)/man8/itox.8
|
|
|
|
distclean: clean
|
|
rm -f config.cache config.log Makefile config.status xinetd/itox
|
|
diff --git a/configure.in b/configure.in
|
|
index be80dce..cdf510c 100644
|
|
--- a/configure.in
|
|
+++ b/configure.in
|
|
@@ -7,9 +7,9 @@ AC_PROG_INSTALL
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CHECK_LIB(compat, main)
|
|
-AC_SEARCH_LIBS(gethostbyname, nsl socket resolv)
|
|
-AC_SEARCH_LIBS(getnameinfo, nsl socket resolv)
|
|
-AC_SEARCH_LIBS(inet_ntop, nsl socket resolv)
|
|
+AC_SEARCH_LIBS(gethostbyname, nsl socket resolv network)
|
|
+AC_SEARCH_LIBS(getnameinfo, nsl socket resolv network)
|
|
+AC_SEARCH_LIBS(inet_ntop, nsl socket resolv network)
|
|
AC_CHECK_FUNCS(getnameinfo inet_ntop)
|
|
AC_CHECK_FUNCS(difftime, ,
|
|
AC_CHECK_LIB(m, difftime))
|
|
@@ -27,8 +27,9 @@ AC_CHECK_FUNC(socket, ,
|
|
AC_CHECK_LIB(nsl, socket)))
|
|
AC_CHECK_FUNC(inet_aton, ,
|
|
AC_CHECK_LIB(nsl, inet_aton, ,
|
|
+ AC_CHECK_LIB(network, inet_aton, ,
|
|
AC_CHECK_LIB(socket, inet_aton, ,
|
|
- AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)]))))
|
|
+ AC_CHECK_LIB(resolv, inet_aton, ,[AC_DEFINE(NO_INET_ATON)])))))
|
|
AC_CHECK_FUNC(setenv,[AC_DEFINE(HAVE_SETENV)])
|
|
AC_CHECK_FUNC(strsignal, [AC_DEFINE(HAVE_STRSIGNAL)])
|
|
AC_CHECK_LIB(c, sys_siglist, [AC_DEFINE(HAVE_SYS_SIGLIST)])
|
|
diff --git a/libs/src/sio/sio.c b/libs/src/sio/sio.c
|
|
index 1b4f542..f815dc0 100644
|
|
--- a/libs/src/sio/sio.c
|
|
+++ b/libs/src/sio/sio.c
|
|
@@ -10,7 +10,7 @@
|
|
#include <sys/types.h>
|
|
#endif
|
|
|
|
-#ifdef _APPLE_
|
|
+#if defined _APPLE_ || defined __HAIKU__
|
|
#undef HAVE_MMAP
|
|
#endif
|
|
|
|
diff --git a/libs/src/sio/siosup.c b/libs/src/sio/siosup.c
|
|
index de68ee2..b4c4414 100644
|
|
--- a/libs/src/sio/siosup.c
|
|
+++ b/libs/src/sio/siosup.c
|
|
@@ -13,7 +13,7 @@
|
|
#include <unistd.h>
|
|
#include <syslog.h>
|
|
|
|
-#ifdef _APPLE_
|
|
+#if defined _APPLE_ || defined __HAIKU__
|
|
#undef HAVE_MMAP
|
|
#endif
|
|
|
|
diff --git a/xinetd/child.c b/xinetd/child.c
|
|
index e7781b6..f237da1 100644
|
|
--- a/xinetd/child.c
|
|
+++ b/xinetd/child.c
|
|
@@ -338,7 +338,11 @@ void child_process( struct server *serp )
|
|
{
|
|
set_credentials( scp ) ;
|
|
if ( SC_SPECIFIED( scp, A_NICE ) )
|
|
+#ifndef __HAIKU__
|
|
(void) nice( SC_NICE( scp ) ) ;
|
|
+#else
|
|
+ sleep( 1 );
|
|
+#endif /* HAIKU does not have nice() */
|
|
}
|
|
|
|
if ( svc_child_access_control(sp, cp) != OK )
|
|
diff --git a/xinetd/confparse.c b/xinetd/confparse.c
|
|
index b277bf9..d9d651d 100644
|
|
--- a/xinetd/confparse.c
|
|
+++ b/xinetd/confparse.c
|
|
@@ -745,8 +745,8 @@ static status_e check_entry( struct service_config *scp,
|
|
}
|
|
}
|
|
|
|
-/* #ifndef NO_RPC */
|
|
-#if defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H)
|
|
+/* #ifdef HAVE_RPC_RPC */
|
|
+#if ((defined(HAVE_RPC_RPCENT_H) || defined(HAVE_NETDB_H)) && !defined __HAIKU__ )
|
|
if ( SC_IS_RPC( scp ) && !SC_IS_UNLISTED( scp ) )
|
|
{
|
|
struct rpcent *rep = (struct rpcent *)getrpcbyname( SC_NAME(scp) ) ;
|
|
diff --git a/xinetd/server.h b/xinetd/server.h
|
|
index 43b282a..44fee7b 100644
|
|
--- a/xinetd/server.h
|
|
+++ b/xinetd/server.h
|
|
@@ -24,6 +24,9 @@
|
|
typedef int pid_t ;
|
|
#endif
|
|
|
|
+#ifndef FNDELAY
|
|
+#define FNDELAY O_NONBLOCK
|
|
+#endif
|
|
|
|
/*
|
|
* This struct describes running servers
|
|
diff --git a/xinetd/signals.h b/xinetd/signals.h
|
|
index 6acf97c..3aaf0b8 100644
|
|
--- a/xinetd/signals.h
|
|
+++ b/xinetd/signals.h
|
|
@@ -6,6 +6,10 @@
|
|
#ifndef _X_SIGNALS
|
|
#define _X_SIGNALS
|
|
|
|
+#ifndef SIGIOT
|
|
+#define SIGIOT SIGABRT
|
|
+#endif
|
|
+
|
|
#include "defs.h"
|
|
|
|
#if defined(NO_POSIX_SIGS)
|
|
diff --git a/xinetd/util.h b/xinetd/util.h
|
|
index f46563d..d94730d 100644
|
|
--- a/xinetd/util.h
|
|
+++ b/xinetd/util.h
|
|
@@ -4,6 +4,10 @@
|
|
#include "pset.h"
|
|
#include "defs.h"
|
|
|
|
+#ifndef FNDELAY
|
|
+#define FNDELAY O_NONBLOCK
|
|
+#endif
|
|
+
|
|
void out_of_memory(const char *func);
|
|
const struct name_value *nv_find_value(const struct name_value nv_array[],const char *name);
|
|
const struct name_value *nv_find_name(const struct name_value nv_array[],int value);
|
|
--
|
|
2.16.2
|
|
|
|
|
|
From 704349f11c61e50a55b5258b059fc9aad8e4b602 Mon Sep 17 00:00:00 2001
|
|
From: begasus <begasus@gmail.com>
|
|
Date: Sat, 28 Apr 2018 13:11:59 +0200
|
|
Subject: add a fix for CVE-2013-4342
|
|
|
|
|
|
diff --git a/xinetd/builtins.c b/xinetd/builtins.c
|
|
index 3b85579..34a5bac 100644
|
|
--- a/xinetd/builtins.c
|
|
+++ b/xinetd/builtins.c
|
|
@@ -617,7 +617,7 @@ static void tcpmux_handler( const struct server *serp )
|
|
if( SC_IS_INTERNAL( scp ) ) {
|
|
SC_INTERNAL(scp, nserp);
|
|
} else {
|
|
- exec_server(nserp);
|
|
+ child_process(nserp);
|
|
}
|
|
}
|
|
|
|
--
|
|
2.16.2
|
|
|