From 264d6d9caf9845180344d2caf00ebd137882ce27 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Mon, 9 May 2016 16:33:56 -0400 Subject: [PATCH 1/5] Fix js-random --- cjdns.warnings.patch | 46 ++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/cjdns.warnings.patch b/cjdns.warnings.patch index ecd43a5..62b4860 100644 --- a/cjdns.warnings.patch +++ b/cjdns.warnings.patch @@ -1,6 +1,6 @@ diff -up ./crypto/CryptoAuth.c.warnings ./crypto/CryptoAuth.c ---- ./crypto/CryptoAuth.c.warnings 2016-04-06 00:40:48.537753854 -0400 -+++ ./crypto/CryptoAuth.c 2016-04-06 00:52:00.506042569 -0400 +--- ./crypto/CryptoAuth.c.warnings 2016-01-27 03:07:49.000000000 -0500 ++++ ./crypto/CryptoAuth.c 2016-05-03 22:06:45.842528947 -0400 @@ -77,6 +77,8 @@ static inline void getSharedSecret(uint8 uint8_t passwordHash[32], struct Log* logger) @@ -20,7 +20,7 @@ diff -up ./crypto/CryptoAuth.c.warnings ./crypto/CryptoAuth.c printHexPubKey(myPublicKeyHex, myPrivateKey); diff -up ./dht/CJDHTConstants.h.warnings ./dht/CJDHTConstants.h --- ./dht/CJDHTConstants.h.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./dht/CJDHTConstants.h 2016-04-06 00:23:39.784334020 -0400 ++++ ./dht/CJDHTConstants.h 2016-05-03 22:06:45.842528947 -0400 @@ -17,7 +17,9 @@ #include "benc/String.h" @@ -41,7 +41,7 @@ diff -up ./dht/CJDHTConstants.h.warnings ./dht/CJDHTConstants.h #endif diff -up ./node_build/dependencies/libuv/test/test-getsockname.c.warnings ./node_build/dependencies/libuv/test/test-getsockname.c --- ./node_build/dependencies/libuv/test/test-getsockname.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./node_build/dependencies/libuv/test/test-getsockname.c 2016-04-06 00:23:39.784334020 -0400 ++++ ./node_build/dependencies/libuv/test/test-getsockname.c 2016-05-03 22:06:45.842528947 -0400 @@ -18,7 +18,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. @@ -51,9 +51,43 @@ diff -up ./node_build/dependencies/libuv/test/test-getsockname.c.warnings ./node #include "uv.h" #include "task.h" +diff -up ./util/Constant.js.warnings ./util/Constant.js +--- ./util/Constant.js.warnings 2016-05-09 16:26:54.865933415 -0400 ++++ ./util/Constant.js 2016-05-09 16:30:00.541056943 -0400 +@@ -62,20 +62,23 @@ var base2 = module.exports.base2 = funct + return '((' + type + ') 0x' + base2ToHex(numStr) + ((type === 'uint64_t') ? 'ull' : 'ul') + ')'; + }; + ++var randomHex = function (bytes) { ++ var hex = ''; ++ var len = Number(bytes * 2); // One byte is two hex digits ++ while (hex.length < len) { hex += Math.random().toString(16).substring(2); } ++ return hex.substring(0,len); ++}; ++ + var rand64 = module.exports.rand64 = function () { +- return '((uint64_t) 0x' + +- (Math.random().toString(16) + Math.random().toString(16)).replace(/0\./g, '') + 'ull)'; ++ return '((uint64_t) 0x' + randomHex(64 / 8) + 'ull)'; + }; + + var rand32 = module.exports.rand32 = function () { +- return '((uint32_t) 0x' + Math.random().toString(16).replace(/0\./g, '') + 'ul)'; ++ return '((uint32_t) 0x' + randomHex(32 / 8) + 'ul)'; + }; + + var randHexString = module.exports.randHexString = function (lenStr) { +- var hex = ''; +- var len = Number(lenStr); +- while (hex.length < len) { hex += Math.random().toString(16).substring(2); } +- return '"' + hex.substring(0,len) + '"'; ++ return '"' + randomHex(lenStr / 2) + '"'; + }; + + var log2 = module.exports.log2 = function (val) { diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/netdev/NetPlatform_linux.c --- ./util/platform/netdev/NetPlatform_linux.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./util/platform/netdev/NetPlatform_linux.c 2016-04-06 00:23:39.784334020 -0400 ++++ ./util/platform/netdev/NetPlatform_linux.c 2016-05-03 22:06:45.842528947 -0400 @@ -142,7 +142,7 @@ void NetPlatform_addAddress(const char* Except_throw(eh, "ioctl(SIOCSIFADDR) failed: [%s]", strerror(err)); } @@ -74,7 +108,7 @@ diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/net diff -up ./util/platform/Sockaddr.c.warnings ./util/platform/Sockaddr.c --- ./util/platform/Sockaddr.c.warnings 2016-01-27 03:07:49.000000000 -0500 -+++ ./util/platform/Sockaddr.c 2016-04-06 00:23:39.785334040 -0400 ++++ ./util/platform/Sockaddr.c 2016-05-03 22:06:45.842528947 -0400 @@ -12,6 +12,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . From d7184b7de28ac007fd11ff39fd82cc6c900ede4f Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Tue, 10 May 2016 19:00:28 -0400 Subject: [PATCH 2/5] Minor man page updates --- cjdns.man.patch | 54 +++++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/cjdns.man.patch b/cjdns.man.patch index c0f8cf6..d70f39b 100644 --- a/cjdns.man.patch +++ b/cjdns.man.patch @@ -1,6 +1,6 @@ diff -up ./contrib/doc/cjdnslog.md.man ./contrib/doc/cjdnslog.md ---- ./contrib/doc/cjdnslog.md.man 2016-05-03 22:57:12.839792004 -0400 -+++ ./contrib/doc/cjdnslog.md 2016-05-03 23:57:42.922419017 -0400 +--- ./contrib/doc/cjdnslog.md.man 2016-05-10 18:55:17.289488599 -0400 ++++ ./contrib/doc/cjdnslog.md 2016-05-10 18:55:17.289488599 -0400 @@ -0,0 +1,43 @@ +cjdnslog(1) -- display cjdroute log messages +============================================= @@ -46,8 +46,8 @@ diff -up ./contrib/doc/cjdnslog.md.man ./contrib/doc/cjdnslog.md + +cjdroute(1) diff -up ./contrib/doc/cjdns-online.md.man ./contrib/doc/cjdns-online.md ---- ./contrib/doc/cjdns-online.md.man 2016-05-03 22:06:45.843528959 -0400 -+++ ./contrib/doc/cjdns-online.md 2016-05-03 22:06:45.843528959 -0400 +--- ./contrib/doc/cjdns-online.md.man 2016-05-10 18:55:17.289488599 -0400 ++++ ./contrib/doc/cjdns-online.md 2016-05-10 18:55:17.289488599 -0400 @@ -0,0 +1,33 @@ +cjdns-online(1) -- check whether cjdns tunnel devices are available +============================================= @@ -83,8 +83,8 @@ diff -up ./contrib/doc/cjdns-online.md.man ./contrib/doc/cjdns-online.md + Wait for full startup instead of just tun dev. This is not implemented. + diff -up ./contrib/doc/cjdroute.md.man ./contrib/doc/cjdroute.md ---- ./contrib/doc/cjdroute.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/cjdroute.md 2016-05-03 22:06:45.843528959 -0400 +--- ./contrib/doc/cjdroute.md.man 2016-05-10 18:55:17.289488599 -0400 ++++ ./contrib/doc/cjdroute.md 2016-05-10 18:55:17.289488599 -0400 @@ -0,0 +1,76 @@ +cjdroute(1) -- Cjdns packet switch +============================================= @@ -163,9 +163,9 @@ diff -up ./contrib/doc/cjdroute.md.man ./contrib/doc/cjdroute.md + +For more information about other functions and non-standard setups, see README.md diff -up ./contrib/doc/makekeys.md.man ./contrib/doc/makekeys.md ---- ./contrib/doc/makekeys.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/makekeys.md 2016-05-03 22:06:45.844528970 -0400 -@@ -0,0 +1,18 @@ +--- ./contrib/doc/makekeys.md.man 2016-05-10 18:55:17.289488599 -0400 ++++ ./contrib/doc/makekeys.md 2016-05-10 18:58:51.521907178 -0400 +@@ -0,0 +1,24 @@ +makekeys(1) -- write cjdns keys generated via libnacl to stdout +============================================= + @@ -181,12 +181,18 @@ diff -up ./contrib/doc/makekeys.md.man ./contrib/doc/makekeys.md + 9b5520e11b4e1aac4e54cf8382ca219b6942f75519dbe7cc71fc6c4bb636a2db fca1:43dc:9e20:68dc:df3f:6bf1:fbf9:37ab x70u0x6sfh0yuushlq7wvcdxj8rgb8lvss9t6f42zp60ftq71cm0.k + 579db68cfdeaeda1ff7f365c73e620bedb0f68cb443a0cd7ef6bae16d0e1e12e fc68:b272:3aa3:cb4a:a686:dab0:7df5:2fb5 fmurp2qrb0yqmcjmbjtuhuxuf6v3rgmdn9hgsfh47k20h68y2lz0.k + ++##USAGE ++ ++Example use: ++ ++ makekeys | head -20 >keys.txt ++ +## SEE ALSO + +publictoip6(1) diff -up ./contrib/doc/peerStats.md.man ./contrib/doc/peerStats.md ---- ./contrib/doc/peerStats.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/peerStats.md 2016-05-03 22:06:45.844528970 -0400 +--- ./contrib/doc/peerStats.md.man 2016-05-10 18:55:17.289488599 -0400 ++++ ./contrib/doc/peerStats.md 2016-05-10 18:55:17.289488599 -0400 @@ -0,0 +1,25 @@ +peerStats(1) -- show cjdns peers +============================================= @@ -214,8 +220,8 @@ diff -up ./contrib/doc/peerStats.md.man ./contrib/doc/peerStats.md + +cjdroute(1), sessionStats(1) diff -up ./contrib/doc/privatetopublic.md.man ./contrib/doc/privatetopublic.md ---- ./contrib/doc/privatetopublic.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/privatetopublic.md 2016-05-03 22:06:45.844528970 -0400 +--- ./contrib/doc/privatetopublic.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/privatetopublic.md 2016-05-10 18:55:17.290488610 -0400 @@ -0,0 +1,25 @@ +privatetopublic(8) -- convert cjdns private keys to public keys and IP6 +============================================= @@ -243,10 +249,10 @@ diff -up ./contrib/doc/privatetopublic.md.man ./contrib/doc/privatetopublic.md + +publictoip6(1) diff -up ./contrib/doc/publictoip6.md.man ./contrib/doc/publictoip6.md ---- ./contrib/doc/publictoip6.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/publictoip6.md 2016-05-03 22:06:45.844528970 -0400 +--- ./contrib/doc/publictoip6.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/publictoip6.md 2016-05-10 18:59:01.906033221 -0400 @@ -0,0 +1,14 @@ -+publictoip6(1) -- write random bytes generated via libnacl to stdout ++publictoip6(1) -- Derive cjdns IP6 address from a public key +============================================= + +## SYNOPSIS @@ -261,8 +267,8 @@ diff -up ./contrib/doc/publictoip6.md.man ./contrib/doc/publictoip6.md + +randombytes(1) diff -up ./contrib/doc/randombytes.md.man ./contrib/doc/randombytes.md ---- ./contrib/doc/randombytes.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/randombytes.md 2016-05-03 22:06:45.844528970 -0400 +--- ./contrib/doc/randombytes.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/randombytes.md 2016-05-10 18:55:17.290488610 -0400 @@ -0,0 +1,16 @@ +randombytes(1) -- write random bytes generated via libnacl to stdout +============================================= @@ -281,8 +287,8 @@ diff -up ./contrib/doc/randombytes.md.man ./contrib/doc/randombytes.md + +makekeys(1) diff -up ./contrib/doc/sessionStats.md.man ./contrib/doc/sessionStats.md ---- ./contrib/doc/sessionStats.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/sessionStats.md 2016-05-03 22:09:39.354511569 -0400 +--- ./contrib/doc/sessionStats.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/sessionStats.md 2016-05-10 18:55:17.290488610 -0400 @@ -0,0 +1,39 @@ +sessionStats(1) -- show cjdns crypto sessions +============================================= @@ -324,8 +330,8 @@ diff -up ./contrib/doc/sessionStats.md.man ./contrib/doc/sessionStats.md + +cjdroute(1), peerStats(1) diff -up ./contrib/doc/sybilsim.md.man ./contrib/doc/sybilsim.md ---- ./contrib/doc/sybilsim.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/sybilsim.md 2016-05-03 22:06:45.844528970 -0400 +--- ./contrib/doc/sybilsim.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/sybilsim.md 2016-05-10 18:55:17.290488610 -0400 @@ -0,0 +1,43 @@ +sybilsim(8) -- Cjdns packet switch +============================================= @@ -371,8 +377,8 @@ diff -up ./contrib/doc/sybilsim.md.man ./contrib/doc/sybilsim.md + +makekeys(1), cjdroute(1) diff -up ./contrib/doc/traceroute.md.man ./contrib/doc/traceroute.md ---- ./contrib/doc/traceroute.md.man 2016-05-03 22:06:45.844528970 -0400 -+++ ./contrib/doc/traceroute.md 2016-05-03 22:10:00.344748050 -0400 +--- ./contrib/doc/traceroute.md.man 2016-05-10 18:55:17.290488610 -0400 ++++ ./contrib/doc/traceroute.md 2016-05-10 18:55:17.290488610 -0400 @@ -0,0 +1,33 @@ +cjdns-traceroute(1) -- trace cjdns packet routing +============================================= From cef3e376829f47d45e0e5a0cb85d6167f9f80237 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Thu, 23 Jun 2016 17:22:04 -0400 Subject: [PATCH 3/5] Update to upstream release 17.4 --- .gitignore | 1 + cjdns.spec | 14 +++++++++----- cjdns.warnings.patch | 45 +------------------------------------------- sources | 1 + 4 files changed, 12 insertions(+), 49 deletions(-) diff --git a/.gitignore b/.gitignore index 93a64fb..697fa3e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /cjdns-v17.3.tar.gz +/cjdns-v17.4.tar.gz diff --git a/cjdns.spec b/cjdns.spec index 2fdbe09..0bb91b0 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -38,8 +38,8 @@ Name: cjdns # major version is cjdns protocol version: -Version: 17.3 -Release: 13%{?dist} +Version: 17.4 +Release: 1%{?dist} Summary: The privacy-friendly network without borders Group: System Environment/Base # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC @@ -75,7 +75,7 @@ Patch5: cjdns.sbin.patch # Patch make.js to use dynamic nacl library Patch6: cjdns.dyn.patch # Patch to use _LINUX_CAPABILITY_3 -Patch7: cjdns.cap3.patch +#Patch7: cjdns.cap3.patch # Patch some source files to ignore selected warnings that break gcc6 builds Patch8: cjdns.warnings.patch # Man pages @@ -187,8 +187,6 @@ elif test -d %{_includedir}/nacl && test -r %{_libdir}/libnacl.a; then fi %endif -%patch7 -b .cap3 - %if !0%{?rhel} || 0%{?rhel} > 6 %patch8 -b .warnings %endif @@ -470,9 +468,15 @@ fi %{_bindir}/graphStats %changelog +* Thu Jun 23 2016 Stuart D. Gathman 17.4-1 +- Update to 17.4 upstream release +- Remove cap3 patch, as it is incorporated upstream +- Remove Constant.js patch, as it is incorporated upstream + * Tue May 3 2016 Stuart D. Gathman 17.3-13 - man page for cjdnslog - Fix running on Fedora as well as openVZ. :-P +- Make cjdns exclusive to nodejs_arches. Rafael Fonseca * Mon Apr 18 2016 Stuart D. Gathman 17.3-12 - Run modprobe only if /dev/tun not present - fixes running on openVZ diff --git a/cjdns.warnings.patch b/cjdns.warnings.patch index 62b4860..8fc61ad 100644 --- a/cjdns.warnings.patch +++ b/cjdns.warnings.patch @@ -51,40 +51,6 @@ diff -up ./node_build/dependencies/libuv/test/test-getsockname.c.warnings ./node #include "uv.h" #include "task.h" -diff -up ./util/Constant.js.warnings ./util/Constant.js ---- ./util/Constant.js.warnings 2016-05-09 16:26:54.865933415 -0400 -+++ ./util/Constant.js 2016-05-09 16:30:00.541056943 -0400 -@@ -62,20 +62,23 @@ var base2 = module.exports.base2 = funct - return '((' + type + ') 0x' + base2ToHex(numStr) + ((type === 'uint64_t') ? 'ull' : 'ul') + ')'; - }; - -+var randomHex = function (bytes) { -+ var hex = ''; -+ var len = Number(bytes * 2); // One byte is two hex digits -+ while (hex.length < len) { hex += Math.random().toString(16).substring(2); } -+ return hex.substring(0,len); -+}; -+ - var rand64 = module.exports.rand64 = function () { -- return '((uint64_t) 0x' + -- (Math.random().toString(16) + Math.random().toString(16)).replace(/0\./g, '') + 'ull)'; -+ return '((uint64_t) 0x' + randomHex(64 / 8) + 'ull)'; - }; - - var rand32 = module.exports.rand32 = function () { -- return '((uint32_t) 0x' + Math.random().toString(16).replace(/0\./g, '') + 'ul)'; -+ return '((uint32_t) 0x' + randomHex(32 / 8) + 'ul)'; - }; - - var randHexString = module.exports.randHexString = function (lenStr) { -- var hex = ''; -- var len = Number(lenStr); -- while (hex.length < len) { hex += Math.random().toString(16).substring(2); } -- return '"' + hex.substring(0,len) + '"'; -+ return '"' + randomHex(lenStr / 2) + '"'; - }; - - var log2 = module.exports.log2 = function (val) { diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/netdev/NetPlatform_linux.c --- ./util/platform/netdev/NetPlatform_linux.c.warnings 2016-01-27 03:07:49.000000000 -0500 +++ ./util/platform/netdev/NetPlatform_linux.c 2016-05-03 22:06:45.842528947 -0400 @@ -92,20 +58,11 @@ diff -up ./util/platform/netdev/NetPlatform_linux.c.warnings ./util/platform/net Except_throw(eh, "ioctl(SIOCSIFADDR) failed: [%s]", strerror(err)); } -- uint32_t x = ~0 << (32 - prefixLen); +- uint32_t x = (uint32_t)~0 << (32 - prefixLen); + uint32_t x = ~0U << (32 - prefixLen); x = Endian_hostToBigEndian32(x); memcpy(&sin.sin_addr, &x, 4); memcpy(&ifRequest.ifr_addr, &sin, sizeof(struct sockaddr_in)); -@@ -213,7 +213,7 @@ void NetPlatform_addRoute(const char* in - struct sockaddr_in sin = { .sin_family = AF_INET, .sin_port = 0 }; - memcpy(&sin.sin_addr.s_addr, address, 4); - memcpy(&rt.rt_dst, &sin, sizeof(struct sockaddr)); -- sin.sin_addr.s_addr = Endian_hostToBigEndian32(~0 << (32 - prefixLen)); -+ sin.sin_addr.s_addr = Endian_hostToBigEndian32(~0U << (32 - prefixLen)); - memcpy(&rt.rt_genmask, &sin, sizeof(struct sockaddr)); - rt.rt_dev = (char *) interfaceName; - diff -up ./util/platform/Sockaddr.c.warnings ./util/platform/Sockaddr.c --- ./util/platform/Sockaddr.c.warnings 2016-01-27 03:07:49.000000000 -0500 +++ ./util/platform/Sockaddr.c 2016-05-03 22:06:45.842528947 -0400 diff --git a/sources b/sources index 2b2daa2..762a857 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ efc62329874a0620a532269a53dbfc85 cjdns-v17.3.tar.gz +e74f25941879e807086a8b70771fcf60 cjdns-v17.4.tar.gz From e8dd73a14a020599f232eaec5d99956818638646 Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Thu, 23 Jun 2016 18:02:04 -0400 Subject: [PATCH 4/5] Move tool man pages to tool subpackage --- cjdns.spec | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cjdns.spec b/cjdns.spec index 0bb91b0..785bd82 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -39,7 +39,7 @@ Name: cjdns # major version is cjdns protocol version: Version: 17.4 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The privacy-friendly network without borders Group: System Environment/Base # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC @@ -351,7 +351,6 @@ done %{_bindir}/publictoip6 %{_bindir}/makekeys %{_bindir}/cjdns-online -%{_mandir}/man1/* %{_mandir}/man5/* %{_mandir}/man8/* %{_mandir}/man1/cjdns-online.1.gz @@ -468,6 +467,9 @@ fi %{_bindir}/graphStats %changelog +* Thu Jun 23 2016 Stuart D. Gathman 17.4-2 +- Move tool manpages to tool subpackage. + * Thu Jun 23 2016 Stuart D. Gathman 17.4-1 - Update to 17.4 upstream release - Remove cap3 patch, as it is incorporated upstream From a92f07739d9ce4f7617b89097170948d5f204b9a Mon Sep 17 00:00:00 2001 From: "Stuart D. Gathman" Date: Thu, 23 Jun 2016 23:01:24 -0400 Subject: [PATCH 5/5] Remove cjdns-resume.service patch, incorporated upstream Add --interface option to cjdns-online.sh --- cjdns.sbin.patch | 53 ++++++++++++++++++++++++------------------------ cjdns.spec | 6 +++++- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/cjdns.sbin.patch b/cjdns.sbin.patch index ac13b37..fecb18c 100644 --- a/cjdns.sbin.patch +++ b/cjdns.sbin.patch @@ -1,7 +1,7 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.sh ---- ./contrib/systemd/cjdns-online.sh.sbin 2016-05-03 22:06:45.820528693 -0400 -+++ ./contrib/systemd/cjdns-online.sh 2016-05-03 22:06:45.820528693 -0400 -@@ -0,0 +1,75 @@ +--- ./contrib/systemd/cjdns-online.sh.sbin 2016-06-23 22:49:23.703114380 -0400 ++++ ./contrib/systemd/cjdns-online.sh 2016-06-23 22:51:50.666731442 -0400 +@@ -0,0 +1,90 @@ +#!/bin/sh +# Check whether cjdns IPs are available +# Copyright (C) 2016 Stuart D. Gathman @@ -27,6 +27,14 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s + done +} + ++cjdns_dev() { ++ ip -6 -o addr | while read i dev fam ip rem; do ++ case "$ip" in ++ fc*:*/8) echo "${dev}";; ++ esac ++ done ++} ++ +die() { + echo "$1" >&2 + exit 1 @@ -34,8 +42,8 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s + +PROGRAM_NAME="/usr/bin/cjdns-online" + -+ARGS=$(getopt -n $PROGRAM_NAME -o t:xqsh \ -+ --long timeout:,exit,quiet,wait-for-startup,help -- "$@") ++ARGS=$(getopt -n $PROGRAM_NAME -o t:xiqsh \ ++ --long timeout:,exit,interface,quiet,wait-for-startup,help -- "$@") + +# Die if they fat finger arguments, this program may be run as root +[ $? = 0 ] || die "Error parsing arguments. Try $PROGRAM_NAME --help" @@ -44,6 +52,7 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s + cat < time to wait in seconds, default 30 ++ -i, --interface output interface name instead of ip + -x, --exit exit immediately if cjdns is not online + -q, --quiet don't print anything + -s, --wait-for-startup wait for full startup instead of just tun dev @@ -55,11 +64,13 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s +let nowait="0" +let quiet="0" +let startup="0" ++let interface="0" + +eval set -- "$ARGS" +while true; do + case "$1" in + -t|--timeout) let timeout="$2" || help; shift 2; continue;; ++ -i|--interface) let interface="1"; shift;; + -x|--exit) let nowait="1"; shift;; + -q|--quiet) let quiet="1"; shift;; + -s|--wait-for-startup) let startup="1"; shift;; @@ -75,25 +86,15 @@ diff -up ./contrib/systemd/cjdns-online.sh.sbin ./contrib/systemd/cjdns-online.s + sleep 2 +done +if [ "$quiet" -eq 0 ]; then -+ cjdns_ips ++ if [ "$interface" -eq 0 ]; then ++ cjdns_ips ++ else ++ cjdns_dev ++ fi +fi -diff -up ./contrib/systemd/cjdns-resume.service.sbin ./contrib/systemd/cjdns-resume.service ---- ./contrib/systemd/cjdns-resume.service.sbin 2016-05-03 22:06:45.820528693 -0400 -+++ ./contrib/systemd/cjdns-resume.service 2016-05-03 22:06:45.820528693 -0400 -@@ -0,0 +1,10 @@ -+[Unit] -+Description=Restart cjdns on resume from sleep -+After=sleep.target -+ -+[Service] -+Type=oneshot -+ExecStart=/usr/bin/systemctl restart cjdns -+ -+[Install] -+WantedBy=sleep.target diff -up ./contrib/systemd/cjdns.service.sbin ./contrib/systemd/cjdns.service ---- ./contrib/systemd/cjdns.service.sbin 2016-01-27 03:07:49.000000000 -0500 -+++ ./contrib/systemd/cjdns.service 2016-05-03 22:50:07.241986902 -0400 +--- ./contrib/systemd/cjdns.service.sbin 2016-06-14 17:58:54.000000000 -0400 ++++ ./contrib/systemd/cjdns.service 2016-06-23 22:49:23.703114380 -0400 @@ -9,10 +9,11 @@ ProtectSystem=true SyslogIdentifier=cjdroute ExecStartPre=/bin/sh -ec "if ! test -s /etc/cjdroute.conf; \ @@ -110,8 +111,8 @@ diff -up ./contrib/systemd/cjdns.service.sbin ./contrib/systemd/cjdns.service [Install] diff -up ./contrib/systemd/cjdns-wait-online.service.sbin ./contrib/systemd/cjdns-wait-online.service ---- ./contrib/systemd/cjdns-wait-online.service.sbin 2016-05-03 22:06:45.820528693 -0400 -+++ ./contrib/systemd/cjdns-wait-online.service 2016-05-03 22:06:45.820528693 -0400 +--- ./contrib/systemd/cjdns-wait-online.service.sbin 2016-06-23 22:49:23.703114380 -0400 ++++ ./contrib/systemd/cjdns-wait-online.service 2016-06-23 22:49:23.703114380 -0400 @@ -0,0 +1,13 @@ +[Unit] +Description=CJDNS Wait Online @@ -127,8 +128,8 @@ diff -up ./contrib/systemd/cjdns-wait-online.service.sbin ./contrib/systemd/cjdn +[Install] +WantedBy=multi-user.target diff -up ./contrib/upstart/cjdns.conf.sbin ./contrib/upstart/cjdns.conf ---- ./contrib/upstart/cjdns.conf.sbin 2016-01-27 03:07:49.000000000 -0500 -+++ ./contrib/upstart/cjdns.conf 2016-05-03 22:45:32.931860381 -0400 +--- ./contrib/upstart/cjdns.conf.sbin 2016-06-14 17:58:54.000000000 -0400 ++++ ./contrib/upstart/cjdns.conf 2016-06-23 22:49:23.703114380 -0400 @@ -13,10 +13,16 @@ pre-start script if ! [ -s /etc/cjdroute.conf ]; then ( # start a subshell to avoid side effects of umask later on diff --git a/cjdns.spec b/cjdns.spec index 785bd82..2084467 100644 --- a/cjdns.spec +++ b/cjdns.spec @@ -39,7 +39,7 @@ Name: cjdns # major version is cjdns protocol version: Version: 17.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: The privacy-friendly network without borders Group: System Environment/Base # cjdns is all GPLv3 except libuv which is MIT and BSD and ISC @@ -467,6 +467,10 @@ fi %{_bindir}/graphStats %changelog +* Thu Jun 23 2016 Stuart D. Gathman 17.4-3 +- Remove cjdns-resume.service patch, incorporated upstream +- Add --interface option to cjdns-online.sh + * Thu Jun 23 2016 Stuart D. Gathman 17.4-2 - Move tool manpages to tool subpackage.