From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../peercast/files/peercast-0.1216-amd64.patch | 13 +++ .../peercast/files/peercast-0.1216-makefile.patch | 26 +++++ .../files/peercast-0.1218-CVE-2008-2040.patch | 122 +++++++++++++++++++++ .../files/peercast-0.1218-glibc-2.10.patch | 109 ++++++++++++++++++ media-sound/peercast/files/peercast.initd | 27 +++++ 5 files changed, 297 insertions(+) create mode 100644 media-sound/peercast/files/peercast-0.1216-amd64.patch create mode 100644 media-sound/peercast/files/peercast-0.1216-makefile.patch create mode 100644 media-sound/peercast/files/peercast-0.1218-CVE-2008-2040.patch create mode 100644 media-sound/peercast/files/peercast-0.1218-glibc-2.10.patch create mode 100644 media-sound/peercast/files/peercast.initd (limited to 'media-sound/peercast/files') diff --git a/media-sound/peercast/files/peercast-0.1216-amd64.patch b/media-sound/peercast/files/peercast-0.1216-amd64.patch new file mode 100644 index 000000000000..95144730d580 --- /dev/null +++ b/media-sound/peercast/files/peercast-0.1216-amd64.patch @@ -0,0 +1,13 @@ +Index: work/core/common/sys.h +=================================================================== +--- work.orig/core/common/sys.h ++++ work/core/common/sys.h +@@ -322,7 +322,7 @@ public: + #define _BIG_ENDIAN 1 + #endif + +-typedef long long int64_t; ++#include + + typedef int (*THREAD_FUNC)(ThreadInfo *); + #define THREAD_PROC int diff --git a/media-sound/peercast/files/peercast-0.1216-makefile.patch b/media-sound/peercast/files/peercast-0.1216-makefile.patch new file mode 100644 index 000000000000..e54c4ae622de --- /dev/null +++ b/media-sound/peercast/files/peercast-0.1216-makefile.patch @@ -0,0 +1,26 @@ +Index: work/ui/linux/makefile +=================================================================== +--- work.orig/ui/linux/makefile ++++ work/ui/linux/makefile +@@ -79,10 +79,10 @@ clean: + rm -f $(LINUXOBJ) $(COREOBJ) $(TARGET) ${LIBOBJSTATIC} ${LIBOBJSHARED} $(COREOBJSTATIC) + + %.o: %.cpp +- $(CC) $(INCLUDES) $(CPPFLAGS) -fPIC -c $< -o $@ ++ $(CC) $(CXXFLAGS) $(INCLUDES) $(CPPFLAGS) -fPIC -c $< -o $@ + + %.a: %.cpp +- $(CC) $(INCLUDES) $(CPPFLAGS) -c $< -o $@ ++ $(CC) $(CXXFLAGS) $(INCLUDES) $(CPPFLAGS) -c $< -o $@ + + DEPENDFILE = makedepend + +@@ -92,7 +92,7 @@ depend: + $(CC) $(INCLUDES) $(CPPFLAGS) -MD $(CORESOURCE) $(LINUXSOURCE) >> $(DEPENDFILE) + + peercast-so: $(COREOBJSTATIC) $(COREOBJ) $(LINUXOBJ) +- $(LD) $(LDSOFLAGS),$(LIBSONAME) -o ${LIBOBJSHARED} $(COREOBJ) -lc ++ $(LD) $(LDFLAGS) $(LDSOFLAGS),$(LIBSONAME) -o ${LIBOBJSHARED} $(COREOBJ) -lc + $(LD) $(LDFLAGS) -o $@ $(LINUXOBJ) $(LIBOBJSHARED) -ldl + ${AR} rcs $(LIBOBJSTATIC) $(COREOBJSTATIC) + diff --git a/media-sound/peercast/files/peercast-0.1218-CVE-2008-2040.patch b/media-sound/peercast/files/peercast-0.1218-CVE-2008-2040.patch new file mode 100644 index 000000000000..23037ac82b74 --- /dev/null +++ b/media-sound/peercast/files/peercast-0.1218-CVE-2008-2040.patch @@ -0,0 +1,122 @@ +diff -Nurad peercast-0.1218+svn20080104/core/common/channel.cpp peercast-0.1218+svn20080104.new/core/common/channel.cpp +--- peercast-0.1218+svn20080104/core/common/channel.cpp 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/channel.cpp 2008-04-30 17:45:28.000000000 +0200 +@@ -440,7 +440,7 @@ + if (http.isHeader(PCX_HS_POS)) + streamPos = atoi(arg); + else +- Servent::readICYHeader(http, info, NULL); ++ Servent::readICYHeader(http, info, NULL, 0); + + LOG_CHANNEL("Channel fetch: %s",http.cmdLine); + } +diff -Nurad peercast-0.1218+svn20080104/core/common/http.cpp peercast-0.1218+svn20080104.new/core/common/http.cpp +--- peercast-0.1218+svn20080104/core/common/http.cpp 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/http.cpp 2008-04-30 17:45:28.000000000 +0200 +@@ -102,7 +102,7 @@ + return 0; + } + //----------------------------------------- +-void HTTP::getAuthUserPass(char *user, char *pass) ++void HTTP::getAuthUserPass(char *user, char *pass, size_t ulen, size_t plen) + { + if (arg) + { +@@ -119,10 +119,14 @@ + if (s) + { + *s = 0; +- if (user) +- strcpy(user,str.cstr()); +- if (pass) +- strcpy(pass,s+1); ++ if (user){ ++ strncpy(user,str.cstr(), ulen); ++ user[ulen - 1] = 0; ++ } ++ if (pass){ ++ strncpy(pass,s+1, plen); ++ pass[plen - 1] = 0; ++ } + } + } + } +diff -Nurad peercast-0.1218+svn20080104/core/common/http.h peercast-0.1218+svn20080104.new/core/common/http.h +--- peercast-0.1218+svn20080104/core/common/http.h 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/http.h 2008-04-30 17:45:28.000000000 +0200 +@@ -176,7 +176,7 @@ + char *getArgStr(); + int getArgInt(); + +- void getAuthUserPass(char *, char *); ++ void getAuthUserPass(char *, char *, size_t, size_t); + + char cmdLine[8192],*arg; + +diff -Nurad peercast-0.1218+svn20080104/core/common/servent.h peercast-0.1218+svn20080104.new/core/common/servent.h +--- peercast-0.1218+svn20080104/core/common/servent.h 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/servent.h 2008-04-30 17:45:28.000000000 +0200 +@@ -206,7 +206,7 @@ + void sendPCPChannel(); + void checkPCPComms(Channel *, AtomStream &); + +- static void readICYHeader(HTTP &, ChanInfo &, char *); ++ static void readICYHeader(HTTP &, ChanInfo &, char *, size_t); + bool canStream(Channel *); + + bool isConnected() {return status == S_CONNECTED;} +diff -Nurad peercast-0.1218+svn20080104/core/common/servhs.cpp peercast-0.1218+svn20080104.new/core/common/servhs.cpp +--- peercast-0.1218+svn20080104/core/common/servhs.cpp 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/servhs.cpp 2008-04-30 17:45:28.000000000 +0200 +@@ -587,7 +587,7 @@ + { + case ServMgr::AUTH_HTTPBASIC: + if (http.isHeader("Authorization")) +- http.getAuthUserPass(user,pass); ++ http.getAuthUserPass(user,pass, sizeof(user), sizeof(pass)); + break; + case ServMgr::AUTH_COOKIE: + if (http.isHeader("Cookie")) +@@ -1405,7 +1405,7 @@ + + } + // ----------------------------------- +-void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd) ++void Servent::readICYHeader(HTTP &http, ChanInfo &info, char *pwd, size_t plen) + { + char *arg = http.getArgStr(); + if (!arg) return; +@@ -1429,8 +1429,10 @@ + info.desc.set(arg,String::T_ASCII); + info.desc.convertTo(String::T_UNICODE); + +- }else if (http.isHeader("Authorization")) +- http.getAuthUserPass(NULL,pwd); ++ }else if (http.isHeader("Authorization")){ ++ if(pwd) ++ http.getAuthUserPass(NULL,pwd, 0, plen); ++ } + else if (http.isHeader(PCX_HS_CHANNELID)) + info.id.fromStr(arg); + else if (http.isHeader("ice-password")) +@@ -1501,7 +1503,7 @@ + while (http.nextHeader()) + { + LOG_DEBUG("ICY %s",http.cmdLine); +- readICYHeader(http,info,loginPassword.cstr()); ++ readICYHeader(http,info,loginPassword.cstr(), String::MAX_LEN); + } + + +diff -Nurad peercast-0.1218+svn20080104/core/common/url.cpp peercast-0.1218+svn20080104.new/core/common/url.cpp +--- peercast-0.1218+svn20080104/core/common/url.cpp 2008-04-01 13:59:52.000000000 +0200 ++++ peercast-0.1218+svn20080104.new/core/common/url.cpp 2008-04-30 17:45:28.000000000 +0200 +@@ -171,7 +171,7 @@ + LOG_CHANNEL("Fetch HTTP: %s",http.cmdLine); + + ChanInfo tmpInfo = ch->info; +- Servent::readICYHeader(http,ch->info,NULL); ++ Servent::readICYHeader(http,ch->info,NULL, 0); + + if (!tmpInfo.name.isEmpty()) + ch->info.name = tmpInfo.name; diff --git a/media-sound/peercast/files/peercast-0.1218-glibc-2.10.patch b/media-sound/peercast/files/peercast-0.1218-glibc-2.10.patch new file mode 100644 index 000000000000..3f290578dd50 --- /dev/null +++ b/media-sound/peercast/files/peercast-0.1218-glibc-2.10.patch @@ -0,0 +1,109 @@ +Index: work/core/common/common.h +=================================================================== +--- work.orig/core/common/common.h ++++ work/core/common/common.h +@@ -274,7 +274,7 @@ inline int strToID(char *str) + } + + // ----------------------------------- +-char *getCGIarg(const char *str, const char *arg); ++const char *getCGIarg(const char *str, const char *arg); + bool cmpCGIarg(char *str, char *arg, char *value); + bool hasCGIarg(char *str, char *arg); + +Index: work/core/common/html.cpp +=================================================================== +--- work.orig/core/common/html.cpp ++++ work/core/common/html.cpp +@@ -103,7 +103,7 @@ void HTML::writeVariable(Stream &s,const + r = true; + }else if (varName.startsWith("loop.hit.")) + { +- char *idstr = getCGIarg(tmplArgs,"id="); ++ const char *idstr = getCGIarg(tmplArgs,"id="); + if (idstr) + { + GnuID id; +@@ -136,7 +136,7 @@ void HTML::writeVariable(Stream &s,const + { + if (varName.startsWith("page.channel.")) + { +- char *idstr = getCGIarg(tmplArgs,"id="); ++ const char *idstr = getCGIarg(tmplArgs,"id="); + if (idstr) + { + GnuID id; +@@ -150,7 +150,7 @@ void HTML::writeVariable(Stream &s,const + + String v = varName+5; + v.append('='); +- char *a = getCGIarg(tmplArgs,v); ++ const char *a = getCGIarg(tmplArgs,v); + if (a) + { + s.writeString(a); +Index: work/core/common/sys.cpp +=================================================================== +--- work.orig/core/common/sys.cpp ++++ work/core/common/sys.cpp +@@ -740,12 +740,12 @@ void LogBuffer::write(const char *str, T + } + + // ----------------------------------- +-char *getCGIarg(const char *str, const char *arg) ++const char *getCGIarg(const char *str, const char *arg) + { + if (!str) + return NULL; + +- char *s = strstr(str,arg); ++ const char *s = strstr(str,arg); + + if (!s) + return NULL; +Index: work/core/common/servhs.cpp +=================================================================== +--- work.orig/core/common/servhs.cpp ++++ work/core/common/servhs.cpp +@@ -150,10 +150,10 @@ void Servent::handshakeHTTP(HTTP &http, + if (!isAllowed(ALLOW_BROADCAST)) + throw HTTPException(HTTP_SC_UNAVAILABLE,503); + +- char *pwdArg = getCGIarg(fn,"pass="); +- char *songArg = getCGIarg(fn,"song="); +- char *mountArg = getCGIarg(fn,"mount="); +- char *urlArg = getCGIarg(fn,"url="); ++ const char *pwdArg = getCGIarg(fn,"pass="); ++ const char *songArg = getCGIarg(fn,"song="); ++ const char *mountArg = getCGIarg(fn,"mount="); ++ const char *urlArg = getCGIarg(fn,"url="); + + if (pwdArg && songArg) + { +@@ -560,7 +560,7 @@ bool Servent::handshakeAuth(HTTP &http,c + char user[64],pass[64]; + user[0] = pass[0] = 0; + +- char *pwd = getCGIarg(args, "pass="); ++ const char *pwd = getCGIarg(args, "pass="); + + if ((pwd) && strlen(servMgr->password)) + { +@@ -671,7 +671,7 @@ void Servent::handshakeCMD(char *cmd) + { + if (cmpCGIarg(cmd,"cmd=","redirect")) + { +- char *j = getCGIarg(cmd,"url="); ++ const char *j = getCGIarg(cmd,"url="); + if (j) + { + termArgs(cmd); +@@ -1079,7 +1079,7 @@ void Servent::handshakeCMD(char *cmd) + index++; + } + +- char *findArg = getCGIarg(cmd,"keywords="); ++ const char *findArg = getCGIarg(cmd,"keywords="); + + if (hasCGIarg(cmd,"relay")) + { diff --git a/media-sound/peercast/files/peercast.initd b/media-sound/peercast/files/peercast.initd new file mode 100644 index 000000000000..9739b4a31381 --- /dev/null +++ b/media-sound/peercast/files/peercast.initd @@ -0,0 +1,27 @@ +#!/sbin/openrc-run +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +pidfile=/var/run/peercast.pid + +depend() { + need net +} + +start() { + ebegin "Starting peercast daemon" + start-stop-daemon --start --quiet --background \ + --make-pidfile --pidfile ${pidfile} \ + --chuid nobody:audio \ + --exec /usr/sbin/peercast -- \ + -i /usr/share/peercast/peercast.ini \ + -l /var/log/peercast.log \ + -P /usr/share/peercast + eend $? +} + +stop() { + ebegin "Stopping peercast daemon" + start-stop-daemon --stop --quiet --pidfile ${pidfile} + eend $? +} -- cgit v1.2.3