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 --- net-libs/openslp/Manifest | 18 + net-libs/openslp/files/openslp-1.2.1-cflags.patch | 11 + net-libs/openslp/files/openslp-1.2.1-fbsd.patch | 12 + .../openslp/files/openslp-1.2.1-fixoverflow.patch | 11 + .../files/openslp-2.0.0-CVE-2012-4428.patch | 51 ++ .../files/openslp-2.0.0-CVE-2016-4912.patch | 15 + .../files/openslp-2.0.0-CVE-2016-7567.patch | 94 +++ net-libs/openslp/files/openslp-2.0.0-cflags.patch | 25 + .../openslp/files/openslp-2.0.0-namespace.patch | 773 +++++++++++++++++++++ net-libs/openslp/files/slpd-init | 88 +++ net-libs/openslp/files/slpd.service | 10 + net-libs/openslp/metadata.xml | 11 + net-libs/openslp/openslp-1.2.1-r3.ebuild | 41 ++ net-libs/openslp/openslp-2.0.0-r4.ebuild | 43 ++ net-libs/openslp/openslp-2.0.0-r5.ebuild | 44 ++ 15 files changed, 1247 insertions(+) create mode 100644 net-libs/openslp/Manifest create mode 100644 net-libs/openslp/files/openslp-1.2.1-cflags.patch create mode 100644 net-libs/openslp/files/openslp-1.2.1-fbsd.patch create mode 100644 net-libs/openslp/files/openslp-1.2.1-fixoverflow.patch create mode 100644 net-libs/openslp/files/openslp-2.0.0-CVE-2012-4428.patch create mode 100644 net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch create mode 100644 net-libs/openslp/files/openslp-2.0.0-CVE-2016-7567.patch create mode 100644 net-libs/openslp/files/openslp-2.0.0-cflags.patch create mode 100644 net-libs/openslp/files/openslp-2.0.0-namespace.patch create mode 100644 net-libs/openslp/files/slpd-init create mode 100644 net-libs/openslp/files/slpd.service create mode 100644 net-libs/openslp/metadata.xml create mode 100644 net-libs/openslp/openslp-1.2.1-r3.ebuild create mode 100644 net-libs/openslp/openslp-2.0.0-r4.ebuild create mode 100644 net-libs/openslp/openslp-2.0.0-r5.ebuild (limited to 'net-libs/openslp') diff --git a/net-libs/openslp/Manifest b/net-libs/openslp/Manifest new file mode 100644 index 000000000000..5f65ec8e989a --- /dev/null +++ b/net-libs/openslp/Manifest @@ -0,0 +1,18 @@ +AUX openslp-1.2.1-cflags.patch 400 SHA256 0b7ecc480aae4a47761d6328f61135eef371e4098318de8278899f7e1f8ec766 SHA512 cb3c5a71ce9eb23daa2c25829549942b18e75472cda8d76d99bcae1371615f48f8de5bc126b266b51f4cc009049ccbbdb7958e0c09fe34d887da5af6c117c5ec WHIRLPOOL 07b8cb4fde8f65ad6db39a724d6dbc37bfbfe2e67a301620302aabf61b34b8afa03f272664fc8cf2d6fd7269a865819056206ada0f271b18540190bff43fc5b1 +AUX openslp-1.2.1-fbsd.patch 346 SHA256 131caf1dafc81f519d2e50bead9a2658e4efcb3594777ab189fd60a23f097da9 SHA512 7e8aeb152791d004fddd45c4ac8152f0df849f73b8428357476cfaf2a67c3418581dd05da439a9c856dcef0c6e231da13050ac8bc93d0f186dff2c644f407457 WHIRLPOOL 2ed6fea663137c9220582876f5b1cd3ac4d54f6a05f2afe8a90bf4a1fb71e36373582d9cd560b9285e6242d0d0fcdfb75bc217ec274cd313d7cc944e0d598b7d +AUX openslp-1.2.1-fixoverflow.patch 506 SHA256 3f97013477a1ce9ee421ffe70c1ed3a24435ee7c85d2a665b4c4a21bded789c4 SHA512 a0f4dd64513a481fa6fff9fd7b5efc7b2b8ffcd6df0463cba6ae1508897af7269bdd061ee28c7868dfe9d9cbc61bb880791629ce7bcd51272a1df50460a7e20f WHIRLPOOL 661fb227a79078bc00123d87b2eee38b5e68f50536cf0ded2c50b61e5b26480bc783bf63b6adcd3046e3e07856adf63ee8e25606a76bd4bf6ce4e0eb4891f552 +AUX openslp-2.0.0-CVE-2012-4428.patch 1714 SHA256 8b98ce6295a9fb90c4dec022c944bbce1ccf985cc5371616e771cb09ab59bf41 SHA512 f83e0e4d0ea0b5ef01ca7eb94089d48a68b113cd51aa3234aa2b02e8733ae5eab33ea171fce11d6e0ee28996bb270ec2b0615ca3cc04ac6df6e3519f6d93c802 WHIRLPOOL 8b69ddf87a594403a75de0c6409f9ecdae0f3f2237851f54dcfb2130c36f1cad80e2efb74b50807845c982c1e128c6a7e0faea88a81619cae413b9caa8325955 +AUX openslp-2.0.0-CVE-2016-4912.patch 677 SHA256 6091a0d140e0a5da733c0ac5c8a726e3f01450d94571c1598978bcd67785aaaf SHA512 ff577e831c31f16f37fc4d6268e8876364125fcbc92afa4e7e9371353a0a409bd98a764dd2b1553aa8fbc921b9fcb8a3369ca20c2612db217a6be7979efbe1ec WHIRLPOOL f75478207f9936df936376d141b92307934c4659122c265a329e1fd647bec97072a7338346e7db05384c1137197423f2133cc009df82bb12d3de0ea57dc6828b +AUX openslp-2.0.0-CVE-2016-7567.patch 2994 SHA256 263cdb569b6e8a53c403a35ff90058eceec500414328c151c186964761e7bb82 SHA512 44651a49bc43f1fb23b2621f39a6eb7f6329a76436460ef68a41b213f3037229e3a97006cec9b4206c461237532cbd04f3bd9d1a1bb59c96e0c37f5af0ae9e7e WHIRLPOOL ee6a459dfcf6e5eddf592a26a9e8b99275d4068f90cea7d3eb6a58eeb309bec0383bcc00bb6b778bf02141e691d526d911cd1462566109dff30089434817208e +AUX openslp-2.0.0-cflags.patch 814 SHA256 cff59349acf8fd9e0e70bf3bf59a30b29408d8b6baf4b993aacc783aab3dd775 SHA512 d21b2c839d34e22c46ffc67e7011564ea99f39d5f2a1dc45a5d925944187942f82069177462fe6a04d139d90188dfc354ca12229698ea84f891b4b58a4083a55 WHIRLPOOL be8d55640c0430f138e9d29b24650fd4dcfc53faf82943f6d4c2537c49ffec2a5af6ed2db5cc84f54bcb35396dbd4cf4e32e1e794578d5d0d2ebbf636ee6bb83 +AUX openslp-2.0.0-namespace.patch 29475 SHA256 0bca962d644e4a9f47b6b8c70b024634a71ab7cad0a0e6ceaee2cdfeb9770d55 SHA512 1fb64ac5990356e5f98e4fd76038c6c51f9632163b68850d44cecc136fafdf4639ee187f9e879aba08f99c8fc79ca8f4e735b4253ab59af7b7120d1f119f20f2 WHIRLPOOL 4e5b4dd1a2bd7f90daae99ac1f0536a35c23542643cb62bdc7b86ed43cb526a2699dde9ccd2d6ec64ecacca53363af29624251769f1e0614b6c4566409cb6c29 +AUX slpd-init 2206 SHA256 903fdfdd8a5b482af011fc12f9050a9afceac09e4eed9e9cd4fa58240ab61349 SHA512 f76e98cfd48303d3095f2c9af0e81da7fd2def6d62fcadb881e64dd565af354cff65325d678c6d78cb62fffab67723513c1818a5f5c7606f21aa3a651bd8722b WHIRLPOOL 976c3e4a9e52a3e6288ba31b3f3fd0803237ace0ef8cdbc983272a03a4616046a77f1cf250bda20dceb1988f958ad7c3f4cd1516aa10ba3dbab80104abb1754e +AUX slpd.service 203 SHA256 cd2f8cf14bd699eca303e1af30162df5e3cd189f0046ed0f0e2236665e4906b1 SHA512 189bc5ffe034ab4effdf4187f28110f028452fc9f6e27ff6c44681410b205eba4fb0412b5dd112d27596cef5e2143be6c722a2d5592d803d29dd25e4722ab6ce WHIRLPOOL f3d959d1012e99914b04103e81791da2933cddc32b6dbd0444dd02793c1c8a1217da12d9275102681286b2d75f0e58cfeb7a16f6c8e06dce382642efc8d06f2c +DIST openslp-1.2.1.tar.gz 886195 SHA256 08c7ec1e76fdd66461b3784d52047f594405f31ba2791ab0c1ec7c97639f5fbd SHA512 34742d88e772d7dba5c6fab1ccb7bf27d6174c5ca429aec406472994bcd806bfaf16dd86fce2ae4c51659587e99cced2436cf36772f6e086f7b87275fb1b19b6 WHIRLPOOL 391f735f3a05d0054dec6cbfcc217f3567c2a09ed7931bb57c8289cab9e7f566e01524ead861ef34afe00e2fd2c2feb4262d4410bf83641e26615adef80ba7a8 +DIST openslp-2.0.0.tar.gz 5424646 SHA256 924337a2a8e5be043ebaea2a78365c7427ac6e9cee24610a0780808b2ba7579b SHA512 e7627417d45d5d0cc83d6e13d62fe192702ce7b763f1b4fb51aa5da8285405b16a34c3ac4f0a1ecffdf59557b29ec7d24925941e56ddee277c8897162f597ade WHIRLPOOL 03600b4e19732c4cde1b8843c91267eaa781024060feead7127f397f1c016d10758d9ac99dde39046e5746d54af16e60002b9b40f813c5e5c930cb24eaed700c +EBUILD openslp-1.2.1-r3.ebuild 1027 SHA256 19408aac833048b76794ac0e4d25333294876e6f7e8b6a640d0d7b293e64c64a SHA512 373241a78ba23618fdad9d565bbb5b750e55dc3d5d58aef86bf65c4d6bf3215ad3af936306f30b1800173d3611545e43797e7d6320e10b2f686c8bde5a96b625 WHIRLPOOL 278a69d6272734416ee36df14e8e325a036f397fc2ab8274b106345ccc47307ab44e60ba3e89fdfe94108d9491f61e0cf1b17556b4b017de728428ebce787463 +EBUILD openslp-2.0.0-r4.ebuild 1085 SHA256 c236e4101ef8c93e1fdfc55eed3477c8e075b52956e5fa095b4109163d594e4d SHA512 1004ec076caeaf700c5142e8af2d7cacd7d829836eb4b4127c591cb99d76661416a60595856f0696f866f8441260c834f22c0f48793c71299a5c8ce4b317bfb9 WHIRLPOOL ca591a905d5c6301a3dd95b675341f7e47d83a0878d376d09be2332ae2e2c4e74af65268b520e3d1eec7f776cd6f32fce3d9ca244fa08895ad3552092d404f21 +EBUILD openslp-2.0.0-r5.ebuild 1144 SHA256 98ef4ad2ee893252cf19e2c5edb1dce2d47befe7a808f1f664926c3d7df241ca SHA512 7b49dbf4f14504dcbe89411279456dc2f3ccfdf266969729726b500e724ca5f07d7d7b4d11071f9d1d8b382d411373fd3660ee966bf489ed2fe81a61faed076c WHIRLPOOL feb46b5a007db0c414ec6a6a1dd3c29cd5b5e510007d623aa08cad0d6c4fa22eb8976f822b0124cd26df483f5ded25bffba39ef4454256b8d066c7c02fe2fa0e +MISC ChangeLog 3032 SHA256 260567b4e461476895dbe1d07b9c825aa5d971e1caf6085529f7daf699bde00b SHA512 a7e679ef11c78093a9e8de7c343b5f814d80c0f93261d01013a8f3e8c01abec84d9be169a9a75d29c914678d580af9a8bc8d296db695a17b4c1e780b62a044fa WHIRLPOOL 40fc427fd5c3004e7f742d1ffd1982798c11b533cf155998128c5b4287206ac3b2380925f617e12cc9e29a84a1a0b5b150c206db34ad34962f364310fa08aa62 +MISC ChangeLog-2015 9188 SHA256 c0f4f90a373ecf4f1fc953a83c8c36b99a1d0417d6defe621cbd755567154cda SHA512 5333002b5bd291ce2390f9b56b9fb042f182d2f17da904ebd7561290629076ae56b9c5533d03aa31b1735c9b271ca88f889664b2a3d78e1578687947835cc8ad WHIRLPOOL fcde967322506a74b7ebe427981f33325c19c5b2500dd16e7b544be1260efb24a467635f3abda3d38a81aa71c1dd5d723a83cf6d57b848279bc3513a7e3f665c +MISC metadata.xml 336 SHA256 807d0f36f4b7e0c0709cc27eb83a688f3c521a81dc50c8491cc6a889efa9512b SHA512 2aab4978f409d1ceb235b846e06bae2c750c68c69f54f6d5a3f96b30be24c6262cd085b741cc193d8d60a4486581817347ab5b3bcc84d43da48dcc2c215df84f WHIRLPOOL b312c5d2afdb6ceb29343a5b8e65c20262aeb3894d937cf3a248a539d538690a073c1cec4f3a4c2142c0bbbe965725659990c2b4ac1302c627d3256dcb22cc15 diff --git a/net-libs/openslp/files/openslp-1.2.1-cflags.patch b/net-libs/openslp/files/openslp-1.2.1-cflags.patch new file mode 100644 index 000000000000..a9a1d2634e7f --- /dev/null +++ b/net-libs/openslp/files/openslp-1.2.1-cflags.patch @@ -0,0 +1,11 @@ +diff -ruN openslp-1.2.1.orig/configure.in openslp-1.2.1/configure.in +--- openslp-1.2.1.orig/configure.in 2005-02-15 21:06:02.000000000 +0100 ++++ openslp-1.2.1/configure.in 2012-01-24 23:49:13.000000000 +0100 +@@ -153,7 +153,6 @@ + OPTFLAGS="-O" + fi + fi +-CFLAGS="$CFLAGS $OPTFLAGS" + + dnl *********************************************************************** + dnl Checks for header files. diff --git a/net-libs/openslp/files/openslp-1.2.1-fbsd.patch b/net-libs/openslp/files/openslp-1.2.1-fbsd.patch new file mode 100644 index 000000000000..dac041516f23 --- /dev/null +++ b/net-libs/openslp/files/openslp-1.2.1-fbsd.patch @@ -0,0 +1,12 @@ +Index: openslp-1.2.1/common/Makefile.am +=================================================================== +--- openslp-1.2.1.orig/common/Makefile.am ++++ openslp-1.2.1/common/Makefile.am +@@ -24,6 +24,7 @@ libcommonlibslp_la_SOURCES = \ + slp_parse.c \ + slp_pid.c \ + slp_dhcp.c \ ++ slp_net.c \ + $(slp_v1message_SRCS) \ + $(slp_security_SRCS) + diff --git a/net-libs/openslp/files/openslp-1.2.1-fixoverflow.patch b/net-libs/openslp/files/openslp-1.2.1-fixoverflow.patch new file mode 100644 index 000000000000..c02d8407fb3b --- /dev/null +++ b/net-libs/openslp/files/openslp-1.2.1-fixoverflow.patch @@ -0,0 +1,11 @@ +--- a/openslp-1.2.1/slpd/slpd_socket.c 2010-09-11 16:31:47.325871093 -0500 ++++ b/openslp-1.2.1/slpd/slpd_socket.c 2010-09-11 16:31:55.706851189 -0500 +@@ -183,7 +183,7 @@ + memcpy(&mreq.imr_multiaddr, maddr, sizeof(struct in_addr)); + + /* drop for the specified interface */ +- memcpy(&mreq.imr_interface,addr,sizeof(addr)); ++ memcpy(&mreq.imr_interface,addr,sizeof(struct in_addr)); + + return setsockopt(sockfd, IPPROTO_IP, IP_DROP_MEMBERSHIP, (char*)&mreq,sizeof(mreq)); + } diff --git a/net-libs/openslp/files/openslp-2.0.0-CVE-2012-4428.patch b/net-libs/openslp/files/openslp-2.0.0-CVE-2012-4428.patch new file mode 100644 index 000000000000..28564c007cf3 --- /dev/null +++ b/net-libs/openslp/files/openslp-2.0.0-CVE-2012-4428.patch @@ -0,0 +1,51 @@ + +Description: Fix out-of-bounds buffer access (CVE-2012-4428) + Fix handling of string-list in common/slp_common.c by not increasing + the item pointer past the string-list pointer, and letting '\\' only + escape the item separator ','. +Author: Guillem Jover +Origin: vendor +Bug: http://sourceforge.net/p/openslp/bugs/122/ +Bug-Debian: https://bugs.debian.org/687597 +Last-Update: 2014-07-25 + +Strangely nobody seems to have fixed this in openslp-2.0.0 ever. +Patch forward-ported; one chunk isn't needed anymore as the code has been +independently rewritten. Andreas K. Hüttel + + +diff -ruN openslp-2.0.0.orig/common/slp_compare.c openslp-2.0.0/common/slp_compare.c +--- openslp-2.0.0.orig/common/slp_compare.c 2012-12-12 20:12:43.000000000 +0100 ++++ openslp-2.0.0/common/slp_compare.c 2017-02-18 19:59:55.296473698 +0100 +@@ -587,13 +587,10 @@ + /* seek to the end of the next list item */ + while(1) + { +- if(itemend == listend || *itemend == ',') +- { +- if(*(itemend - 1) != '\\') +- { +- break; +- } +- } ++ if(itemend == listend) ++ break; ++ if(*itemend == ',' && *(itemend - 1) != '\\') ++ break; + + itemend++; + } +@@ -683,9 +680,10 @@ + /* seek to the end of the next list item */ + while (1) + { +- if (itemend == listend || *itemend == ',') +- if (*(itemend - 1) != '\\') +- break; ++ if(itemend == listend) ++ break; ++ if(*itemend == ',' && *(itemend - 1) != '\\') ++ break; + itemend++; + } + diff --git a/net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch b/net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch new file mode 100644 index 000000000000..d8a0eca0d3d3 --- /dev/null +++ b/net-libs/openslp/files/openslp-2.0.0-CVE-2016-4912.patch @@ -0,0 +1,15 @@ +Source: https://src.fedoraproject.org/cgit/rpms/openslp.git/plain/openslp-2.0.0-null-pointer-deref.patch +See also https://bugs.gentoo.org/show_bug.cgi?id=583396 + +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/net-libs/openslp/files/openslp-2.0.0-CVE-2016-7567.patch b/net-libs/openslp/files/openslp-2.0.0-CVE-2016-7567.patch new file mode 100644 index 000000000000..2d54fa04bfce --- /dev/null +++ b/net-libs/openslp/files/openslp-2.0.0-CVE-2016-7567.patch @@ -0,0 +1,94 @@ +See +http://www.openwall.com/lists/oss-security/2016/09/27/4 +https://bugs.gentoo.org/show_bug.cgi?id=595542 + +diff -r 598821da69f2 -r 34fb3aa5e6b4 openslp/common/slp_compare.c +--- a/common/slp_compare.c Sat Jun 08 15:14:45 2013 -0600 ++++ b/common/slp_compare.c Mon Nov 30 20:50:12 2015 -0700 +@@ -194,7 +194,8 @@ + * @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 @@ + { + 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 @@ + + #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 count; + ++ if (test_SLPFoldWhiteSpace() != 0) ++ return -1; ++ + /* *** SLPContainsStringList *** + */ + count = SLPContainsStringList(sizeof lst1 - 1, lst1, sizeof str1 - 1, str1); diff --git a/net-libs/openslp/files/openslp-2.0.0-cflags.patch b/net-libs/openslp/files/openslp-2.0.0-cflags.patch new file mode 100644 index 000000000000..b77261ee1f6d --- /dev/null +++ b/net-libs/openslp/files/openslp-2.0.0-cflags.patch @@ -0,0 +1,25 @@ +diff -ruN openslp-2.0.0.orig/configure.ac openslp-2.0.0/configure.ac +--- openslp-2.0.0.orig/configure.ac 2013-06-08 06:58:54.000000000 +0200 ++++ openslp-2.0.0/configure.ac 2013-07-12 22:17:15.000000000 +0200 +@@ -240,7 +240,6 @@ + OPTFLAGS="-O" + fi + fi +-CFLAGS="$CFLAGS $OPTFLAGS" + + # + # Configuration and output +diff -ruN openslp-2.0.0.orig/etc/Makefile.am openslp-2.0.0/etc/Makefile.am +--- openslp-2.0.0.orig/etc/Makefile.am 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/etc/Makefile.am 2013-07-12 22:28:20.000000000 +0200 +@@ -3,8 +3,8 @@ + dist_sysconf_DATA = slp.conf slp.reg slp.spi + + #make sure the slpd log directory is there +-install-data-hook: +- mkdir -p $(localstatedir)/log ++#install-data-hook: ++# mkdir -p $(localstatedir)/log + + ##install-data-local: + ## mkdir -p $(DESTDIR)$(sysconfdir) diff --git a/net-libs/openslp/files/openslp-2.0.0-namespace.patch b/net-libs/openslp/files/openslp-2.0.0-namespace.patch new file mode 100644 index 000000000000..b5e817877406 --- /dev/null +++ b/net-libs/openslp/files/openslp-2.0.0-namespace.patch @@ -0,0 +1,773 @@ +# HG changeset patch +# User John Calcote +# Date 1491588156 21600 +# Fri Apr 07 12:02:36 2017 -0600 +# Node ID 51ed69107d096c5b9886954d89e0709975d5aa15 +# Parent c1c294ce953e35f757020b01314cfc49556ccc0c +BUG#149: cleanup libslp namespace; fix ctype function calls throughout. + +diff -ruN openslp-2.0.0.orig/common/slp_compare.c openslp-2.0.0/common/slp_compare.c +--- openslp-2.0.0.orig/common/slp_compare.c 2017-06-10 01:15:33.214875294 +0200 ++++ openslp-2.0.0/common/slp_compare.c 2017-06-10 01:16:39.072878034 +0200 +@@ -83,9 +83,10 @@ + * + * @internal + */ +-int strncasecmp(const char * s1, const char * s2, size_t len) ++int slp_strncasecmp(const char * s1, const char * s2, size_t len) + { +- while (*s1 && (*s1 == *s2 || tolower(*s1) == tolower(*s2))) ++ while (*s1 && (*s1 == *s2 ++ || tolower((unsigned char)*s1) == tolower((unsigned char)*s2))) + { + len--; + if (len == 0) +@@ -93,7 +94,7 @@ + s1++; + s2++; + } +- return len? (int)(*(unsigned char *)s1 - (int)*(unsigned char *)s2): 0; ++ return len? (unsigned char)*s1 - (unsigned char)*s2: 0; + } + # endif + +@@ -113,11 +114,12 @@ + * + * @internal + */ +-int strcasecmp(const char * s1, const char * s2) ++int slp_strcasecmp(const char * s1, const char * s2) + { +- while (*s1 && (*s1 == *s2 || tolower(*s1) == tolower(*s2))) ++ while (*s1 && (*s1 == *s2 ++ || tolower((unsigned char)*s1) == tolower((unsigned char)*s2))) + s1++, s2++; +- return (int)(*(unsigned char *)s1 - (int)*(unsigned char *)s2); ++ return (unsigned char)*s1 - (unsigned char)*s2; + } + # endif + #endif +@@ -202,13 +204,13 @@ + char * p = str, * ep = str + len; + while (p < ep) + { +- if (isspace(*p)) ++ if (isspace((unsigned char)*p)) + { +- char * ws2p = ++p; /* Point ws2p to the second ws char. */ +- while (p < ep && isspace(*p)) /* Scan till we hit a non-ws char. */ ++ char * ws2p = ++p; /* Point ws2p to the second ws char. */ ++ while (p < ep && isspace((unsigned char)*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++; + } +@@ -276,9 +278,9 @@ + char *upd = dststr; + while (len > 0 && *srcstr) + { +- if (isspace(*srcstr)) ++ if (isspace((unsigned char)*srcstr)) + { +- while (isspace(*srcstr) && len > 0) ++ while (isspace((unsigned char)*srcstr) && len > 0) + { + ++srcstr, --len; + } +@@ -311,7 +313,7 @@ + } + else + { +- *upd++ = (char)tolower(*srcstr++); ++ *upd++ = (char)tolower((unsigned char)*srcstr++); + --len; + } + } +@@ -340,15 +342,15 @@ + char * cpy1, * cpy2; + + /* Remove leading white space. */ +- while (str1len && isspace(*str1)) ++ while (str1len && isspace((unsigned char)*str1)) + str1++, str1len--; +- while (str2len && isspace(*str2)) ++ while (str2len && isspace((unsigned char)*str2)) + str2++, str2len--; + + /* Remove trailing white space. */ +- while (str1len && isspace(str1[str1len - 1])) ++ while (str1len && isspace((unsigned char)str1[str1len - 1])) + str1len--; +- while (str2len && isspace(str2[str2len - 1])) ++ while (str2len && isspace((unsigned char)str2[str2len - 1])) + str2len--; + + /*A quick check for empty strings before we start xmemduping and xfreeing*/ +diff -ruN openslp-2.0.0.orig/common/slp_compare.h openslp-2.0.0/common/slp_compare.h +--- openslp-2.0.0.orig/common/slp_compare.h 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/common/slp_compare.h 2017-06-10 01:16:39.072878034 +0200 +@@ -52,10 +52,12 @@ + + #ifndef _WIN32 + # ifndef HAVE_STRNCASECMP +-int strncasecmp(const char * s1, const char * s2, size_t len); ++int slp_strncasecmp(const char * s1, const char * s2, size_t len); ++# define strncasecmp slp_strncasecmp + # endif + # ifndef HAVE_STRCASECMP +-int strcasecmp(const char * s1, const char * s2); ++int slp_strcasecmp(const char * s1, const char * s2); ++# define strcasecmp slp_strcasecmp + # endif + #endif + +diff -ruN openslp-2.0.0.orig/common/slp_dhcp.c openslp-2.0.0/common/slp_dhcp.c +--- openslp-2.0.0.orig/common/slp_dhcp.c 2012-12-07 01:52:08.000000000 +0100 ++++ openslp-2.0.0/common/slp_dhcp.c 2017-06-10 01:16:39.073878034 +0200 +@@ -405,7 +405,7 @@ + * ENOTCONN (read error), ETIMEDOUT (read timeout), ENOMEM (out of + * memory), or EINVAL (on parse error). + */ +-int DHCPGetOptionInfo(unsigned char * dhcpOptCodes, int dhcpOptCodeCnt, ++int slp_DHCPGetOptionInfo(unsigned char * dhcpOptCodes, int dhcpOptCodeCnt, + DHCPInfoCallBack * dhcpInfoCB, void * context) + { + uint32_t xid; +@@ -539,7 +539,7 @@ + * @return Zero on success, or a non-zero value to stop the caller from + * continuing to parse the buffer and call this routine. + */ +-int DHCPParseSLPTags(int tag, void * optdata, size_t optdatasz, ++int slp_DHCPParseSLPTags(int tag, void * optdata, size_t optdatasz, + void * context) + { + size_t cpysz, bufsz, dasize; +@@ -707,8 +707,8 @@ + ctx.scopelistlen = 0; + ctx.addrlistlen = 0; + +- if ((err = DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), +- DHCPParseSLPTags, &ctx)) != 0) ++ if ((err = slp_DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), ++ slp_DHCPParseSLPTags, &ctx)) != 0) + return FAIL; + + printf("ScopeList: [%.*s]\n", ctx.scopelistlen, ctx.scopelist); +diff -ruN openslp-2.0.0.orig/common/slp_dhcp.h openslp-2.0.0/common/slp_dhcp.h +--- openslp-2.0.0.orig/common/slp_dhcp.h 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/common/slp_dhcp.h 2017-06-10 01:16:39.073878034 +0200 +@@ -131,10 +131,10 @@ + typedef int DHCPInfoCallBack(int tag, void * optdata, + size_t optdatasz, void * context); + +-int DHCPGetOptionInfo(unsigned char * dhcpOptCodes, int dhcpOptCodeCnt, ++int slp_DHCPGetOptionInfo(unsigned char * dhcpOptCodes, int dhcpOptCodeCnt, + DHCPInfoCallBack * dhcpInfoCB, void * context); + +-int DHCPParseSLPTags(int tag, void * optdata, size_t optdatasz, ++int slp_DHCPParseSLPTags(int tag, void * optdata, size_t optdatasz, + void * context); + + /** DHCP interface context structure */ +diff -ruN openslp-2.0.0.orig/common/slp_iface.c openslp-2.0.0/common/slp_iface.c +--- openslp-2.0.0.orig/common/slp_iface.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/common/slp_iface.c 2017-06-10 01:16:39.073878034 +0200 +@@ -645,7 +645,7 @@ + * + * @internal + */ +-int sizeof_ifreq(struct ifreq* ifr) ++static int sizeof_ifreq(struct ifreq* ifr) + { + #ifdef HAVE_SOCKADDR_STORAGE_SS_LEN + int len = ifr->ifr_addr.sa_len + sizeof(ifr->ifr_name); +diff -ruN openslp-2.0.0.orig/common/slp_message.c openslp-2.0.0/common/slp_message.c +--- openslp-2.0.0.orig/common/slp_message.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/common/slp_message.c 2017-06-10 01:16:39.073878034 +0200 +@@ -58,7 +58,7 @@ + * @return A 16-bit unsigned value in native format; the buffer pointer + * is moved ahead by 2 bytes on return. + */ +-uint16_t GetUINT16(uint8_t ** cpp) ++uint16_t slp_GetUINT16(uint8_t ** cpp) + { + uint16_t rv = AS_UINT16(*cpp); + *cpp += 2; +@@ -72,7 +72,7 @@ + * @return A 32-bit unsigned value in native format; the buffer pointer + * is moved ahead by 3 bytes on return. + */ +-uint32_t GetUINT24(uint8_t ** cpp) ++uint32_t slp_GetUINT24(uint8_t ** cpp) + { + uint32_t rv = AS_UINT24(*cpp); + *cpp += 3; +@@ -86,7 +86,7 @@ + * @return A 32-bit unsigned value in native format; the buffer pointer + * is moved ahead by 4 bytes on return. + */ +-uint32_t GetUINT32(uint8_t ** cpp) ++uint32_t slp_GetUINT32(uint8_t ** cpp) + { + uint32_t rv = AS_UINT32(*cpp); + *cpp += 4; +@@ -106,7 +106,7 @@ + * @p cppstring pointer; the buffer pointer is moved ahead by @p len bytes + * on return. + */ +-char * GetStrPtr(uint8_t ** cpp, size_t len) ++char * slp_GetStrPtr(uint8_t ** cpp, size_t len) + { + char * sp = (char *)*cpp; + *cpp += len; +@@ -120,7 +120,7 @@ + * + * @note The buffer address is moved ahead by 2 bytes on return. + */ +-void PutUINT16(uint8_t ** cpp, size_t val) ++void slp_PutUINT16(uint8_t ** cpp, size_t val) + { + TO_UINT16(*cpp, val); + *cpp += 2; +@@ -133,7 +133,7 @@ + * + * @note The buffer address is moved ahead by 3 bytes on return. + */ +-void PutUINT24(uint8_t ** cpp, size_t val) ++void slp_PutUINT24(uint8_t ** cpp, size_t val) + { + TO_UINT24(*cpp, val); + *cpp += 3; +@@ -146,7 +146,7 @@ + * + * @note The buffer address is moved ahead by 4 bytes on return. + */ +-void PutUINT32(uint8_t ** cpp, size_t val) ++void slp_PutUINT32(uint8_t ** cpp, size_t val) + { + TO_UINT32(*cpp, val); + *cpp += 4; +diff -ruN openslp-2.0.0.orig/common/slp_message.h openslp-2.0.0/common/slp_message.h +--- openslp-2.0.0.orig/common/slp_message.h 2012-12-07 21:13:28.000000000 +0100 ++++ openslp-2.0.0/common/slp_message.h 2017-06-10 01:16:39.073878034 +0200 +@@ -188,14 +188,23 @@ + #define PEEK_LENGTH(p) ((*p == 2) ? AS_UINT24(p + 2) : (*p == 1) ? AS_UINT16(p + 2) : 1) + + /* buffer-based wire routines */ +-uint16_t GetUINT16(uint8_t ** cpp); +-uint32_t GetUINT24(uint8_t ** cpp); +-uint32_t GetUINT32(uint8_t ** cpp); +-char * GetStrPtr(uint8_t ** cpp, size_t length); ++uint16_t slp_GetUINT16(uint8_t ** cpp); ++uint32_t slp_GetUINT24(uint8_t ** cpp); ++uint32_t slp_GetUINT32(uint8_t ** cpp); ++char * slp_GetStrPtr(uint8_t ** cpp, size_t length); + +-void PutUINT16(uint8_t ** cpp, size_t val); +-void PutUINT24(uint8_t ** cpp, size_t val); +-void PutUINT32(uint8_t ** cpp, size_t val); ++void slp_PutUINT16(uint8_t ** cpp, size_t val); ++void slp_PutUINT24(uint8_t ** cpp, size_t val); ++void slp_PutUINT32(uint8_t ** cpp, size_t val); ++ ++#define GetUINT16 slp_GetUINT16 ++#define GetUINT24 slp_GetUINT24 ++#define GetUINT32 slp_GetUINT32 ++#define GetStrPtr slp_GetStrPtr ++ ++#define PutUINT16 slp_PutUINT16 ++#define PutUINT24 slp_PutUINT24 ++#define PutUINT32 slp_PutUINT32 + + /** SLPHeader structure and associated functions */ + typedef struct _SLPHeader +diff -ruN openslp-2.0.0.orig/common/slp_net.c openslp-2.0.0/common/slp_net.c +--- openslp-2.0.0.orig/common/slp_net.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/common/slp_net.c 2017-06-10 01:16:39.073878034 +0200 +@@ -76,18 +76,20 @@ + #endif + + /** IPv6 SLP address constants */ +-const struct in6_addr in6addr_srvloc_node = IN6ADDR_SRVLOC_NODE_INIT; +-const struct in6_addr in6addr_srvloc_link = IN6ADDR_SRVLOC_LINK_INIT; +-const struct in6_addr in6addr_srvloc_site = IN6ADDR_SRVLOC_SITE_INIT; +-const struct in6_addr in6addr_srvlocda_node = IN6ADDR_SRVLDA_NODE_INIT; +-const struct in6_addr in6addr_srvlocda_link = IN6ADDR_SRVLDA_LINK_INIT; +-const struct in6_addr in6addr_srvlocda_site = IN6ADDR_SRVLDA_SITE_INIT; +-const struct in6_addr in6addr_service_node_mask = IN6ADDR_SVCNOD_MASK_INIT; +-const struct in6_addr in6addr_service_link_mask = IN6ADDR_SVCLNK_MASK_INIT; +-const struct in6_addr in6addr_service_site_mask = IN6ADDR_SVCSIT_MASK_INIT; +-const struct in6_addr slp_in6addr_any = SLP_IN6ADDR_ANY_INIT; +-const struct in6_addr slp_in6addr_loopback = SLP_IN6ADDR_LOOPBACK_INIT; ++const struct in6_addr in6addr_srvloc_node = IN6ADDR_SRVLOC_NODE_INIT; ++const struct in6_addr in6addr_srvloc_link = IN6ADDR_SRVLOC_LINK_INIT; ++const struct in6_addr in6addr_srvloc_site = IN6ADDR_SRVLOC_SITE_INIT; + ++const struct in6_addr in6addr_srvlocda_node = IN6ADDR_SRVLDA_NODE_INIT; ++const struct in6_addr in6addr_srvlocda_link = IN6ADDR_SRVLDA_LINK_INIT; ++const struct in6_addr in6addr_srvlocda_site = IN6ADDR_SRVLDA_SITE_INIT; ++ ++const struct in6_addr slp_in6addr_any = SLP_IN6ADDR_ANY_INIT; ++const struct in6_addr slp_in6addr_loopback = SLP_IN6ADDR_LOOPBACK_INIT; ++ ++static const struct in6_addr in6addr_service_node_mask = IN6ADDR_SVCNOD_MASK_INIT; ++static const struct in6_addr in6addr_service_link_mask = IN6ADDR_SVCLNK_MASK_INIT; ++static const struct in6_addr in6addr_service_site_mask = IN6ADDR_SVCSIT_MASK_INIT; + + /** Returns the scope embedded in the IPv6 multicast address. + * +diff -ruN openslp-2.0.0.orig/common/slp_net.h openslp-2.0.0/common/slp_net.h +--- openslp-2.0.0.orig/common/slp_net.h 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/common/slp_net.h 2017-06-10 01:16:39.073878034 +0200 +@@ -65,9 +65,6 @@ + extern const struct in6_addr in6addr_srvlocda_node; + extern const struct in6_addr in6addr_srvlocda_link; + extern const struct in6_addr in6addr_srvlocda_site; +-extern const struct in6_addr in6addr_service_node_mask; +-extern const struct in6_addr in6addr_service_link_mask; +-/* extern const struct in6_addr in6addr_service_site_mask; */ + + /** IN6 "Any" and "Loopback" address initializer macros */ + #ifdef _AIX +diff -ruN openslp-2.0.0.orig/common/slp_network.c openslp-2.0.0/common/slp_network.c +--- openslp-2.0.0.orig/common/slp_network.c 2013-06-08 04:50:38.000000000 +0200 ++++ openslp-2.0.0/common/slp_network.c 2017-06-10 01:16:39.073878034 +0200 +@@ -364,7 +364,7 @@ + * @returns A const pointer to @p dst on success; or NULL on failure, + * and sets @a errno to EAFNOSUPPORT. + */ +-const char * saddr_ntop(const void * src, char * dst, size_t dstsz) ++const char * slp_saddr_ntop(const void * src, char * dst, size_t dstsz) + { + switch (((const struct sockaddr *)src)->sa_family) + { +diff -ruN openslp-2.0.0.orig/common/slp_network.h openslp-2.0.0/common/slp_network.h +--- openslp-2.0.0.orig/common/slp_network.h 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/common/slp_network.h 2017-06-10 01:16:39.073878034 +0200 +@@ -62,7 +62,7 @@ + size_t bufsz, void * peeraddr, struct timeval * timeout); + int SLPNetworkRecvMessage(sockfd_t sockfd, int socktype, SLPBuffer * buf, + void * peeraddr, struct timeval * timeout); +-const char * saddr_ntop(const void * src, char * dst, size_t dstsz); ++const char * slp_saddr_ntop(const void * src, char * dst, size_t dstsz); + + void SLPNetworkSetSndRcvBuf(sockfd_t sock); + /*! @} */ +diff -ruN openslp-2.0.0.orig/common/slp_v1message.c openslp-2.0.0/common/slp_v1message.c +--- openslp-2.0.0.orig/common/slp_v1message.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/common/slp_v1message.c 2017-06-10 01:16:39.073878034 +0200 +@@ -275,10 +275,10 @@ + || (tmp = strstr(srvreg->attrlist, "scope")) != 0) + { + tmp += 5; +- while (*tmp && (isspace(*tmp) || *tmp == '=')) ++ while (*tmp && (isspace((unsigned char)*tmp) || *tmp == '=')) + tmp++; /* Find start of scope string. */ + srvreg->scopelist = tmp; +- while (*tmp && !isspace(*tmp) && *tmp != ')') ++ while (*tmp && !isspace((unsigned char)*tmp) && *tmp != ')') + tmp++; /* Find end of scope string. */ + srvreg->scopelistlen = tmp - srvreg->scopelist; + /** @todo Should we convert to UTF-8 here? */ +diff -ruN openslp-2.0.0.orig/common/slp_xmalloc.c openslp-2.0.0/common/slp_xmalloc.c +--- openslp-2.0.0.orig/common/slp_xmalloc.c 2017-06-10 01:15:33.209875294 +0200 ++++ openslp-2.0.0/common/slp_xmalloc.c 2017-06-10 01:18:31.228882700 +0200 +@@ -106,7 +106,7 @@ + * + * @return A pointer to the newly allocated memory block. + */ +-void * _xmalloc(const char * file, int line, size_t size) ++void * slp_xmalloc(const char * file, int line, size_t size) + { + xallocation_t * x; + +@@ -161,10 +161,10 @@ + * + * @return A pointer to the newly allocated and cleared memory block. + */ +-void * _xcalloc(const char * file, int line, int numblks, size_t size) ++void * slp_xcalloc(const char * file, int line, int numblks, size_t size) + { + size_t blksz = numblks * size; +- void * ptr = _xmalloc(file, line, blksz); ++ void * ptr = slp_xmalloc(file, line, blksz); + if (ptr) + memset(ptr, 0, blksz); + return ptr; +@@ -183,16 +183,16 @@ + * NULL for @p buf actually allocates a new buffer, passing 0 + * for @p size actually allocates a new buffer. + */ +-void * _xrealloc(const char * file, int line, void * ptr, size_t size) ++void * slp_xrealloc(const char * file, int line, void * ptr, size_t size) + { + xallocation_t * x; + + if (!ptr) +- return _xmalloc(file, line, size); ++ return slp_xmalloc(file, line, size); + + if (!size) + { +- _xfree(file, line, ptr); ++ slp_xfree(file, line, ptr); + return 0; + } + +@@ -202,11 +202,11 @@ + void * newptr = ptr; + if (x->size != size) + { +- newptr = _xmalloc(file, line, size); ++ newptr = slp_xmalloc(file, line, size); + if (newptr == 0) + return 0; + memcpy(newptr, ptr, x->size); +- _xfree(file, line, x); ++ slp_xfree(file, line, x); + } + return newptr; + } +@@ -227,10 +227,10 @@ + * @return A pointer to the duplicated string, or NULL on memory + * allocation failure. + */ +-char * _xstrdup(const char * file, int line, const char * str) ++char * slp_xstrdup(const char * file, int line, const char * str) + { + size_t strsz = strlen(str) + 1; +- char * ptr = _xmalloc(file, line, strsz); ++ char * ptr = slp_xmalloc(file, line, strsz); + if (ptr) + memcpy(ptr, str, strsz); + return ptr; +@@ -246,9 +246,9 @@ + * @return A pointer to the duplicated memory block, or NULL on memory + * allocation failure. + */ +-void * _xmemdup(const char * file, int line, const void * ptr, size_t size) ++void * slp_xmemdup(const char * file, int line, const void * ptr, size_t size) + { +- void * cpy = _xmalloc(file, line, size); ++ void * cpy = slp_xmalloc(file, line, size); + if (cpy) + memcpy(cpy, ptr, size); + return cpy; +@@ -260,7 +260,7 @@ + * @param[in] line - The line number where @e xfree was called. + * @param[in] ptr - The address of the block to be free'd. + */ +-void _xfree(const char * file, int line, void * ptr) ++void slp_xfree(const char * file, int line, void * ptr) + { + xallocation_t * x; + +@@ -292,7 +292,7 @@ + * @return A boolean true (1) on success, or false (0) the log file + * fails to open. + */ +-int xmalloc_init(const char * filename, size_t freemem) ++int slp_xmalloc_init(const char * filename, size_t freemem) + { + G_xmalloc_fh = fopen(filename, "w"); + if (G_xmalloc_fh == 0) +@@ -305,7 +305,7 @@ + * + * @return 0 + */ +-int xmalloc_report(void) ++int slp_xmalloc_report(void) + { + xallocation_t * x; + +@@ -327,7 +327,7 @@ + + /** Deinitialize the debug memory allocator. + */ +-void xmalloc_deinit(void) ++void slp_xmalloc_deinit(void) + { + xmalloc_report(); + +@@ -352,7 +352,7 @@ + * @return A pointer to the duplicated memory block, or NULL on memory + * allocation failure. + */ +-void * _xmemdup(const void * ptr, size_t size) ++void * slp_xmemdup(const void * ptr, size_t size) + { + void * cpy = malloc(size); + if (cpy) +diff -ruN openslp-2.0.0.orig/common/slp_xmalloc.h openslp-2.0.0/common/slp_xmalloc.h +--- openslp-2.0.0.orig/common/slp_xmalloc.h 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/common/slp_xmalloc.h 2017-06-10 01:16:39.073878034 +0200 +@@ -63,34 +63,38 @@ + size_t size; + } xallocation_t; + +-void * _xmalloc(const char * file, int line, size_t size); +-void * _xcalloc(const char * file, int line, int numblks, size_t size); +-void * _xrealloc(const char * file, int line, void * ptr, size_t size); +-char * _xstrdup(const char * file, int line, const char * str); +-void * _xmemdup(const char * file, int line, const void * ptr, size_t size); +-void _xfree(const char * file, int line, void * ptr); +- +-int xmalloc_init(const char * filename, size_t freemem); +-int xmalloc_report(void); +-void xmalloc_deinit(void); +- +-#define xmalloc(s) _xmalloc(__FILE__,__LINE__,(s)) +-#define xcalloc(n,s) _xcalloc(__FILE__,__LINE__,(n),(s)) +-#define xrealloc(p,s) _xrealloc(__FILE__,__LINE__,(p),(s)) +-#define xfree(p) _xfree(__FILE__,__LINE__,(p)) +-#define xstrdup(p) _xstrdup(__FILE__,__LINE__,(p)) +-#define xmemdup(p,s) _xmemdup(__FILE__,__LINE__,(p),(s)) ++void * slp_xmalloc(const char * file, int line, size_t size); ++void * slp_xcalloc(const char * file, int line, int numblks, size_t size); ++void * slp_xrealloc(const char * file, int line, void * ptr, size_t size); ++char * slp_xstrdup(const char * file, int line, const char * str); ++void * slp_xmemdup(const char * file, int line, const void * ptr, size_t size); ++void slp_xfree(const char * file, int line, void * ptr); ++ ++int slp_xmalloc_init(const char * filename, size_t freemem); ++int slp_xmalloc_report(void); ++void slp_xmalloc_deinit(void); ++ ++#define xmalloc(s) slp_xmalloc(__FILE__,__LINE__,(s)) ++#define xcalloc(n,s) slp_xcalloc(__FILE__,__LINE__,(n),(s)) ++#define xrealloc(p,s) slp_xrealloc(__FILE__,__LINE__,(p),(s)) ++#define xfree(p) slp_xfree(__FILE__,__LINE__,(p)) ++#define xstrdup(p) slp_xstrdup(__FILE__,__LINE__,(p)) ++#define xmemdup(p,s) slp_xmemdup(__FILE__,__LINE__,(p),(s)) ++ ++#define xmalloc_init slp_xmalloc_init ++#define xmalloc_report slp_xmalloc_report ++#define xmalloc_deinit slp_xmalloc_deinit + + #else /* ?DEBUG */ + +-void * _xmemdup(const void * ptr, size_t srclen); ++void * slp_xmemdup(const void * ptr, size_t srclen); + + #define xmalloc malloc + #define xcalloc calloc + #define xrealloc realloc + #define xfree free + #define xstrdup strdup +-#define xmemdup _xmemdup ++#define xmemdup slp_xmemdup + + #endif /* ?DEBUG */ + +diff -ruN openslp-2.0.0.orig/libslp/libslp.h openslp-2.0.0/libslp/libslp.h +--- openslp-2.0.0.orig/libslp/libslp.h 2012-11-28 18:07:04.000000000 +0100 ++++ openslp-2.0.0/libslp/libslp.h 2017-06-10 01:16:39.073878034 +0200 +@@ -263,11 +263,15 @@ + + void KnownDAFreeAll(void); + +-void PutL16String(uint8_t ** cpp, const char * str, size_t strsz); +-size_t SizeofURLEntry(size_t urllen, size_t urlauthlen); +-void PutURLEntry(uint8_t ** cpp, uint16_t lifetime, const char * url, ++void slp_PutL16String(uint8_t ** cpp, const char * str, size_t strsz); ++size_t slp_SizeofURLEntry(size_t urllen, size_t urlauthlen); ++void slp_PutURLEntry(uint8_t ** cpp, uint16_t lifetime, const char * url, + size_t urllen, const uint8_t * urlauth, size_t urlauthlen); + ++#define PutL16String slp_PutL16String ++#define SizeofURLEntry slp_SizeofURLEntry ++#define PutURLEntry slp_PutURLEntry ++ + int LIBSLPPropertyInit(char const * gconffile); + void LIBSLPPropertyCleanup(); + +diff -ruN openslp-2.0.0.orig/libslp/libslp_knownda.c openslp-2.0.0/libslp/libslp_knownda.c +--- openslp-2.0.0.orig/libslp/libslp_knownda.c 2012-12-12 18:38:52.000000000 +0100 ++++ openslp-2.0.0/libslp/libslp_knownda.c 2017-06-10 01:16:39.074878034 +0200 +@@ -520,7 +520,7 @@ + *ctx.scopelist = 0; + ctx.addrlistlen = 0; + +- DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), DHCPParseSLPTags, &ctx); ++ slp_DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), slp_DHCPParseSLPTags, &ctx); + + if (!*ctx.scopelist) + { +diff -ruN openslp-2.0.0.orig/libslp/libslp_network.c openslp-2.0.0/libslp/libslp_network.c +--- openslp-2.0.0.orig/libslp/libslp_network.c 2013-06-08 04:50:38.000000000 +0200 ++++ openslp-2.0.0/libslp/libslp_network.c 2017-06-10 01:16:39.074878034 +0200 +@@ -142,7 +142,7 @@ + * + * @internal + */ +-void timeval_subtract(struct timeval *lhs, struct timeval *rhs) ++static void timeval_subtract(struct timeval *lhs, struct timeval *rhs) + { + lhs->tv_sec -= rhs->tv_sec; + lhs->tv_usec -= rhs->tv_usec; +@@ -162,7 +162,7 @@ + * + * @internal + */ +-void timeval_add(struct timeval *lhs, struct timeval *rhs) ++static void timeval_add(struct timeval *lhs, struct timeval *rhs) + { + lhs->tv_sec += rhs->tv_sec; + lhs->tv_usec += rhs->tv_usec; +@@ -183,7 +183,7 @@ + * + * @return the size + */ +-size_t CalcBufferSize(int v1, char buftype, size_t langsize, size_t prlistlen, size_t bufsize) ++static size_t CalcBufferSize(int v1, char buftype, size_t langsize, size_t prlistlen, size_t bufsize) + { + size_t size = 0; + +diff -ruN openslp-2.0.0.orig/libslp/libslp_parse.c openslp-2.0.0/libslp/libslp_parse.c +--- openslp-2.0.0.orig/libslp/libslp_parse.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/libslp/libslp_parse.c 2017-06-10 01:16:39.074878034 +0200 +@@ -102,10 +102,10 @@ + * next buffer position after the URL Entry written on exit. + * + * @remarks Currently OpenSLP only handles a single authentication +- * block. To handle more than this, PutURLEntry would have to take ++ * block. To handle more than this, slp_PutURLEntry would have to take + * arrays of @p urlauth and @p urlauthlen values. + */ +-void PutURLEntry(uint8_t ** cpp, uint16_t lifetime, const char * url, ++void slp_PutURLEntry(uint8_t ** cpp, uint16_t lifetime, const char * url, + size_t urllen, const uint8_t * urlauth, size_t urlauthlen) + { + uint8_t * curpos = *cpp; +diff -ruN openslp-2.0.0.orig/libslpattr/libslpattr.c openslp-2.0.0/libslpattr/libslpattr.c +--- openslp-2.0.0.orig/libslpattr/libslpattr.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/libslpattr/libslpattr.c 2017-06-10 01:16:39.074878034 +0200 +@@ -134,8 +134,8 @@ + */ + static char unescape(char d1, char d2) + { +- SLP_ASSERT(isxdigit((int) d1)); +- SLP_ASSERT(isxdigit((int) d2)); ++ SLP_ASSERT(isxdigit((unsigned char)d1)); ++ SLP_ASSERT(isxdigit((unsigned char)d2)); + + if ((d1 >= 'A') && (d1 <= 'F')) + d1 = d1 - 'A' + 0x0A; +@@ -184,8 +184,8 @@ + /*** Check that the characters are legal, and that the value has + * not been truncated. + ***/ +- if ((i + 2 < len) && isxdigit((int) src[i + 1]) && isxdigit((int) +- src[i + 2])) ++ if ((i + 2 < len) && isxdigit((unsigned char)src[i + 1]) ++ && isxdigit((unsigned char)src[i + 2])) + { + *write = unescape(src[i + 1], src[i + 2]); + i += 2; +@@ -2049,14 +2049,14 @@ + + + /***** Check integer *****/ +- if (*val == '-' || isdigit((int) * val)) ++ if (*val == '-' || isdigit((unsigned char)*val)) + { + /*** Verify. ***/ + SLPBoolean is_int = SLP_TRUE; /* Flag true if the attr is an int. */ + for (i = 1; i < len; i++) + { + /* We start at 1 since first char has already been checked. */ +- if (!isdigit((int) val[i])) ++ if (!isdigit((unsigned char)val[i])) + { + is_int = SLP_FALSE; + break; +diff -ruN openslp-2.0.0.orig/slpd/slpd_knownda.c openslp-2.0.0/slpd/slpd_knownda.c +--- openslp-2.0.0.orig/slpd/slpd_knownda.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/slpd/slpd_knownda.c 2017-06-10 01:16:39.074878034 +0200 +@@ -488,7 +488,7 @@ + *ctx.scopelist = 0; + ctx.addrlistlen = 0; + +- DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), DHCPParseSLPTags, &ctx); ++ slp_DHCPGetOptionInfo(dhcpOpts, sizeof(dhcpOpts), slp_DHCPParseSLPTags, &ctx); + + alp = ctx.addrlist; + while (ctx.addrlistlen >= 4) +diff -ruN openslp-2.0.0.orig/slpd/slpd_main.c openslp-2.0.0/slpd/slpd_main.c +--- openslp-2.0.0.orig/slpd/slpd_main.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/slpd/slpd_main.c 2017-06-10 01:16:39.074878034 +0200 +@@ -358,10 +358,11 @@ + if (fd) + { + memset(pidstr,0,14); +- (void)fread(pidstr,13,1,fd); +- pid = atoi(pidstr); +- if (pid && kill(pid, 0) == 0) +- return -1; /* we are already running */ ++ if (fread(pidstr,13,1,fd) > 0) { ++ pid = atoi(pidstr); ++ if (pid && kill(pid, 0) == 0) ++ return -1; /* we are already running */ ++ } + fclose(fd); + } + return 0; +@@ -449,7 +450,8 @@ + int i; + + /* change directory to root */ +- (void)chdir("/"); ++ if (chdir("/") != 0) ++ ; /* TODO: ... */ + + /* close all open file handles */ + for (i = 0; i < 8192; i++) +diff -ruN openslp-2.0.0.orig/slpd/slpd_predicate.c openslp-2.0.0/slpd/slpd_predicate.c +--- openslp-2.0.0.orig/slpd/slpd_predicate.c 2012-12-11 00:31:53.000000000 +0100 ++++ openslp-2.0.0/slpd/slpd_predicate.c 2017-06-10 01:16:39.075878034 +0200 +@@ -161,7 +161,7 @@ + /* Verify escape sequences. */ + if (seq_pos == 1 || seq_pos == 2) + { +- if (!isxdigit((int) escaped[i])) ++ if (!isxdigit((unsigned char)escaped[i])) + return 0; + + if (seq_pos == 2) +@@ -198,7 +198,7 @@ + */ + static int unescape_check(char d1, char d2, char * val) + { +- if (!isxdigit((int) d1) || !isxdigit((int) d2)) ++ if (!isxdigit((unsigned char)d1) || !isxdigit((unsigned char)d2)) + return 0; + + if ((d1 >= 'A') && (d1 <= 'F')) +@@ -285,10 +285,10 @@ + + if (unesc != verbatim[ver_i]) /* quick check for equality*/ + { +- if (!isascii(unesc) /* case insensitive check */ +- || !isalpha(unesc) +- || !isalpha(verbatim[ver_i]) +- || tolower(unesc) != tolower(verbatim[ver_i])) ++ if (!isascii((unsigned char)unesc) /* case insensitive check */ ++ || !isalpha((unsigned char)unesc) ++ || !isalpha((unsigned char)verbatim[ver_i]) ++ || tolower((unsigned char)unesc) != tolower((unsigned char)verbatim[ver_i])) + return FR_EVAL_FALSE; + } + +@@ -866,7 +866,7 @@ + int i; + + for (i = 0; str[i] != 0; i++) +- if (!((!isdigit((int) str[i])) || str[i] == '-')) ++ if (!((!isdigit((unsigned char)str[i])) || str[i] == '-')) + return 0; + + return 1; diff --git a/net-libs/openslp/files/slpd-init b/net-libs/openslp/files/slpd-init new file mode 100644 index 000000000000..de7f5af3131e --- /dev/null +++ b/net-libs/openslp/files/slpd-init @@ -0,0 +1,88 @@ +#!/sbin/openrc-run +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net +} + +# +# Does nothing if a route exists that supports multicast traffic. +# If no routes supporting multicast traffic exists, the function +# tries to add one. A 0 is returned on success and a 1 on failure. +# One parameter must be passed in. This variable determins verbosity. +# If parameter is non-zero debugging will appear. +# +multicast_route_set() { + PING_OPTIONS_1='-c1 -w1' + PING_OPTIONS_2='-c1 -i1' + MULTICAST_ADDRESS='239.255.255.253' + TMP_FILE=/tmp/route.check + PING_ERROR_NO_ROUTE='unreachable' + + MSG_FAILED_TO_FIND='Failed to Detect Multicast Route' + MSG_SUCCESS_ON_FIND='Multicast Route Enabled' + MSG_ADDING_ROUTE='Attempting to Add Multicast Route ...' + MSG_FAILED_TO_ADD=' FAILED - Route NOT Added.' + MSG_SUCCES_ON_ADD=' SUCCESS - Route Added.' + + CMD_GET_INTERFACE="netstat -i | awk 'BEGIN{}(NR>2)&&(!/^lo*/){print \$1;exit}'" + CMD_ADD_ROUTE="route add -net 224.0.0.0 netmask 240.0.0.0" + + ping $PING_OPTIONS_1 $MULTICAST_ADDRESS 2> $TMP_FILE 1> /dev/null + if [ $? = 2 ]; then + ping $PING_OPTIONS_2 $MULTICAST_ADDRESS 2> $TMP_FILE 1> /dev/null + fi + + grep $PING_ERROR_NO_ROUTE $TMP_FILE > /dev/null 2>&1 + err_unreachable_found=$? + + #If errors, add route. Otherwise, do nothing + if [ -s $TMP_FILE ] && [ $err_unreachable_found = 0 ]; then + + if [ $1 != 0 ]; then + echo $MSG_FAILED_TO_FIND + echo $MSG_ADDING_ROUTE + fi + + $CMD_ADD_ROUTE `eval $CMD_GET_INTERFACE` > /dev/null 2>&1 + retval=$? + if [ $1 != 0 ]; then + + if [ $retval = 0 ]; then + echo $MSG_SUCCES_ON_ADD + else + echo $MSG_FAILED_TO_ADD + fi + fi + else + if [ $1 != 0 ]; then + echo -n $MSG_SUCCESS_ON_FIND + fi + retval=0 + fi + + rm -f $TMP_FILE # Clean up + return $retval +} + +checkconfig() { + multicast_route_set 0 + if [ $? -ne 0 ]; then + eerror "No route available for multicast traffic!" + return 1 + fi +} + +start() { + checkconfig || return 1 + ebegin "Starting slpd" + start-stop-daemon --start --quiet --exec /usr/sbin/slpd --pidfile /var/run/slpd.pid + eend $? +} + +stop() { + ebegin "Stopping slpd" + start-stop-daemon --stop --quiet --pidfile /var/run/slpd.pid + eend $? +} diff --git a/net-libs/openslp/files/slpd.service b/net-libs/openslp/files/slpd.service new file mode 100644 index 000000000000..ab5c02f3b773 --- /dev/null +++ b/net-libs/openslp/files/slpd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Service Location Protocol +After=network-online.target + +[Service] +ExecStart=/usr/sbin/slpd -l /var/log/slpd.log -d +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=network.target diff --git a/net-libs/openslp/metadata.xml b/net-libs/openslp/metadata.xml new file mode 100644 index 000000000000..c01f3945d893 --- /dev/null +++ b/net-libs/openslp/metadata.xml @@ -0,0 +1,11 @@ + + + + + printing@gentoo.org + Gentoo Printing Project + + + openslp + + diff --git a/net-libs/openslp/openslp-1.2.1-r3.ebuild b/net-libs/openslp/openslp-1.2.1-r3.ebuild new file mode 100644 index 000000000000..6ff9091f8631 --- /dev/null +++ b/net-libs/openslp/openslp-1.2.1-r3.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +inherit eutils autotools systemd + +DESCRIPTION="An open-source implementation of Service Location Protocol" +HOMEPAGE="http://www.openslp.org/" +SRC_URI="mirror://sourceforge/openslp/${P}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="" +RESTRICT="test" + +DEPEND="dev-libs/openssl" +RDEPEND="${DEPEND}" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}"/${P}-fbsd.patch + epatch "${FILESDIR}"/${P}-fixoverflow.patch + epatch "${FILESDIR}"/${P}-cflags.patch + eautoreconf +} + +src_compile() { + econf || die + emake -j1 || die "make failed" +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS FAQ ChangeLog NEWS README* THANKS + rm -rf "${D}"/usr/doc + dohtml -r . + newinitd "${FILESDIR}"/slpd-init slpd + systemd_dounit "${FILESDIR}"/slpd.service +} diff --git a/net-libs/openslp/openslp-2.0.0-r4.ebuild b/net-libs/openslp/openslp-2.0.0-r4.ebuild new file mode 100644 index 000000000000..c35ff61807d7 --- /dev/null +++ b/net-libs/openslp/openslp-2.0.0-r4.ebuild @@ -0,0 +1,43 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools systemd + +DESCRIPTION="An open-source implementation of Service Location Protocol" +HOMEPAGE="http://www.openslp.org/" +SRC_URI="mirror://sourceforge/openslp/${P}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="libressl" +RESTRICT="test" + +DEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.0-cflags.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2016-4912.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2012-4428.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2016-7567.patch +) + +src_prepare() { + default + eautoreconf +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS FAQ ChangeLog NEWS README* THANKS + rm -rfv "${D}"/usr/doc + dohtml -r . + newinitd "${FILESDIR}"/slpd-init slpd + systemd_dounit "${FILESDIR}"/slpd.service +} diff --git a/net-libs/openslp/openslp-2.0.0-r5.ebuild b/net-libs/openslp/openslp-2.0.0-r5.ebuild new file mode 100644 index 000000000000..f41d437d410e --- /dev/null +++ b/net-libs/openslp/openslp-2.0.0-r5.ebuild @@ -0,0 +1,44 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +inherit autotools systemd + +DESCRIPTION="An open-source implementation of Service Location Protocol" +HOMEPAGE="http://www.openslp.org/" +SRC_URI="mirror://sourceforge/openslp/${P}.tar.gz" + +LICENSE="BSD GPL-2" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +IUSE="libressl" +RESTRICT="test" + +DEPEND=" + !libressl? ( dev-libs/openssl:0= ) + libressl? ( dev-libs/libressl:0= ) +" +RDEPEND="${DEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-2.0.0-cflags.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2016-4912.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2012-4428.patch + "${FILESDIR}"/${PN}-2.0.0-CVE-2016-7567.patch + "${FILESDIR}"/${PN}-2.0.0-namespace.patch +) + +src_prepare() { + default + eautoreconf +} + +src_install() { + make DESTDIR="${D}" install || die "make install failed" + dodoc AUTHORS FAQ ChangeLog NEWS README* THANKS + rm -rfv "${D}"/usr/doc + dohtml -r . + newinitd "${FILESDIR}"/slpd-init slpd + systemd_dounit "${FILESDIR}"/slpd.service +} -- cgit v1.2.3