icecast, fix running as root, move PATCH and libnetwork check to configure.in, remove secondary architecture (#4479)

This commit is contained in:
Schrijvers Luc
2019-12-23 11:06:12 +01:00
committed by GitHub
parent 11342c5b91
commit 57b0a0188f
2 changed files with 87 additions and 38 deletions

View File

@@ -24,64 +24,58 @@ if [ "$effectiveTargetArchitecture" = x86_gcc2 ]; then
icecast-$portVersion-gcc2.patchset"
fi
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
ARCHITECTURES="x86_gcc2 x86_64"
GLOBAL_WRITABLE_FILES="settings/icecast.xml keep-old"
PROVIDES="
icecast$secondaryArchSuffix = $portVersion
cmd:icecast$secondaryArchSuffix = $portVersion
icecast = $portVersion
cmd:icecast = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libnghttp2$secondaryArchSuffix
lib:libogg$secondaryArchSuffix
lib:libspeex$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
lib:libtheora$secondaryArchSuffix
lib:libvorbis$secondaryArchSuffix
lib:libxml2$secondaryArchSuffix
lib:libxslt$secondaryArchSuffix
lib:libz$secondaryArchSuffix
haiku
lib:libcurl
lib:libnghttp2
lib:libogg
lib:libspeex
lib:libssl
lib:libtheora
lib:libvorbis
lib:libxml2
lib:libxslt
lib:libz
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcurl$secondaryArchSuffix
devel:libnghttp2$secondaryArchSuffix
devel:libogg$secondaryArchSuffix
devel:libspeex$secondaryArchSuffix
devel:libssl$secondaryArchSuffix
devel:libtheora$secondaryArchSuffix
devel:libvorbis$secondaryArchSuffix
devel:libxml2$secondaryArchSuffix
devel:libxslt$secondaryArchSuffix
devel:libz$secondaryArchSuffix
haiku_devel
devel:libcurl
devel:libnghttp2
devel:libogg
devel:libspeex
devel:libssl
devel:libtheora
devel:libvorbis
devel:libxml2
devel:libxslt
devel:libz
"
BUILD_PREREQUIRES="
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:gcc
cmd:ld
cmd:libtoolize
cmd:make
cmd:pkg_config$secondaryArchSuffix
cmd:pkg_config
"
defineDebugInfoPackage icecast$secondaryArchSuffix \
defineDebugInfoPackage icecast \
$binDir/icecast
PATCH()
{
echo "AC_CONFIG_MACRO_DIRS([m4])" >> configure.in
}
BUILD()
{
export LIBS="-lnetwork"
autoreconf -vfi
runConfigure ./configure
make $jobArgs

View File

@@ -1,4 +1,4 @@
From 2f182b416478c3a52e6d6e45068c7b2b05b06f42 Mon Sep 17 00:00:00 2001
From 2f66cb8628a94872f61b517e8aa525b651764941 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Tue, 18 Dec 2018 14:36:17 +0100
Subject: comment out pthread_attr_setinheritsched
@@ -18,5 +18,60 @@ index e842448..ebc786c 100644
{
pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
--
2.19.1
2.24.1
From cd0cb2c73334148521847026436a2aa1797559bb Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 23 Dec 2019 09:52:32 +0100
Subject: Move PATCH and libnetwork check to configure.in
diff --git a/configure.in b/configure.in
index a3f5315..070300b 100644
--- a/configure.in
+++ b/configure.in
@@ -6,6 +6,7 @@ dnl Process this file with autoconf to produce a configure script.
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER(config.h)
+AC_CONFIG_MACRO_DIRS([m4])
AM_MAINTAINER_MODE
AC_PROG_CC
@@ -13,6 +14,9 @@ AC_CANONICAL_HOST
AC_PROG_LIBTOOL
AC_SYS_LARGEFILE
+dnl Add search for Haiku's libnetwork
+AC_CHECK_LIB(network, socket, [LIBS="$LIBS -lnetwork"])
+
dnl Set some options based on environment
DEBUG="-g"
--
2.24.1
From c63e6efc3682ff8a375cda49b59e7504e89d7ead Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Mon, 23 Dec 2019 09:53:57 +0100
Subject: Disable: don't run as root
diff --git a/src/main.c b/src/main.c
index 4844415..679b58c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -501,7 +501,7 @@ int main(int argc, char **argv)
stats_initialize(); /* We have to do this later on because of threading */
fserve_initialize(); /* This too */
-#ifdef HAVE_SETUID
+#if defined(HAVE_SETUID) && !defined(__HAIKU__)
/* We'll only have getuid() if we also have setuid(), it's reasonable to
* assume */
if(!getuid()) /* Running as root! Don't allow this */
--
2.24.1