From af925eca6d8e424264b2f13da2b490ef259621e4 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Tue, 6 May 2025 21:53:19 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=BD=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=81=D0=B1=D0=BE=D1=80=D0=BA=D0=B8=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=81=D0=B8=D0=B8=202.0.0=20=D0=98=D1=81=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=BD=D1=8B=D0=B9=20=D0=BA=D0=BE=D0=B4=20=D0=B2?= =?UTF-8?q?=D0=B7=D1=8F=D1=82=20=D1=81=20GitHub=20=D1=81=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=81=D0=BB=D0=B5=D0=B4=D0=BD=D0=B8=D0=BC=D0=B8=20=D0=B0=D0=BA?= =?UTF-8?q?=D1=82=D1=83=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B=D0=BC=D0=B8=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BC=D0=BC=D0=B8=D1=82=D0=B0=D0=BC=D0=B8.=20=D0=94?= =?UTF-8?q?=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D1=80=D1=83?= =?UTF-8?q?=D1=81=D1=81=D0=BA=D0=BE=D1=8F=D0=B7=D1=8B=D1=87=D0=BD=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=B0?= =?UTF-8?q?=D1=86=D0=B8=D1=8F.=20=D0=9F=D1=83=D1=82=D0=B8=20=D0=BA=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D1=83=D1=80=D0=B0=D1=86?= =?UTF-8?q?=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=BC=20=D1=84=D0=B0=D0=B9=D0=BB?= =?UTF-8?q?=D0=B0=D0=BC=20=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D1=8B=20=D0=BF?= =?UTF-8?q?=D0=BE=20=D1=83=D0=BC=D0=BE=D0=BB=D1=87=D0=B0=D0=BD=D0=B8=D1=8E?= =?UTF-8?q?=20=D0=B2=20/usr/share/defaults/etc/openslp,=20=D0=BD=D0=BE=20?= =?UTF-8?q?=D0=BC=D0=BE=D0=B3=D1=83=D1=82=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BE?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D1=8F=D1=82=D1=8C=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20/etc/openslp.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../0001-openslp-2.0.0-multicast-set.patch} | 6 +- ...slp-2.0.0-notify-systemd-of-start-up.patch | 32 +++++ .../0003-openslp-2.0.0-cve-2019-5544.patch} | 27 ++-- files/man/en/slpd.8 | 42 +++++++ files/man/en/slptool.1 | 63 ++++++++++ files/man/ru/slpd.8 | 42 +++++++ files/man/ru/slptool.1 | 63 ++++++++++ files/openslp-2.0.0-cve-2016-7567.patch | 90 -------------- files/openslp-2.0.0-cve-2017-17833.patch | 19 --- ...slp-2.0.0-notify-systemd-of-start-up.patch | 39 ------ files/openslp-2.0.0-null-pointer-deref.patch | 12 -- files/openslp-2.0.0-openssl-1.1-fix.patch | 28 ----- files/openslp.service | 2 +- files/series | 4 + files/slpd.8.gz | Bin 432 -> 0 bytes files/slptool.1.gz | Bin 577 -> 0 bytes files/solus_patches/0004-stateless.patch | 115 ++++++++++++++++++ package.yml | 42 +++++-- 18 files changed, 413 insertions(+), 213 deletions(-) rename files/{openslp-2.0.0-multicast-set.patch => default_patches/0001-openslp-2.0.0-multicast-set.patch} (94%) create mode 100644 files/default_patches/0002-openslp-2.0.0-notify-systemd-of-start-up.patch rename files/{openslp-2.0.0-cve-2019-5544.patch => default_patches/0003-openslp-2.0.0-cve-2019-5544.patch} (87%) create mode 100644 files/man/en/slpd.8 create mode 100644 files/man/en/slptool.1 create mode 100644 files/man/ru/slpd.8 create mode 100644 files/man/ru/slptool.1 delete mode 100644 files/openslp-2.0.0-cve-2016-7567.patch delete mode 100644 files/openslp-2.0.0-cve-2017-17833.patch delete mode 100644 files/openslp-2.0.0-notify-systemd-of-start-up.patch delete mode 100644 files/openslp-2.0.0-null-pointer-deref.patch delete mode 100644 files/openslp-2.0.0-openssl-1.1-fix.patch create mode 100644 files/series delete mode 100644 files/slpd.8.gz delete mode 100644 files/slptool.1.gz create mode 100644 files/solus_patches/0004-stateless.patch diff --git a/files/openslp-2.0.0-multicast-set.patch b/files/default_patches/0001-openslp-2.0.0-multicast-set.patch similarity index 94% rename from files/openslp-2.0.0-multicast-set.patch rename to files/default_patches/0001-openslp-2.0.0-multicast-set.patch index 4bd1a07..b028b46 100644 --- a/files/openslp-2.0.0-multicast-set.patch +++ b/files/default_patches/0001-openslp-2.0.0-multicast-set.patch @@ -1,6 +1,6 @@ -diff -up openslp-2.0.0/etc/slpd.all_init.orig openslp-2.0.0/etc/slpd.all_init ---- openslp-2.0.0/etc/slpd.all_init.orig 2012-11-28 18:07:04.000000000 +0100 -+++ openslp-2.0.0/etc/slpd.all_init 2017-10-04 12:50:36.672953246 +0200 +diff -up a/etc/slpd.all_init.orig b/etc/slpd.all_init +--- a/etc/slpd.all_init.orig 2012-11-28 18:07:04.000000000 +0100 ++++ b/etc/slpd.all_init 2017-10-04 12:50:36.672953246 +0200 @@ -1,28 +1,5 @@ #!/bin/bash -# diff --git a/files/default_patches/0002-openslp-2.0.0-notify-systemd-of-start-up.patch b/files/default_patches/0002-openslp-2.0.0-notify-systemd-of-start-up.patch new file mode 100644 index 0000000..b440492 --- /dev/null +++ b/files/default_patches/0002-openslp-2.0.0-notify-systemd-of-start-up.patch @@ -0,0 +1,32 @@ +diff --git a/slpd/Makefile.am b/slpd/Makefile.am +index c94dd6a..ca0f702 100644 +--- a/slpd/Makefile.am ++++ b/slpd/Makefile.am +@@ -93,5 +93,5 @@ noinst_HEADERS = \ + slpd_index.h + + #if you're building on Irix, replace .la with .a below +-slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la ++slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la -lsystemd + +diff --git a/slpd/slpd_main.c b/slpd/slpd_main.c +index 130497e..6359c4b 100644 +--- a/slpd/slpd_main.c ++++ b/slpd/slpd_main.c +@@ -58,6 +58,8 @@ + #include "slp_xid.h" + #include "slp_net.h" + ++#include ++ + int G_SIGALRM; + int G_SIGTERM; + int G_SIGHUP; +@@ -668,6 +670,7 @@ int main(int argc, char * argv[]) + + /* Main loop */ + SLPDLog("Startup complete entering main run loop ...\n\n"); ++ sd_notify(0, "READY=1"); + G_SIGALRM = 0; + G_SIGTERM = 0; + G_SIGHUP = 0; diff --git a/files/openslp-2.0.0-cve-2019-5544.patch b/files/default_patches/0003-openslp-2.0.0-cve-2019-5544.patch similarity index 87% rename from files/openslp-2.0.0-cve-2019-5544.patch rename to files/default_patches/0003-openslp-2.0.0-cve-2019-5544.patch index d5268ef..d2921b2 100644 --- a/files/openslp-2.0.0-cve-2019-5544.patch +++ b/files/default_patches/0003-openslp-2.0.0-cve-2019-5544.patch @@ -1,6 +1,6 @@ -diff -up openslp-2.0.0/common/slp_buffer.c.orig openslp-2.0.0/common/slp_buffer.c ---- openslp-2.0.0/common/slp_buffer.c.orig 2012-12-11 00:31:53.000000000 +0100 -+++ openslp-2.0.0/common/slp_buffer.c 2019-12-09 10:39:16.422058793 +0100 +diff -up a/common/slp_buffer.c.orig b/common/slp_buffer.c +--- a/common/slp_buffer.c.orig 2012-12-11 00:31:53.000000000 +0100 ++++ b/common/slp_buffer.c 2019-12-09 10:39:16.422058793 +0100 @@ -30,6 +30,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *-------------------------------------------------------------------------*/ @@ -36,9 +36,9 @@ diff -up openslp-2.0.0/common/slp_buffer.c.orig openslp-2.0.0/common/slp_buffer. +} + /*=========================================================================*/ -diff -up openslp-2.0.0/common/slp_buffer.h.orig openslp-2.0.0/common/slp_buffer.h ---- openslp-2.0.0/common/slp_buffer.h.orig 2012-11-28 18:07:04.000000000 +0100 -+++ openslp-2.0.0/common/slp_buffer.h 2019-12-09 10:39:16.422058793 +0100 +diff -up a/common/slp_buffer.h.orig b/common/slp_buffer.h +--- a/common/slp_buffer.h.orig 2012-11-28 18:07:04.000000000 +0100 ++++ b/common/slp_buffer.h 2019-12-09 10:39:16.422058793 +0100 @@ -30,6 +30,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *-------------------------------------------------------------------------*/ @@ -62,9 +62,10 @@ diff -up openslp-2.0.0/common/slp_buffer.h.orig openslp-2.0.0/common/slp_buffer. /*! @} */ #endif /* SLP_BUFFER_H_INCLUDED */ -diff -up openslp-2.0.0/slpd/slpd_process.c.orig openslp-2.0.0/slpd/slpd_process.c ---- openslp-2.0.0/slpd/slpd_process.c.orig 2019-12-09 10:39:16.420058789 +0100 -+++ openslp-2.0.0/slpd/slpd_process.c 2019-12-09 10:39:16.422058793 +0100 +diff --git a/slpd/slpd_process.c b/slpd/slpd_process.c +index 0698ab8..935f6c9 100644 +--- a/slpd/slpd_process.c ++++ b/slpd/slpd_process.c @@ -30,6 +30,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *-------------------------------------------------------------------------*/ @@ -142,11 +143,17 @@ diff -up openslp-2.0.0/slpd/slpd_process.c.orig openslp-2.0.0/slpd/slpd_process. /* url-entry auths */ *result->curpos++ = 0; -@@ -630,8 +661,18 @@ RESPOND: +@@ -628,14 +659,18 @@ RESPOND: /* TRICKY: Fix up the lifetime. */ TO_UINT16(urlentry->opaque + 1, urlentry->lifetime); - memcpy(result->curpos, urlentry->opaque, urlentry->opaquelen); +- +- /* TRICKY: Fix up the result authblock count. */ +- if (urlentry->authcount) +- result->curpos[1 + 2 + 2 + urlentry->urllen] = (uint8_t)urlentry->authcount; +- /* 1 reserved + 2 lifetime + 2 url length */ +- - result->curpos += urlentry->opaquelen; + if (RemainingBufferSpace(result) >= urlentry->opaquelen) + { diff --git a/files/man/en/slpd.8 b/files/man/en/slpd.8 new file mode 100644 index 0000000..28bd21b --- /dev/null +++ b/files/man/en/slpd.8 @@ -0,0 +1,42 @@ +.TH SLPD "8" "March 2025" "slpd 2.0.0" "System Administration Utilities" +.SH NAME +slpd \- SLP daemon +.SH SYNOPSIS +.B slpd +[\-d] [\-c configfile] [\-l logfile] [\-r registrationfile] [\-s spifile] [\-p pidfile] [\-v version] +.SH OPTIONS +.IP +.TP +.BI \-d\fR +Don't detach from the controlling tty. +.TP +.BI \-c\ configfile \fR +Use +.IR configfile +as the file slpd reads to obtain configuration information, rather than the default, +.IR /usr/share/defaults/etc/openslp/slp.conf +or +.IR /etc/openslp/slp.conf . +.TP +.BI \-l\ logfile \fR +Use +.IR logfile +as the file that slpd reads to write log messages, rather than the default, +.IR /var/log/slpd.log . +.TP +.BI \-l\ registrationfile \fR +Use +.IR registrationfile +as the file that slpd reads to obtain static registrations, rather than the default, +.IR /usr/share/defaults/etc/openslp/slp.reg +or +.IR /etc/openslp/slp.reg . +.TP +.BI \-l\ pidfile \fR +Use +.IR pidfile +as the file that holds the slpd process id, rather than the default, +.IR /var/run/slpd.pid . +.TP +.BI \-v\fR +Show slpd version and compile options. diff --git a/files/man/en/slptool.1 b/files/man/en/slptool.1 new file mode 100644 index 0000000..72cf83f --- /dev/null +++ b/files/man/en/slptool.1 @@ -0,0 +1,63 @@ +.TH SLPTOOL "1" "May 2013" "slptool 2.0.beta2" "User Commands" +.SH NAME +slptool \- SLP command line tool +.SH SYNOPSIS +.B slptool +[\fIoptions\fR] \fIcommand-and-arguments\fR +.SH OPTIONS +.IP +options may be: +.HP +\fB\-v\fR (or \fB\-\-version\fR) displays the versions of slptool and OpenSLP. +.HP +\fB\-s\fR (or \fB\-\-scope\fR) followed by a comma\-separated list of scopes. +.HP +\fB\-l\fR (or \fB\-\-language\fR) followed by a language tag. +.HP +\fB\-t\fR (or \fB\-\-time\fR) followed by a lifetime tag. +.HP +\fB\-i\fR (or \fB\-\-interfaces\fR) followed by a comma\-separated list of interfaces. +.HP +\fB\-u\fR (or \fB\-\-unicastifc\fR) followed by a single interface. +.IP +command\-and\-arguments may be: +.IP +.HP +findsrvs service\-type [filter] +.HP +findattrs url [attrids] +.HP +findsrvtypes [authority] +.HP +findscopes +.HP +register url [attrs] +.HP +deregister url +.HP +getproperty propertyname +.SH EXAMPLES +.IP +.HP +slptool register service:myserv.x://myhost.com "(attr1=val1),(attr2=val2)" +.HP +slptool findsrvs service:myserv.x +.HP +slptool findsrvs service:myserv.x "(attr1=val1)" +.HP +slptool \fB\-i\fR 10.77.13.240,192.168.250.240 findsrvs service:myserv.x +.HP +slptool \fB\-u\fR 10.77.13.237 findsrvs service:myserv.x "(attr1=val1)" +.HP +slptool findattrs service:myserv.x://myhost.com +.HP +slptool findattrs service:myserv.x://myhost.com attr1 +.HP +slptool \fB\-i\fR 10.77.13.243 findattrs service:myserv.x://myhost.com attr1 +.HP +slptool \fB\-u\fR 10.77.13.237 findattrs service:myserv.x://myhost.com attr1 +.HP +slptool deregister service:myserv.x://myhost.com +.HP +slptool getproperty net.slp.useScopes +.PP diff --git a/files/man/ru/slpd.8 b/files/man/ru/slpd.8 new file mode 100644 index 0000000..664219d --- /dev/null +++ b/files/man/ru/slpd.8 @@ -0,0 +1,42 @@ +.TH SLPD "8" "Май 2025" "slpd 2.0" "Утилиты системного администрирования" +.SH ИМЯ +slpd \- демон SLP +.SH СИНТАКСИС +.B slpd +[\-d] [\-c файл_конфигурации] [\-l файл_журнала] [\-r файл_регистрации] [\-s файл_spi] [\-p файл_pid] [\-v версия] +.SH ОПЦИИ +.IP +.TP +.BI \-d\fR +Не отключаться от управляющего терминала. +.TP +.BI \-c\ файл_конфигурации \fR +Использовать +.IR файл_конфигурации +в качестве файла, который slpd читает для получения конфигурационной информации, вместо стандартного +.IR /usr/share/defaults/etc/openslp/slp.conf +или +.IR /etc/openslp/slp.conf . +.TP +.BI \-l\ файл_журнала \fR +Использовать +.IR файл_журнала +в качестве файла, в который slpd записывает сообщения журнала, вместо стандартного +.IR /var/log/slpd.log . +.TP +.BI \-r\ файл_регистрации \fR +Использовать +.IR файл_регистрации +в качестве файла, который slpd читает для получения статических регистраций, вместо стандартного +.IR /usr/share/defaults/etc/openslp/slp.reg +или +.IR /etc/openslp/slp.reg . +.TP +.BI \-p\ файл_pid \fR +Использовать +.IR файл_pid +в качестве файла, содержащего идентификатор процесса slpd, вместо стандартного +.IR /var/run/slpd.pid . +.TP +.BI \-v\fR +Показать версию slpd и параметры компиляции. diff --git a/files/man/ru/slptool.1 b/files/man/ru/slptool.1 new file mode 100644 index 0000000..90861ca --- /dev/null +++ b/files/man/ru/slptool.1 @@ -0,0 +1,63 @@ +.TH SLPTOOL "1" "Май 2025" "slptool 2.0" "Команды пользователя" +.SH ИМЯ +slptool \- командный инструмент SLP +.SH СИНТАКСИС +.B slptool +[\fIопции\fR] \fIкоманда-и-аргументы\fR +.SH ОПЦИИ +.IP +Опции могут быть: +.HP +\fB\-v\fR (или \fB\-\-version\fR) отображает версии slptool и OpenSLP. +.HP +\fB\-s\fR (или \fB\-\-scope\fR) с последующим списком областей, разделённых запятыми. +.HP +\fB\-l\fR (или \fB\-\-language\fR) с последующим тегом языка. +.HP +\fB\-t\fR (или \fB\-\-time\fR) с последующим тегом времени жизни. +.HP +\fB\-i\fR (или \fB\-\-interfaces\fR) с последующим списком интерфейсов, разделённых запятыми. +.HP +\fB\-u\fR (или \fB\-\-unicastifc\fR) с последующим одиночным интерфейсом. +.IP +Команда-и-аргументы могут быть: +.IP +.HP +findsrvs тип_службы [фильтр] +.HP +findattrs url [идентификаторы_атрибутов] +.HP +findsrvtypes [авторизация] +.HP +findscopes +.HP +register url [атрибуты] +.HP +deregister url +.HP +getproperty имя_свойства +.SH ПРИМЕРЫ +.IP +.HP +slptool register service:myserv.x://myhost.com "(attr1=val1),(attr2=val2)" +.HP +slptool findsrvs service:myserv.x +.HP +slptool findsrvs service:myserv.x "(attr1=val1)" +.HP +slptool \fB\-i\fR 10.77.13.240,192.168.250.240 findsrvs service:myserv.x +.HP +slptool \fB\-u\fR 10.77.13.237 findsrvs service:myserv.x "(attr1=val1)" +.HP +slptool findattrs service:myserv.x://myhost.com +.HP +slptool findattrs service:myserv.x://myhost.com attr1 +.HP +slptool \fB\-i\fR 10.77.13.243 findattrs service:myserv.x://myhost.com attr1 +.HP +slptool \fB\-u\fR 10.77.13.237 findattrs service:myserv.x://myhost.com attr1 +.HP +slptool deregister service:myserv.x://myhost.com +.HP +slptool getproperty net.slp.useScopes +.PP diff --git a/files/openslp-2.0.0-cve-2016-7567.patch b/files/openslp-2.0.0-cve-2016-7567.patch deleted file mode 100644 index 2b0e35c..0000000 --- a/files/openslp-2.0.0-cve-2016-7567.patch +++ /dev/null @@ -1,90 +0,0 @@ -diff -up openslp-2.0.0/common/slp_compare.c.orig openslp-2.0.0/common/slp_compare.c ---- openslp-2.0.0/common/slp_compare.c.orig 2012-12-12 20:12:43.000000000 +0100 -+++ openslp-2.0.0/common/slp_compare.c 2017-03-14 10:51:36.480675991 +0100 -@@ -194,7 +194,8 @@ static int SLPUnescapeInPlace(size_t len - * @return The new (shorter) length of @p str. - * - * @note This routine assumes that leading and trailing white space have -- * already been removed from @p str. -+ * already been removed from @p str. It also assumes that @p str may -+ * not be null-terminated. - */ - static int SLPFoldWhiteSpace(size_t len, char * str) - { -@@ -203,11 +204,11 @@ static int SLPFoldWhiteSpace(size_t len, - { - if (isspace(*p)) - { -- char * ws2p = ++p; /* Point ws2p to the second ws char. */ -- while (isspace(*p)) /* Scan till we hit a non-ws char. */ -+ char * ws2p = ++p; /* Point ws2p to the second ws char. */ -+ while (p < ep && isspace(*p)) /* Scan till we hit a non-ws char. */ - p++; -- len -= p - ws2p; /* Reduce the length by extra ws. */ -- memmove(ws2p, p, ep - p); /* Overwrite the extra white space. */ -+ len -= p - ws2p; /* Reduce the length by extra ws. */ -+ memmove(ws2p, p, ep - p); /* Overwrite the extra white space. */ - } - p++; - } -@@ -821,6 +822,50 @@ int SLPCheckAttributeListSyntax(const ch - - #ifdef SLP_COMPARE_TEST - -+/* Test boundary conditions of SLPFoldWhiteSpace. */ -+static int test_SLPFoldWhiteSpace(void) -+{ -+ static char test_str0[] = " "; -+ static char test_str1[] = "Blah"; -+ static char test_str3[] = "Blah blah"; -+ static char test_str4[] = "Blah blah"; -+ static char test_str5[] = "Blah blah blah"; -+ static char test_str8[] = " Blah blah"; -+ static char test_str9[] = " Blah blah"; -+ static char test_strC[] = "Blah blah "; -+ static char test_strD[] = "Blah blah xxxx"; -+ -+ static char * test_strs[] = -+ { -+ test_str0, test_str0, test_str0, test_str1, test_strC, -+ test_str3, test_str4, test_str5, test_strC, test_strC, -+ test_str8, test_str9, test_strC, test_strD, -+ }; -+ -+ static int test_lens[] = -+ { -+ 0, 1, 2, 4, 9, 10, 11, 15, 10, 11, 10, 11, 11, 11, -+ }; -+ -+ static int test_fins[] = -+ { -+ 0, 1, 1, 4, 9, 9, 9, 14, 10, 10, 10, 10, 10, 10, -+ }; -+ -+#define MAX_BUFSZ 32 -+ -+ int i; -+ for (i = 0; i < sizeof(test_strs) / sizeof(*test_strs); ++i) -+ { -+ char test_buf[MAX_BUFSZ]; -+ memmove(test_buf, test_strs[i], test_lens[i]); -+ int len = SLPFoldWhiteSpace(test_lens[i], test_buf); -+ if (len != test_fins[i]) -+ return -1; -+ } -+ return 0; -+} -+ - /* ---------------- Test main for the slp_compare.c module ---------------- - * - * Compile with: -@@ -840,6 +885,9 @@ int main(void) - - int count; - -+ if (test_SLPFoldWhiteSpace() != 0) -+ return -1; -+ - /* *** SLPContainsStringList *** - */ - count = SLPContainsStringList(sizeof lst1 - 1, lst1, sizeof str1 - 1, str1); diff --git a/files/openslp-2.0.0-cve-2017-17833.patch b/files/openslp-2.0.0-cve-2017-17833.patch deleted file mode 100644 index eefce40..0000000 --- a/files/openslp-2.0.0-cve-2017-17833.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -up openslp-2.0.0/slpd/slpd_process.c.orig openslp-2.0.0/slpd/slpd_process.c ---- openslp-2.0.0/slpd/slpd_process.c.orig 2018-05-09 13:08:06.185104375 +0200 -+++ openslp-2.0.0/slpd/slpd_process.c 2018-05-09 13:07:21.017095089 +0200 -@@ -462,6 +462,15 @@ static int ProcessSrvRqst(SLPMessage * m - message->body.srvrqst.srvtype, 23, SLP_DA_SERVICE_TYPE) == 0) - { - errorcode = ProcessDASrvRqst(message, sendbuf, errorcode); -+ -+ if (result != *sendbuf) -+ { -+ // The pointer stored at *sendbuf can be modified by a realloc -+ // operation in ProcessDASrvRqst(). Fix up the local copy of -+ // that pointer if necessary. -+ result = *sendbuf; -+ } -+ - if (errorcode == 0) - { - /* Since we have an errorcode of 0, we were successful, diff --git a/files/openslp-2.0.0-notify-systemd-of-start-up.patch b/files/openslp-2.0.0-notify-systemd-of-start-up.patch deleted file mode 100644 index 8ab18fa..0000000 --- a/files/openslp-2.0.0-notify-systemd-of-start-up.patch +++ /dev/null @@ -1,39 +0,0 @@ -exporting patch: -# HG changeset patch -# User Stephen Gallagher -# Date 1394805577 14400 -# Fri Mar 14 09:59:37 2014 -0400 -# Node ID ff9067316db43f8e1204c0a7a743574c9f94feb5 -# Parent 598821da69f2f26b1e76447bfecf139a4210ad48 -Notify systemd of start-up completion - -diff -r 598821da69f2 -r ff9067316db4 openslp/slpd/Makefile.am ---- a/openslp/slpd/Makefile.am Sat Jun 08 15:14:45 2013 -0600 -+++ b/openslp/slpd/Makefile.am Fri Mar 14 09:59:37 2014 -0400 -@@ -93,5 +93,5 @@ - slpd_index.h - - #if you're building on Irix, replace .la with .a below --slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la -+slpd_LDADD = ../common/libcommonslpd.la ../libslpattr/libslpattr.la -lsystemd - -diff -r 598821da69f2 -r ff9067316db4 openslp/slpd/slpd_main.c ---- a/openslp/slpd/slpd_main.c Sat Jun 08 15:14:45 2013 -0600 -+++ b/openslp/slpd/slpd_main.c Fri Mar 14 09:59:37 2014 -0400 -@@ -58,6 +58,8 @@ - #include "slp_xid.h" - #include "slp_net.h" - -+#include -+ - int G_SIGALRM; - int G_SIGTERM; - int G_SIGHUP; -@@ -666,6 +668,7 @@ - - /* Main loop */ - SLPDLog("Startup complete entering main run loop ...\n\n"); -+ sd_notify(0, "READY=1"); - G_SIGALRM = 0; - G_SIGTERM = 0; - G_SIGHUP = 0; diff --git a/files/openslp-2.0.0-null-pointer-deref.patch b/files/openslp-2.0.0-null-pointer-deref.patch deleted file mode 100644 index 3c07d6e..0000000 --- a/files/openslp-2.0.0-null-pointer-deref.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up openslp-2.0.0/common/slp_xmalloc.c.orig openslp-2.0.0/common/slp_xmalloc.c ---- openslp-2.0.0/common/slp_xmalloc.c.orig 2012-12-07 01:52:08.000000000 +0100 -+++ openslp-2.0.0/common/slp_xmalloc.c 2016-05-23 12:58:57.953532979 +0200 -@@ -203,6 +203,8 @@ void * _xrealloc(const char * file, int - if (x->size != size) - { - newptr = _xmalloc(file, line, size); -+ if (newptr == 0) -+ return 0; - memcpy(newptr, ptr, x->size); - _xfree(file, line, x); - } diff --git a/files/openslp-2.0.0-openssl-1.1-fix.patch b/files/openslp-2.0.0-openssl-1.1-fix.patch deleted file mode 100644 index 47766fc..0000000 --- a/files/openslp-2.0.0-openssl-1.1-fix.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff -up openslp-2.0.0/common/slp_crypto.c.orig openslp-2.0.0/common/slp_crypto.c ---- openslp-2.0.0/common/slp_crypto.c.orig 2012-12-07 21:13:28.000000000 +0100 -+++ openslp-2.0.0/common/slp_crypto.c 2017-10-04 09:38:48.469999889 +0200 -@@ -88,11 +88,24 @@ SLPCryptoDSAKey * SLPCryptoDSAKeyDup(SLP - result = DSA_new(); - if (result) - { -+#if OPENSSL_VERSION_NUMBER >= 0x10100000L -+ const BIGNUM *p, *q, *g; -+ const BIGNUM *priv_key, *pub_key; -+ -+ DSA_get0_pqg(dsa, &p, &q, &g); -+ DSA_get0_key(dsa, &pub_key, &priv_key); -+ -+ /* would be nice to check return values, but -+ * original code for OpenSSL < 1.1 didn't do that either... */ -+ DSA_set0_pqg(result, BN_dup(p), BN_dup(q), BN_dup(g)); -+ DSA_set0_key(result, BN_dup(pub_key), BN_dup(priv_key)); -+#else - result->p = BN_dup(dsa->p); - result->q = BN_dup(dsa->q); - result->g = BN_dup(dsa->g); - result->priv_key = BN_dup(dsa->priv_key); - result->pub_key = BN_dup(dsa->pub_key); -+#endif - } - return result; - } diff --git a/files/openslp.service b/files/openslp.service index d449c09..2828d52 100644 --- a/files/openslp.service +++ b/files/openslp.service @@ -4,7 +4,7 @@ After=network.target [Service] Type=forking -ExecStart=/usr/bin/slpd -c /etc/openslp/slp.conf -r /etc/openslp/slp.reg -s /etc/openslp/slp.spi +ExecStart=/usr/bin/slpd ExecReload=/bin/kill -HUP $MAINPID [Install] diff --git a/files/series b/files/series new file mode 100644 index 0000000..4dd407d --- /dev/null +++ b/files/series @@ -0,0 +1,4 @@ +default_patches/0001-openslp-2.0.0-multicast-set.patch +default_patches/0002-openslp-2.0.0-notify-systemd-of-start-up.patch +default_patches/0003-openslp-2.0.0-cve-2019-5544.patch +solus_patches/0004-stateless.patch diff --git a/files/slpd.8.gz b/files/slpd.8.gz deleted file mode 100644 index ea6ac322a52e72c7b1a2fb1d9435489e51351c77..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 432 zcmV;h0Z;xPiwFom!q{g319NO}WG*-Wjgn7q!Y~ZQ@BI`Omt9yuNRxJD+N2?kKceg~ zjUBSarIFI4N(_i^KPOa-b_aH7RlnNLzrIFnULk*5J;UH}0E4;oMFo@bu5#regGn%8+;8Q<>YtZlKkDJcQsIjk%zo9M%x__oy65tv4tyKh#v0&*?N5? zXEG$8)ROY>C>3iC+&4*W+unT}qqe29jyM#TYPPP zfq0_mOy30UN5{i|Sld(7L2R|ZWR)}OtR=?AyMi+Vt^O04-`jI!Y~R5+#NB!2j%U~Q aB!jeyPfgv#?XF25EV3V8RHH?{0{{T$6w}-Q diff --git a/files/slptool.1.gz b/files/slptool.1.gz deleted file mode 100644 index 15c823d6f75074037345dc7e74d6e10189b86ab4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 577 zcmV-H0>1qpiwFoM<&aST19NO}bZ>8LE-?V5lTDA>Fc60C`4yv_7HRR4(3TddhusPZ zBp^{krB;N42~M!&e8_fa^Y3e$goFsSlpa7H&%BR4<2PtChhXV%JZ}lMV}rfI6}Tg3 ztd@cmGS3;fXoU7eVpr{b6NJN;JWX+S5VnPaIjmn-Gpnf$hZ+abxdIr?2LB7KF^()+Pvt=fB1V?OUrFeO^qJ z5&21gGUka!L`|V82yA1@6mNH_!BTPoC1I1l7YRG|fQ)Vk6vfxU|Wd+S5!znQ)o_&8^`O8^w>7w!81ygr3O)I@ZzosuQX?4tn zL~1Z#Kk37r&nL{B!Ltcm9k>Jg3fCXb1$ST7^*Pt*) +Date: Tue, 06 May 2025 19:15:37 +0300 +Subject: The default paths to the configuration files have been changed. + +diff --git a/common/slp_types.h b/common/slp_types.h +index 9714a50..478155b 100644 +--- a/common/slp_types.h ++++ b/common/slp_types.h +@@ -231,8 +231,11 @@ typedef unsigned long uint32_t; + # endif + + # define SLPD_CONFFILE ETCDIR "/slp.conf" ++# define SLPD_CONFFILE_STATELESS "/usr/share/defaults/etc/openslp/slp.conf" + # define SLPD_REGFILE ETCDIR "/slp.reg" ++# define SLPD_REGFILE_STATELESS "/usr/share/defaults/etc/openslp/slp.reg" + # define SLPD_SPIFILE ETCDIR "/slp.spi" ++# define SLPD_SPIFILE_STATELESS "/usr/share/defaults/etc/openslp/slp.spi" + # define SLPD_LOGFILE VARDIR "/log/slpd.log" + # define SLPD_PIDFILE VARDIR "/run/slpd.pid" + +diff --git a/libslp/libslp_handle.c b/libslp/libslp_handle.c +index b938345..d75314a 100644 +--- a/libslp/libslp_handle.c ++++ b/libslp/libslp_handle.c +@@ -65,7 +65,11 @@ static SLPError InitUserAgentLibrary(void) + /* Initialize the system if this is the first handle opened. */ + if (SLPAtomicInc(&s_OpenSLPHandleCount) == 1) + { +- if (LIBSLPPropertyInit(LIBSLP_CONFFILE) != 0) ++ const char *slp_conf_file_name = LIBSLP_CONFFILE; ++ if (access(slp_conf_file_name, R_OK) != 0) ++ slp_conf_file_name = SLPD_CONFFILE_STATELESS; ++ ++ if (LIBSLPPropertyInit(slp_conf_file_name) != 0) + { + SLPAtomicDec(&s_OpenSLPHandleCount); + return SLP_MEMORY_ALLOC_FAILED; +@@ -221,7 +225,11 @@ SLPEXP SLPError SLPAPI SLPOpen( + } + + #ifdef ENABLE_SLPv2_SECURITY +- handle->hspi = SLPSpiOpen(LIBSLP_SPIFILE, 0); ++ const char *slp_spi_file_name = LIBSLP_SPIFILE; ++ if (access(slp_spi_file_name, R_OK) != 0) ++ slp_spi_file_name = SLPD_SPIFILE_STATELESS; ++ ++ handle->hspi = SLPSpiOpen(slp_spi_file_name, 0); + if (!handle->hspi) + { + xfree(handle->langtag); +diff --git a/libslp/libslp_property.c b/libslp/libslp_property.c +index f645b93..913d39b 100644 +--- a/libslp/libslp_property.c ++++ b/libslp/libslp_property.c +@@ -115,8 +115,12 @@ SLPEXP const char * SLPAPI SLPGetProperty(const char * pcName) + if (!pcName || !*pcName) + return 0; + ++ const char *slp_conf_file_name = LIBSLP_CONFFILE; ++ if (access(slp_conf_file_name, R_OK) != 0) ++ slp_conf_file_name = SLPD_CONFFILE_STATELESS; ++ + /* This wrapper ensures that we only get initialized once */ +- if (!s_PropInited && LIBSLPPropertyInit(LIBSLP_CONFFILE) != 0) ++ if (!s_PropInited && LIBSLPPropertyInit(slp_conf_file_name) != 0) + return 0; + + /* At this point, the caller may no longer call SLPSetProperty because +@@ -157,8 +161,12 @@ SLPEXP void SLPAPI SLPSetProperty(const char * pcName, const char * pcValue) + if (!pcName || !*pcName) + return; + ++ const char *slp_conf_file_name = LIBSLP_CONFFILE; ++ if (access(slp_conf_file_name, R_OK) != 0) ++ slp_conf_file_name = SLPD_CONFFILE_STATELESS; ++ + /* This wrapper ensures that we only get initialized once */ +- if (!s_PropInited && LIBSLPPropertyInit(LIBSLP_CONFFILE) != 0) ++ if (!s_PropInited && LIBSLPPropertyInit(slp_conf_file_name) != 0) + return; + + if (s_UserAllowedToSet) +diff --git a/slpd/slpd_cmdline.c b/slpd/slpd_cmdline.c +index 177833e..7f47436 100644 +--- a/slpd/slpd_cmdline.c ++++ b/slpd/slpd_cmdline.c +@@ -85,14 +85,25 @@ int SLPDParseCommandLine(int argc, char * argv[]) + { + int i; + ++ const char *slp_spi_file_name = SLPD_SPIFILE; ++ const char *slp_reg_file_name = SLPD_REGFILE; ++ const char *slp_conf_file_name = SLPD_CONFFILE; ++ ++ if (access(slp_spi_file_name, R_OK) != 0) ++ slp_spi_file_name = SLPD_SPIFILE_STATELESS; ++ if (access(slp_reg_file_name, R_OK) != 0) ++ slp_reg_file_name = SLPD_REGFILE_STATELESS; ++ if (access(slp_conf_file_name, R_OK) != 0) ++ slp_conf_file_name = SLPD_CONFFILE_STATELESS; ++ + /* Set defaults */ + memset(&G_SlpdCommandLine, 0, sizeof(SLPDCommandLine)); +- strnenv(G_SlpdCommandLine.cfgfile, SLPD_CONFFILE, sizeof(G_SlpdCommandLine.cfgfile)); ++ strnenv(G_SlpdCommandLine.cfgfile, slp_conf_file_name, sizeof(G_SlpdCommandLine.cfgfile)); + strnenv(G_SlpdCommandLine.logfile, SLPD_LOGFILE, sizeof(G_SlpdCommandLine.logfile)); +- strnenv(G_SlpdCommandLine.regfile, SLPD_REGFILE, sizeof(G_SlpdCommandLine.regfile)); ++ strnenv(G_SlpdCommandLine.regfile, slp_reg_file_name, sizeof(G_SlpdCommandLine.regfile)); + strnenv(G_SlpdCommandLine.pidfile, SLPD_PIDFILE, sizeof(G_SlpdCommandLine.pidfile)); + #ifdef ENABLE_SLPv2_SECURITY +- strnenv(G_SlpdCommandLine.spifile, SLPD_SPIFILE, sizeof(G_SlpdCommandLine.spifile)); ++ strnenv(G_SlpdCommandLine.spifile, slp_spi_file_name, sizeof(G_SlpdCommandLine.spifile)); + #endif + G_SlpdCommandLine.action = -1; + diff --git a/package.yml b/package.yml index b35b60a..78ecc3b 100644 --- a/package.yml +++ b/package.yml @@ -1,8 +1,11 @@ name : openslp version : 2.0.0 -release : 1 +release : 2 source : - - http://downloads.sf.net/openslp/openslp-2.0.0.tar.gz : 924337a2a8e5be043ebaea2a78365c7427ac6e9cee24610a0780808b2ba7579b + # The official repository has moved from SourceForge to GitHub. + # No releases have been made since 2013, but there is an abundance of commits with fixes. + # Therefore, the git source was used as the source code. + - git|https://github.com/openslp-org/openslp.git : f8dd97d68bdcf4af58d973d9eb97f4cddd149fe7 homepage : http://www.openslp.org license : BSD component : system.utils @@ -10,13 +13,10 @@ summary : Service Location Protocol (SLP) is an Internet Engineering Task For description: | Service Location Protocol (SLP) is an Internet Engineering Task Force (IETF) standards track protocol that provides a framework to allow networking applications to discover the existence, location, and configuration of networked services in enterprise networks. setup : | - %patch -p1 < $pkgfiles/openslp-2.0.0-multicast-set.patch - %patch -p2 < $pkgfiles/openslp-2.0.0-notify-systemd-of-start-up.patch - %patch -p1 < $pkgfiles/openslp-2.0.0-null-pointer-deref.patch - %patch -p1 < $pkgfiles/openslp-2.0.0-openssl-1.1-fix.patch - %patch -p1 < $pkgfiles/openslp-2.0.0-cve-2016-7567.patch - %patch -p1 < $pkgfiles/openslp-2.0.0-cve-2017-17833.patch - %patch -p1 < $pkgfiles/openslp-2.0.0-cve-2019-5544.patch + # The path in the official repository has become nested, a transition is required. + cd openslp + + %apply_patches autoreconf -f -i find . -name "CVS" | xargs rm -rf @@ -32,11 +32,31 @@ setup : | --disable-dependency-tracking \ --disable-static build : | + cd openslp + %make + + # Preparation of man pages + gzip -c $pkgfiles/man/en/slptool.1 > slptool.1.gz.en + gzip -c $pkgfiles/man/en/slpd.8 > slpd.8.gz.en + gzip -c $pkgfiles/man/ru/slptool.1 > slptool.1.gz.ru + gzip -c $pkgfiles/man/ru/slpd.8 > slpd.8.gz.ru install : | + cd openslp + %make_install install -Dm 00644 $pkgfiles/openslp.service $installdir/usr/lib/systemd/system/openslp.service - install -Dm 00644 $pkgfiles/slpd.8.gz $installdir/usr/share/man/man8/slpd.8.gz - install -Dm 00644 $pkgfiles/slptool.1.gz $installdir/usr/share/man/man1/slptool.1.gz install -Dm 00644 $pkgfiles/slp.pc $installdir/usr/lib64/pkgconfig/slp.pc + + install -Dm 00644 slptool.1.gz.en $installdir/usr/share/man/man1/slptool.1.gz + install -Dm 00644 slpd.8.gz.en $installdir/usr/share/man/man8/slpd.8.gz + install -Dm 00644 slptool.1.gz.ru $installdir/usr/share/man/ru/man1/slptool.1.gz + install -Dm 00644 slpd.8.gz.ru $installdir/usr/share/man/ru/man8/slpd.8.gz + + install -dm00755 $installdir/usr/share/defaults/etc/ + mv $installdir/etc/openslp $installdir/usr/share/defaults/etc/ + + rmdir $installdir/etc + rmdir $installdir/var/log + rmdir $installdir/var