summaryrefslogtreecommitdiff
path: root/net-p2p/transmission/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-p2p/transmission/files
reinit the tree, so we can have metadata
Diffstat (limited to 'net-p2p/transmission/files')
-rw-r--r--net-p2p/transmission/files/libsystemd.patch11
-rw-r--r--net-p2p/transmission/files/transmission-2.92-handshake.patch33
-rw-r--r--net-p2p/transmission/files/transmission-daemon.confd.415
-rw-r--r--net-p2p/transmission/files/transmission-daemon.initd.1049
-rw-r--r--net-p2p/transmission/files/transmission-daemon.service.conf2
5 files changed, 110 insertions, 0 deletions
diff --git a/net-p2p/transmission/files/libsystemd.patch b/net-p2p/transmission/files/libsystemd.patch
new file mode 100644
index 000000000000..5db47ef39bd9
--- /dev/null
+++ b/net-p2p/transmission/files/libsystemd.patch
@@ -0,0 +1,11 @@
+--- a/configure.ac
++++ b/configure.ac
+@@ -245,7 +245,7 @@
+ [Add support for systemd startup notification (default is autodetected)]),
+ [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto])
+ AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [
+- PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
++ PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd],
+ [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])],
+ [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"],
+ [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])]
diff --git a/net-p2p/transmission/files/transmission-2.92-handshake.patch b/net-p2p/transmission/files/transmission-2.92-handshake.patch
new file mode 100644
index 000000000000..a30cd583fae0
--- /dev/null
+++ b/net-p2p/transmission/files/transmission-2.92-handshake.patch
@@ -0,0 +1,33 @@
+commit 4c00df9463ea4fd70b73c620e439f5c3ee5efa60
+Author: Mike Gelfand <mikedld@mikedld.com>
+Date: Sun Sep 18 13:58:15 2016 +0300
+
+ Abort handshake if establishing DH shared secret fails
+
+ Fixes #27
+
+diff --git a/libtransmission/handshake.c b/libtransmission/handshake.c
+index c728696..e7ff131 100644
+--- a/libtransmission/handshake.c
++++ b/libtransmission/handshake.c
+@@ -425,7 +425,8 @@ readYb (tr_handshake * handshake, struct evbuffer * inbuf)
+
+ /* compute the secret */
+ evbuffer_remove (inbuf, yb, KEY_LEN);
+- tr_cryptoComputeSecret (handshake->crypto, yb);
++ if (!tr_cryptoComputeSecret (handshake->crypto, yb))
++ return tr_handshakeDone (handshake, false);
+
+ /* now send these: HASH ('req1', S), HASH ('req2', SKEY) xor HASH ('req3', S),
+ * ENCRYPT (VC, crypto_provide, len (PadC), PadC, len (IA)), ENCRYPT (IA) */
+@@ -741,7 +742,9 @@ readYa (tr_handshake * handshake,
+
+ /* read the incoming peer's public key */
+ evbuffer_remove (inbuf, ya, KEY_LEN);
+- tr_cryptoComputeSecret (handshake->crypto, ya);
++ if (!tr_cryptoComputeSecret (handshake->crypto, ya))
++ return tr_handshakeDone (handshake, false);
++
+ computeRequestHash (handshake, "req1", handshake->myReq1);
+
+ /* send our public key to the peer */
diff --git a/net-p2p/transmission/files/transmission-daemon.confd.4 b/net-p2p/transmission/files/transmission-daemon.confd.4
new file mode 100644
index 000000000000..64ecd8091a3a
--- /dev/null
+++ b/net-p2p/transmission/files/transmission-daemon.confd.4
@@ -0,0 +1,15 @@
+# This is the transmission-daemon configuration file. For other options and
+# better explanation, take a look at transmission-daemon manual page Note: it's
+# better to configure some settings (like username/password) in
+# /var/lib/transmission/config/settings.json to avoid other users see it with `ps`
+
+# Parameters to pass to transmission-daemon
+# TRANSMISSION_OPTIONS=""
+
+# Run daemon as another user (username or username:groupname)
+# If you change this setting, chown -R /var/lib/transmission/config <and download directory, check web settings>
+#runas_user=transmission
+
+# Location of logfile (should be writeable for runas_user user)
+# Set logfile=syslog to use syslog for logging
+#logfile=/var/log/transmission/transmission.log
diff --git a/net-p2p/transmission/files/transmission-daemon.initd.10 b/net-p2p/transmission/files/transmission-daemon.initd.10
new file mode 100644
index 000000000000..a8afd2a243dd
--- /dev/null
+++ b/net-p2p/transmission/files/transmission-daemon.initd.10
@@ -0,0 +1,49 @@
+#!/sbin/openrc-run
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+command="/usr/bin/transmission-daemon"
+extra_started_commands="reload"
+description="Transmission is a fast, easy and free bittorrent client"
+description_start="Start transmission-daemon server and web interface"
+description_stop="Stop transmission-daemon server and web interface"
+description_reload="Reload transmission-daemon settings"
+
+rundir=${rundir:-/var/run/transmission}
+pidfile=${pidfile:-${rundir}/transmission.pid}
+config_dir=${config_dir:-/var/lib/transmission/config}
+download_dir=${download_dir:-/var/lib/transmission/downloads}
+logfile=${logfile:-/var/log/transmission/transmission.log}
+runas_user=${runas_user:-transmission:transmission}
+
+retry="TERM/45/QUIT/15"
+
+start_pre() {
+ command_args="--config-dir ${config_dir} --pid-file ${pidfile}"
+ command_user="${runas_user}"
+
+ # Call mkdir -p in case parent dirs are missing
+ mkdir -p "${rundir}" "${config_dir}" "${download_dir}"
+
+ # Call checkpath to fixup permissions
+ checkpath -d -o "${runas_user}" "${rundir}" "${config_dir}" "${download_dir}" || return
+
+ if [ ! -e "${config_dir}/settings.json" ]; then
+ # Only set download dir if settings don't exist
+ # https://bugs.gentoo.org/576640
+ command_args="${command_args} --download-dir ${download_dir}"
+ fi
+
+ if [ "${logfile}" != syslog ]; then
+ checkpath -d -o "${runas_user}" /var/log/transmission || return
+ command_args="${command_args} --logfile ${logfile}"
+ fi
+
+ command_args="${command_args} ${TRANSMISSION_OPTIONS}"
+}
+
+reload() {
+ ebegin "Reloading ${RC_SVCNAME}"
+ start-stop-daemon --signal HUP --exec "${command}" --pidfile "${pidfile}"
+ eend $?
+}
diff --git a/net-p2p/transmission/files/transmission-daemon.service.conf b/net-p2p/transmission/files/transmission-daemon.service.conf
new file mode 100644
index 000000000000..ae543ca3f08f
--- /dev/null
+++ b/net-p2p/transmission/files/transmission-daemon.service.conf
@@ -0,0 +1,2 @@
+[Service]
+Environment=TRANSMISSION_HOME=/var/lib/transmission/config