diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..f087b42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +*.tar.gz filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1534ba5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.rpm +*.log +*spec-20* diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..7aa8c35 --- /dev/null +++ b/Makefile @@ -0,0 +1,21 @@ +# Makefile for source rpm: ipsvd +# $Id: Makefile,v 1.1 2016/02/04 12:43:02 vip-ire Exp $ +NAME := ipsvd +SPECFILE = $(firstword $(wildcard *.spec)) + +define find-makefile-common +for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done +endef + +MAKEFILE_COMMON := $(shell $(find-makefile-common)) + +ifeq ($(MAKEFILE_COMMON),) +# attept a checkout +define checkout-makefile-common +test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 +endef + +MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) +endif + +include $(MAKEFILE_COMMON) diff --git a/README.md b/README.md index a1ac33a..abda9bb 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,11 @@ # ipsvd -3rd Party (Maintained by Koozali) git repo for ipsvd smeserver \ No newline at end of file +3rd Party (Maintained by Koozali) git repo for ipsvd smeserver + +## Description + +
*This description has been generated by an LLM AI system and cannot be relied on to be fully correct.* +*Once it has been checked, then this comment will be deleted* +
+ +ipsvd is a software package that provides Internet Protocol services such as TCP, UDP, and SCTP over IPv4 and IPv6. It also provides secure tunnels and provides a secure connection over which to send data. Additionally, it provides services such as logging, authentication, and virtual hosting. diff --git a/contriborbase b/contriborbase new file mode 100644 index 0000000..ef36a67 --- /dev/null +++ b/contriborbase @@ -0,0 +1 @@ +sme10 diff --git a/ipsvd-0.12.1.tar.gz b/ipsvd-0.12.1.tar.gz new file mode 100644 index 0000000..2611af7 --- /dev/null +++ b/ipsvd-0.12.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e97b2104ecea27797ae5ea02dfa2fee46f712512c9ab85eeee3eef98c140f8cf +size 76516 diff --git a/ipsvd.spec b/ipsvd.spec new file mode 100644 index 0000000..ac0795b --- /dev/null +++ b/ipsvd.spec @@ -0,0 +1,182 @@ +# $Id: ipsvd.spec,v 1.1 2016/02/04 12:43:02 vip-ire Exp $ + +Summary: internet protocol service daemons +Name: ipsvd +Version: 0.12.1 +Release: 7%{?dist} +License: BSD style +Group: System Enviornment/Daemons +Url: http://smarden.org/ipsvd/ +Source: %{name}-%{version}.tar.gz +Source1: matrixssl-1-8-3-open.tar.gz +Patch0: matrix.decode.debug.patch +Patch1: tcpsvd_keepalive.patch +BuildRequires: dietlibc +BuildRoot: %{_tmppath}/%{name}-root +%description + +ipsvd is a set of internet protocol service daemons. It currently includes +a TCP/IP service daemon, and a UDP/IP service daemon. + +An internet protocol service (ipsv) daemon waits for incoming +connections on a local socket. On incoming connections, the ipsv daemon +conditionally runs an arbitrary program with standard input reading from +the socket, and standard output writing to the socket, that handles the +connection. The network connection optionally can be encrypted using SSLv3. +Standard error is used for logging. + +ipsv daemons can be told to read and follow pre-defined instructions +on how to handle incoming connections. It's possible to run different +programs, or to set a different environment, or to deny a connection, +or to set a per host concurrency limit, depending on the client's address +or hostname. + +Normally the ipsv daemons are run by a supervisor process, such as runsv +from the runit package, or supervise from the daemontools package. + +ipsvd can be used to run services normally run by inetd, xinetd, or tcpserver. + +%changelog +* Fri Jul 14 2023 BogusDateBot +- Eliminated rpmbuild "bogus date" warnings due to inconsistent weekday, + by assuming the date is correct and changing the weekday. + +* Wed Apr 23 2014 Ian Wells 0.12.1-07.sme +- Modifed patch and spec file to avoid build errors [SME: 8084] + +* Wed Dec 25 2013 Charlie Brady 0.12.1-06 +- Add option to tcpsvd to set socket keepalive. Code provided by Chris Maltby. + [SME: 8084] + +* Sat Oct 6 2007 Charlie Brady 0.12.1-05 +- Remove extra debugging code. [SME: 3438] + +* Tue Oct 2 2007 Charlie Brady 0.12.1-04 +- Add more debugging of client hello parsing. [SME: 3438] + +* Fri Aug 17 2007 Charlie Brady 0.12.1-03 +- Send all debugging to stderr rather than stdout. +- Fix bug parsing SSL 3.0 client hello (if hello extensions are + included, as in Thunderbird 2). [SME: 3438] + +* Thu Aug 16 2007 Charlie Brady 0.12.1-02 +- Enable DEBUG during matrixssl build. + +* Sun Apr 29 2007 Shad L. Lords +- Clean up spec so package can be built by koji/plague + +* Thu Apr 12 2007 Charlie Brady 0.12.1-01 +- Update to latest upstream ipsvd. + +* Thu Mar 15 2007 Charlie Brady 0.12.0-04 +- Update to latest upstream matrixssl library. + +* Thu Dec 07 2006 Shad L. Lords +- Update to new release naming. No functional changes. +- Make Packager generic + +* Sat Feb 4 2006 Charlie Brady 0.12.0-02 +- Fix build error in Makefile. + +* Sat Feb 4 2006 Charlie Brady 0.12.0-01 +- Upgrade to new version. + +* Mon Nov 21 2005 Charlie Brady 0.11.1-03 +- Rebuild with new dietlibc (0.27-4). + +* Wed Nov 16 2005 Charlie Brady 0.11.1-02 +- Update to latest matrixssl. + +* Wed Nov 16 2005 Charlie Brady 0.11.1-01 +- Update to new ipsvd version. +- Remove matrixssl build issue patch. + +* Mon Oct 24 2005 Charlie Brady 0.11.0-04 +- Update to latest matrixssl. + +* Tue Jul 12 2005 Charlie Brady 0.11.0-03 +- Rebuild on CentOS 4.1 build server, to correct segfault problem. + +* Tue Mar 15 2005 Charlie Brady 0.11.0-02 +- Fix install of sslio + +* Wed Feb 23 2005 Charlie Brady 0.11.0-01 +- Upgrade to 0.11.0 +- Remove bogus dietlibc Requires: header (statically linked) + +* Sat Jan 15 2005 Charlie Brady 0.10.1-01 +- Upgrade to 0.10.1 +- Upgrade martixssl to 1.2.2. +- Don't bundle djbdns client library. + +* Mon Dec 20 2004 Charlie Brady 0.9.7-01 +- Upgrade to 0.9.7. + +* Thu Sep 30 2004 Charlie Brady 0.9.6-01 +- Upgrade to 0.9.6. +- Upgrade martixssl to 1.2. + +* Mon Jun 07 2004 Charlie Brady 0.9.3-01 +- Upgrade to 0.9.3. + +* Mon May 03 2004 Charlie Brady 0.9.1-01 +- Upgrade to 0.9.1. + +* Sun May 02 2004 Charlie Brady 0.9.0-01 +- Upgrade to 0.9.0 (now includes sslio). +- Build/link with dietlibc and matrixssl. + +* Tue Nov 04 2003 Charlie Brady 0.6.0-02 +- Build/link with uClibc. +- Add missing man(8) pages. + +* Thu Oct 16 2003 Charlie Brady 0.6.0-01 +- Upgrade to 0.6.0. + +* Tue Jul 22 2003 Charlie Brady 0.4.1-01 +- Initial + +%prep +%setup -c -n %{name}-%{version} +cp -v %{SOURCE1} net/%{name}-%{version}/src/matrixssl.tar.gz +mkdir -p net/%{name}-%{version}/compile +perl -p -i -e 's:CC=../../compile:CC=../../compile -DDEBUG:' \ + net/%{name}-%{version}/src/Makefile.matrixssl +ln -s matrixssl-1-8-3-open net/%{name}-%{version}/compile/matrixssl +%patch1 -p1 + +%build +cd net/%{name}-%{version} +echo 'diet -Os gcc -O2 -Wall' >src/conf-cc +echo 'diet -Os gcc -s -Os -pipe' >src/conf-ld +./package/compile +cd compile +#patch -p0 < %{PATCH0} +perl -p -i -e "s/printf.m/fprintf(stderr, m/" matrixssl/src/os/debug.c +perl -p -i -e "s/ssl.*TLS_MIN_VER .. c/c/" matrixssl/src/sslDecode.c +rm matrixssl.a sslio sslsvd +cd .. +./package/compile + +%install +cd net/%{name}-%{version} +mkdir -p $RPM_BUILD_ROOT/%{_bindir} +for i in $(cat package/commands compile/command.ssl) +do +install command/$i $RPM_BUILD_ROOT/%{_bindir} +done +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man1 +#install man/*.1 $RPM_BUILD_ROOT/%{_mandir}/man1 +mkdir -p $RPM_BUILD_ROOT/%{_mandir}/man8 +install man/*.8 $RPM_BUILD_ROOT/%{_mandir}/man8 + +%clean +rm -r $RPM_BUILD_ROOT + +%files +%defattr(-,root,root) +%{_bindir}/* +%{_mandir}/man8/* +#%{_mandir}/man1/* +%doc net/%{name}-%{version}/package/COPYING +%doc net/%{name}-%{version}/doc/* diff --git a/matrix.decode.debug.patch b/matrix.decode.debug.patch new file mode 100644 index 0000000..b3bcc44 --- /dev/null +++ b/matrix.decode.debug.patch @@ -0,0 +1,105 @@ +--- matrixssl/src/sslDecode.c.orig 2007-08-17 14:12:23.000000000 -0400 ++++ matrixssl/src/sslDecode.c 2007-08-17 15:56:46.000000000 -0400 +@@ -619,6 +619,8 @@ + First two bytes are the highest supported major and minor SSL versions + We support only 3.0 (support 3.1 in commercial version) + */ ++ matrixStrDebugMsg("c is %u\n", c); ++ matrixStrDebugMsg("end is %u\n", end); + if (end - c < 2) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixStrDebugMsg("Invalid ssl header version length\n", NULL); +@@ -626,6 +628,7 @@ + } + ssl->reqMajVer = *c; c++; + ssl->reqMinVer = *c; c++; ++ matrixStrDebugMsg("after version number c is %u\n", c); + if (ssl->reqMajVer >= SSL3_MAJ_VER) { + ssl->majVer = ssl->reqMajVer; + ssl->minVer = SSL3_MIN_VER; +@@ -651,7 +654,9 @@ + } + memcpy(ssl->sec.clientRandom, c, SSL_HS_RANDOM_SIZE); + c += SSL_HS_RANDOM_SIZE; ++ matrixStrDebugMsg("after random block c is %u\n", c); + ssl->sessionIdLen = *c; c++; ++ matrixStrDebugMsg("before session id c is %u\n", c); + /* + If a session length was specified, the client is asking to + resume a previously established session to speed up the handshake. +@@ -685,6 +690,7 @@ + */ + ssl->flags &= ~SSL_FLAGS_RESUMED; + } ++ matrixStrDebugMsg("after session id c is %u\n", c); + /* + Next is the two byte cipher suite list length, network byte order. + It must not be zero, and must be a multiple of two. +@@ -696,6 +702,7 @@ + } + suiteLen = *c << 8; c++; + suiteLen += *c; c++; ++ matrixStrDebugMsg("before cipher list c is %u\n", c); + if (suiteLen == 0 || suiteLen & 1) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixIntDebugMsg("Unable to parse cipher suite list: %d\n", +@@ -732,6 +739,7 @@ + } + } + } ++ matrixStrDebugMsg("after cipher suites c is %u\n", c); + /* + If we fell to the default cipher suite, we didn't have + any in common with the client, or the client is being bad +@@ -750,6 +758,7 @@ + and value 0 (second byte). There are no compression schemes defined + for SSLv3 + */ ++ matrixStrDebugMsg("before compression header length c is %u\n", c); + if (end - c < 1) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixStrDebugMsg("Invalid compression header length\n", NULL); +@@ -762,6 +771,7 @@ + return SSL_ERROR; + } + c += extLen; ++ matrixStrDebugMsg("after comps c is %u\n", c); + + if (ssl->reqMinVer == SSL3_MIN_VER && extLen != 1) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; +@@ -773,14 +783,17 @@ + to parse here: Two byte length and extension info. + http://www.faqs.org/rfcs/rfc3546.html + */ +- if (ssl->reqMinVer >= TLS_MIN_VER && c != end) { ++ /*if (ssl->reqMinVer >= TLS_MIN_VER && c != end) {*/ ++ if (c != end) { + if (end - c < 2) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixStrDebugMsg("Invalid extension header len\n", NULL); + return SSL_ERROR; + } ++ matrixStrDebugMsg("before extLen c is %u\n", c); + extLen = *c << 8; c++; + extLen += *c; c++; ++ matrixStrDebugMsg("before extensions c is %u\n", c); + if (end - c < extLen) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixStrDebugMsg("Invalid extension header len\n", NULL); +@@ -793,6 +806,7 @@ + just skip over all extensions, ignoring them. + */ + c += extLen; ++ matrixStrDebugMsg("after extensions c is %u\n", c); + } + } else { + /* +@@ -885,6 +899,8 @@ + if (c != end) { + ssl->err = SSL_ALERT_ILLEGAL_PARAMETER; + matrixStrDebugMsg("Invalid final client hello length\n", NULL); ++ matrixStrDebugMsg("parsed to %u\n", c); ++ matrixStrDebugMsg("end at %u\n", end); + return SSL_ERROR; + } + diff --git a/matrixssl-1-8-3-open.tar.gz b/matrixssl-1-8-3-open.tar.gz new file mode 100644 index 0000000..6e91dce --- /dev/null +++ b/matrixssl-1-8-3-open.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:af0992ff2a07896dfcd128a6fd2f6eb8e1b21bc7aa9a55b4cbdc0b0b2f44f818 +size 417545 diff --git a/tcpsvd_keepalive.patch b/tcpsvd_keepalive.patch new file mode 100644 index 0000000..c3c11fc --- /dev/null +++ b/tcpsvd_keepalive.patch @@ -0,0 +1,64 @@ +diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket_bind.c ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket_bind.c +--- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket_bind.c 2006-02-04 11:16:48.000000000 -0800 ++++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket_bind.c 2014-04-23 20:54:30.000000000 -0700 +@@ -32,2 +32,8 @@ + } + } ++ ++int socket_keepalive(int s) ++{ ++ int opt = 1; ++ return setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&opt,sizeof opt); ++} +diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket.h ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket.h +--- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/socket.h 2006-02-04 11:16:48.000000000 -0800 ++++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/socket.h 2014-04-23 20:54:30.000000000 -0700 +@@ -19,4 +19,5 @@ + + extern void socket_tryreservein(int,int); ++extern int socket_keepalive(int); + + #endif +diff -rN --unified=2 ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/tcpsvd.c ipsvd-0.12.1/net/ipsvd-0.12.1/src/tcpsvd.c +--- ipsvd-0.12.1.old/net/ipsvd-0.12.1/src/tcpsvd.c 2006-02-04 11:16:47.000000000 -0800 ++++ ipsvd-0.12.1/net/ipsvd-0.12.1/src/tcpsvd.c 2014-04-23 20:54:30.000000000 -0700 +@@ -33,7 +33,7 @@ + + #ifdef SSLSVD +-#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog" ++#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] [-U ssluser] [-/ root] [-Z cert] [-K key] host port prog" + #else +-#define USAGE " [-Ehpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog" ++#define USAGE " [-Ehkpv] [-u user] [-c n] [-C n:msg] [-b n] [-l name] [-i dir|-x cdb] [-t sec] host port prog" + #endif + +@@ -55,4 +55,5 @@ + unsigned long cmax =30; + unsigned long timeout =0; ++unsigned int keepalive =0; + + unsigned int ucspi =1; +@@ -242,4 +243,6 @@ + if ((fd_move(0, c) == -1) || (fd_copy(1, 0) == -1)) + drop("unable to set filedescriptor"); ++ if (keepalive) ++ socket_keepalive(0); + sig_uncatch(sig_term); + sig_uncatch(sig_pipe); +@@ -272,8 +275,8 @@ + #ifdef SSLSVD + while ((opt =getopt(argc, (const char **)argv, +- "c:C:i:x:u:l:Eb:hpt:vVU:/:Z:K:")) != opteof) { ++ "c:C:i:x:u:l:Eb:hkpt:vVU:/:Z:K:")) != opteof) { + #else + while ((opt =getopt(argc, (const char **)argv, +- "c:C:i:x:u:l:Eb:hpt:vV")) != opteof) { ++ "c:C:i:x:u:l:Eb:hpkt:vV")) != opteof) { + #endif + switch(opt) { +@@ -298,4 +301,5 @@ + case 'b': scan_ulong(optarg, &backlog); break; + case 'h': lookuphost =1; break; ++ case 'k': keepalive =1; break; + case 'p': lookuphost =1; paranoid =1; break; + case 't': scan_ulong(optarg, &timeout); break;