summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2018-02-01 13:18:47 +0100
committerMarius Bakke <mbakke@fastmail.com>2018-02-01 13:18:47 +0100
commitbee7bb315cd0b4529a4117b6220c29ca297fc023 (patch)
treefe4741f257e50782e51bc2955ad4480cd2ba6396 /gnu/packages/patches
parentc2f0e5a44b537632c2655f97a2539c3bf02c8a63 (diff)
parent8a4644336d5063fd0bf43e90e3c0823c76e82e4e (diff)
downloadguix-bee7bb315cd0b4529a4117b6220c29ca297fc023.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/python-axolotl-AES-fix.patch24
-rw-r--r--gnu/packages/patches/rsync-CVE-2017-16548.patch31
-rw-r--r--gnu/packages/patches/rsync-CVE-2017-17433-fix-tests.patch42
-rw-r--r--gnu/packages/patches/rsync-CVE-2017-17433.patch45
-rw-r--r--gnu/packages/patches/rsync-CVE-2017-17434-pt1.patch28
-rw-r--r--gnu/packages/patches/rsync-CVE-2017-17434-pt2.patch39
-rw-r--r--gnu/packages/patches/transmission-fix-dns-rebinding-vuln.patch302
7 files changed, 24 insertions, 487 deletions
diff --git a/gnu/packages/patches/python-axolotl-AES-fix.patch b/gnu/packages/patches/python-axolotl-AES-fix.patch
new file mode 100644
index 0000000000..d34f4855cb
--- /dev/null
+++ b/gnu/packages/patches/python-axolotl-AES-fix.patch
@@ -0,0 +1,24 @@
+Patch taken from the Debian package for python-axolotl-0.1.39.
+See <https://bugs.gnu.org/29415>.
+
+Description: Removes IV paramenter from AES constructor, since it is not necessary for ctr mode.
+Author: Josue Ortega <josue@debian.org>
+Last-Update: 2017-04-13
+
+--- a/axolotl/sessioncipher.py
++++ b/axolotl/sessioncipher.py
+@@ -228,13 +228,7 @@
+         # counterint = struct.unpack(">L", counterbytes)[0]
+         # counterint = int.from_bytes(counterbytes, byteorder='big')
+         ctr = Counter.new(128, initial_value=counter)
+-
+-        # cipher = AES.new(key, AES.MODE_CTR, counter=ctr)
+-        ivBytes = bytearray(16)
+-        ByteUtil.intToByteArray(ivBytes, 0, counter)
+-
+-        cipher = AES.new(key, AES.MODE_CTR, IV=bytes(ivBytes), counter=ctr)
+-
++        cipher = AES.new(key, AES.MODE_CTR, counter=ctr)
+         return cipher
+ 
+ 
diff --git a/gnu/packages/patches/rsync-CVE-2017-16548.patch b/gnu/packages/patches/rsync-CVE-2017-16548.patch
deleted file mode 100644
index 52a75ea241..0000000000
--- a/gnu/packages/patches/rsync-CVE-2017-16548.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-https://bugzilla.samba.org/show_bug.cgi?id=13112
-https://git.samba.org/rsync.git/?p=rsync.git;a=patch;h=47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1
-
-From 47a63d90e71d3e19e0e96052bb8c6b9cb140ecc1 Mon Sep 17 00:00:00 2001
-From: Wayne Davison <wayned@samba.org>
-Date: Sun, 5 Nov 2017 11:33:15 -0800
-Subject: [PATCH] Enforce trailing \0 when receiving xattr name values. Fixes
- bug 13112.
-
----
- xattrs.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/xattrs.c b/xattrs.c
-index 68305d7..4867e6f 100644
---- a/xattrs.c
-+++ b/xattrs.c
-@@ -824,6 +824,10 @@ void receive_xattr(int f, struct file_struct *file)
- 			out_of_memory("receive_xattr");
- 		name = ptr + dget_len + extra_len;
- 		read_buf(f, name, name_len);
-+		if (name_len < 1 || name[name_len-1] != '\0') {
-+			rprintf(FERROR, "Invalid xattr name received (missing trailing \\0).\n");
-+			exit_cleanup(RERR_FILEIO);
-+		}
- 		if (dget_len == datum_len)
- 			read_buf(f, ptr, dget_len);
- 		else {
--- 
-1.9.1
-
diff --git a/gnu/packages/patches/rsync-CVE-2017-17433-fix-tests.patch b/gnu/packages/patches/rsync-CVE-2017-17433-fix-tests.patch
deleted file mode 100644
index 74bac0fc33..0000000000
--- a/gnu/packages/patches/rsync-CVE-2017-17433-fix-tests.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-https://git.samba.org/?p=rsync.git;a=patch;h=f5e8a17e093065fb20fea00a29540fe2c7896441
-minor edits were made to get the patch to apply
-
-From f5e8a17e093065fb20fea00a29540fe2c7896441 Mon Sep 17 00:00:00 2001
-From: Wayne Davison <wayned@samba.org>
-Date: Sun, 3 Dec 2017 15:49:56 -0800
-Subject: [PATCH] Fix issue with earlier path-check (fixes "make check") and
- make a BOOL more explicit.
-
----
- checksum.c |  2 +-
- receiver.c | 10 +++++-----
- 2 files changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/receiver.c b/receiver.c
-index 9c46242..75cb00d 100644
---- a/receiver.c
-+++ b/receiver.c
-@@ -574,15 +574,15 @@ int recv_files(int f_in, int f_out, char *local_name)
- 			file = dir_flist->files[cur_flist->parent_ndx];
- 		fname = local_name ? local_name : f_name(file, fbuf);
- 
--		if (daemon_filter_list.head
--		    && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
-+		if (DEBUG_GTE(RECV, 1))
-+			rprintf(FINFO, "recv_files(%s)\n", fname);
-+
-+		if (daemon_filter_list.head && (*fname != '.' || fname[1] != '\0')
-+		 && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
- 			rprintf(FERROR, "attempt to hack rsync failed.\n");
- 			exit_cleanup(RERR_PROTOCOL);
- 		}
- 
--		if (DEBUG_GTE(RECV, 1))
--			rprintf(FINFO, "recv_files(%s)\n", fname);
--
- #ifdef SUPPORT_XATTRS
- 		if (preserve_xattrs && iflags & ITEM_REPORT_XATTR && do_xfers
- 		 && !(want_xattr_optim && BITS_SET(iflags, ITEM_XNAME_FOLLOWS|ITEM_LOCAL_CHANGE)))
--- 
-1.9.1
-
diff --git a/gnu/packages/patches/rsync-CVE-2017-17433.patch b/gnu/packages/patches/rsync-CVE-2017-17433.patch
deleted file mode 100644
index 84e4067509..0000000000
--- a/gnu/packages/patches/rsync-CVE-2017-17433.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17433
-https://git.samba.org/?p=rsync.git;a=patch;h=3e06d40029cfdce9d0f73d87cfd4edaf54be9c51
-
-From 3e06d40029cfdce9d0f73d87cfd4edaf54be9c51 Mon Sep 17 00:00:00 2001
-From: Jeriko One <jeriko.one@gmx.us>
-Date: Thu, 2 Nov 2017 23:44:19 -0700
-Subject: [PATCH] Check fname in recv_files sooner.
-
----
- receiver.c | 12 ++++++------
- 1 file changed, 6 insertions(+), 6 deletions(-)
-
-diff --git a/receiver.c b/receiver.c
-index baae3a9..9fdafa1 100644
---- a/receiver.c
-+++ b/receiver.c
-@@ -574,6 +574,12 @@ int recv_files(int f_in, int f_out, char *local_name)
- 			file = dir_flist->files[cur_flist->parent_ndx];
- 		fname = local_name ? local_name : f_name(file, fbuf);
- 
-+		if (daemon_filter_list.head
-+		    && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
-+			rprintf(FERROR, "attempt to hack rsync failed.\n");
-+			exit_cleanup(RERR_PROTOCOL);
-+		}
-+
- 		if (DEBUG_GTE(RECV, 1))
- 			rprintf(FINFO, "recv_files(%s)\n", fname);
- 
-@@ -645,12 +651,6 @@ int recv_files(int f_in, int f_out, char *local_name)
- 
- 		cleanup_got_literal = 0;
- 
--		if (daemon_filter_list.head
--		    && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0) {
--			rprintf(FERROR, "attempt to hack rsync failed.\n");
--			exit_cleanup(RERR_PROTOCOL);
--		}
--
- 		if (read_batch) {
- 			int wanted = redoing
- 				   ? we_want_redo(ndx)
--- 
-1.9.1
-
diff --git a/gnu/packages/patches/rsync-CVE-2017-17434-pt1.patch b/gnu/packages/patches/rsync-CVE-2017-17434-pt1.patch
deleted file mode 100644
index 0d9298743d..0000000000
--- a/gnu/packages/patches/rsync-CVE-2017-17434-pt1.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17434
-https://git.samba.org/?p=rsync.git;a=patch;h=5509597decdbd7b91994210f700329d8a35e70a1
-
-From 5509597decdbd7b91994210f700329d8a35e70a1 Mon Sep 17 00:00:00 2001
-From: Jeriko One <jeriko.one@gmx.us>
-Date: Thu, 16 Nov 2017 17:26:03 -0800
-Subject: [PATCH] Check daemon filter against fnamecmp in recv_files().
-
----
- receiver.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/receiver.c b/receiver.c
-index 9fdafa1..9c46242 100644
---- a/receiver.c
-+++ b/receiver.c
-@@ -722,7 +722,7 @@ int recv_files(int f_in, int f_out, char *local_name)
- 				break;
- 			}
- 			if (!fnamecmp || (daemon_filter_list.head
--			  && check_filter(&daemon_filter_list, FLOG, fname, 0) < 0)) {
-+			  && check_filter(&daemon_filter_list, FLOG, fnamecmp, 0) < 0)) {
- 				fnamecmp = fname;
- 				fnamecmp_type = FNAMECMP_FNAME;
- 			}
--- 
-1.9.1
-
diff --git a/gnu/packages/patches/rsync-CVE-2017-17434-pt2.patch b/gnu/packages/patches/rsync-CVE-2017-17434-pt2.patch
deleted file mode 100644
index fad19d01fb..0000000000
--- a/gnu/packages/patches/rsync-CVE-2017-17434-pt2.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-17434
-https://git.samba.org/?p=rsync.git;a=patch;h=70aeb5fddd1b2f8e143276f8d5a085db16c593b9
-
-From 70aeb5fddd1b2f8e143276f8d5a085db16c593b9 Mon Sep 17 00:00:00 2001
-From: Jeriko One <jeriko.one@gmx.us>
-Date: Thu, 16 Nov 2017 17:05:42 -0800
-Subject: [PATCH] Sanitize xname in read_ndx_and_attrs.
-
----
- rsync.c | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/rsync.c b/rsync.c
-index b82e598..a0945ba 100644
---- a/rsync.c
-+++ b/rsync.c
-@@ -49,6 +49,7 @@ extern int flist_eof;
- extern int file_old_total;
- extern int keep_dirlinks;
- extern int make_backups;
-+extern int sanitize_paths;
- extern struct file_list *cur_flist, *first_flist, *dir_flist;
- extern struct chmod_mode_struct *daemon_chmod_modes;
- #ifdef ICONV_OPTION
-@@ -396,6 +397,11 @@ int read_ndx_and_attrs(int f_in, int f_out, int *iflag_ptr, uchar *type_ptr,
- 	if (iflags & ITEM_XNAME_FOLLOWS) {
- 		if ((len = read_vstring(f_in, buf, MAXPATHLEN)) < 0)
- 			exit_cleanup(RERR_PROTOCOL);
-+
-+		if (sanitize_paths) {
-+			sanitize_path(buf, buf, "", 0, SP_DEFAULT);
-+			len = strlen(buf);
-+		}
- 	} else {
- 		*buf = '\0';
- 		len = -1;
--- 
-1.9.1
-
diff --git a/gnu/packages/patches/transmission-fix-dns-rebinding-vuln.patch b/gnu/packages/patches/transmission-fix-dns-rebinding-vuln.patch
deleted file mode 100644
index a3a0cf1608..0000000000
--- a/gnu/packages/patches/transmission-fix-dns-rebinding-vuln.patch
+++ /dev/null
@@ -1,302 +0,0 @@
-Fix a weakness that allows remote code execution via the Transmission
-RPC server using DNS rebinding:
-
-https://bugs.chromium.org/p/project-zero/issues/detail?id=1447
-
-Patch adapted from Tavis Ormandy's patch on the Transmission master
-branch to the Transmission 2.92 release by Leo Famulari
-<leo@famulari.name>:
-
-https://github.com/transmission/transmission/pull/468/commits
-
-From fe2d3c6e75088f3d9b6040ce06da3d530358bc2f Mon Sep 17 00:00:00 2001
-From: Tavis Ormandy <taviso@google.com>
-Date: Thu, 11 Jan 2018 10:00:41 -0800
-Subject: [PATCH] mitigate dns rebinding attacks against daemon
-
----
- libtransmission/quark.c        |   2 + 
- libtransmission/quark.h        |   2 + 
- libtransmission/rpc-server.c   | 116 +++++++++++++++++++++++++++++++++++++----
- libtransmission/rpc-server.h   |   4 ++
- libtransmission/session.c      |   2 + 
- libtransmission/transmission.h |   1 + 
- libtransmission/web.c          |   3 ++
- 7 files changed, 121 insertions(+), 9 deletions(-)
-
-diff --git a/libtransmission/quark.c b/libtransmission/quark.c
-index 30cc2bca4..b4fd7aabd 100644
---- a/libtransmission/quark.c
-+++ b/libtransmission/quark.c
-@@ -289,6 +289,8 @@ static const struct tr_key_struct my_static[] =
-   { "rpc-authentication-required", 27 },
-   { "rpc-bind-address", 16 },
-   { "rpc-enabled", 11 },
-+  { "rpc-host-whitelist", 18 },
-+  { "rpc-host-whitelist-enabled", 26 },
-   { "rpc-password", 12 },
-   { "rpc-port", 8 },
-   { "rpc-url", 7 },
-diff --git a/libtransmission/quark.h b/libtransmission/quark.h
-index 7f5212733..17464be8f 100644
---- a/libtransmission/quark.h
-+++ b/libtransmission/quark.h
-@@ -291,6 +291,8 @@ enum
-   TR_KEY_rpc_authentication_required,
-   TR_KEY_rpc_bind_address,
-   TR_KEY_rpc_enabled,
-+  TR_KEY_rpc_host_whitelist,
-+  TR_KEY_rpc_host_whitelist_enabled,
-   TR_KEY_rpc_password,
-   TR_KEY_rpc_port,
-   TR_KEY_rpc_url,
-diff --git a/libtransmission/rpc-server.c b/libtransmission/rpc-server.c
-index a3485f3fa..292cd5fce 100644
---- a/libtransmission/rpc-server.c
-+++ b/libtransmission/rpc-server.c
-@@ -52,6 +52,7 @@ struct tr_rpc_server
-     bool               isEnabled;
-     bool               isPasswordEnabled;
-     bool               isWhitelistEnabled;
-+    bool               isHostWhitelistEnabled;
-     tr_port            port;
-     char             * url;
-     struct in_addr     bindAddress;
-@@ -63,6 +64,7 @@ struct tr_rpc_server
-     char             * password;
-     char             * whitelistStr;
-     tr_list          * whitelist;
-+    tr_list          * hostWhitelist;
- 
-     char             * sessionId;
-     time_t             sessionIdExpiresAt;
-@@ -588,6 +590,49 @@ isAddressAllowed (const tr_rpc_server * server, const char * address)
-   return false;
- }
- 
-+static bool isHostnameAllowed(tr_rpc_server const* server, struct evhttp_request* req)
-+{
-+    /* If password auth is enabled, any hostname is permitted. */
-+    if (server->isPasswordEnabled)
-+    {
-+        return true;
-+    }
-+
-+    char const* const host = evhttp_find_header(req->input_headers, "Host");
-+
-+    // If whitelist is disabled, no restrictions.
-+    if (!server->isHostWhitelistEnabled)
-+        return true;
-+
-+    /* No host header, invalid request. */
-+    if (host == NULL)
-+    {
-+        return false;
-+    }
-+
-+    /* Host header might include the port. */
-+    char* const hostname = tr_strndup(host, strcspn(host, ":"));
-+
-+    /* localhost or ipaddress is always acceptable. */
-+    if (strcmp(hostname, "localhost") == 0 || strcmp(hostname, "localhost.") == 0 || tr_addressIsIP(hostname))
-+    {
-+        tr_free(hostname);
-+        return true;
-+    }
-+
-+    /* Otherwise, hostname must be whitelisted. */
-+    for (tr_list* l = server->hostWhitelist; l != NULL; l = l->next) {
-+        if (tr_wildmat(hostname, l->data))
-+        {
-+            tr_free(hostname);
-+            return true;
-+        }
-+    }
-+
-+    tr_free(hostname);
-+    return false;
-+}
-+
- static bool
- test_session_id (struct tr_rpc_server * server, struct evhttp_request * req)
- {
-@@ -663,6 +708,23 @@ handle_request (struct evhttp_request * req, void * arg)
-           handle_upload (req, server);
-         }
- #ifdef REQUIRE_SESSION_ID
-+        else if (!isHostnameAllowed(server, req))
-+        {
-+            char* tmp = tr_strdup_printf(
-+                "<p>Transmission received your request, but the hostname was unrecognized.</p>"
-+                "<p>To fix this, choose one of the following options:"
-+                "<ul>"
-+                "<li>Enable password authentication, then any hostname is allowed.</li>"
-+                "<li>Add the hostname you want to use to the whitelist in settings.</li>"
-+                "</ul></p>"
-+                "<p>If you're editing settings.json, see the 'rpc-host-whitelist' and 'rpc-host-whitelist-enabled' entries.</p>"
-+                "<p>This requirement has been added to help prevent "
-+                "<a href=\"https://en.wikipedia.org/wiki/DNS_rebinding\">DNS Rebinding</a> "
-+                "attacks.</p>");
-+            send_simple_response(req, 421, tmp);
-+            tr_free(tmp);
-+        }
-+
-       else if (!test_session_id (server, req))
-         {
-           const char * sessionId = get_current_session_id (server);
-@@ -674,7 +736,7 @@ handle_request (struct evhttp_request * req, void * arg)
-             "<li> When you get this 409 error message, resend your request with the updated header"
-             "</ol></p>"
-             "<p>This requirement has been added to help prevent "
--            "<a href=\"http://en.wikipedia.org/wiki/Cross-site_request_forgery\">CSRF</a> "
-+            "<a href=\"https://en.wikipedia.org/wiki/Cross-site_request_forgery\">CSRF</a> "
-             "attacks.</p>"
-             "<p><code>%s: %s</code></p>",
-             TR_RPC_SESSION_ID_HEADER, sessionId);
-@@ -875,19 +937,14 @@ tr_rpcGetUrl (const tr_rpc_server * server)
-   return server->url ? server->url : "";
- }
- 
--void
--tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr)
-+static void
-+tr_rpcSetList (char const* whitelistStr, tr_list** list)
- {
-   void * tmp;
-   const char * walk;
- 
--  /* keep the string */
--  tmp = server->whitelistStr;
--  server->whitelistStr = tr_strdup (whitelistStr);
--  tr_free (tmp);
--
-   /* clear out the old whitelist entries */
--  while ((tmp = tr_list_pop_front (&server->whitelist)))
-+  while ((tmp = tr_list_pop_front (list)) != NULL)
-     tr_free (tmp);
- 
-   /* build the new whitelist entries */
-@@ -896,7 +953,7 @@ tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr)
-       const char * delimiters = " ,;";
-       const size_t len = strcspn (walk, delimiters);
-       char * token = tr_strndup (walk, len);
--      tr_list_append (&server->whitelist, token);
-+      tr_list_append (list, token);
-       if (strcspn (token, "+-") < len)
-         tr_logAddNamedInfo (MY_NAME, "Adding address to whitelist: %s (And it has a '+' or '-'!  Are you using an old ACL by mistake?)", token);
-       else
-@@ -909,6 +966,21 @@ tr_rpcSetWhitelist (tr_rpc_server * server, const char * whitelistStr)
-     }
- }
- 
-+void tr_rpcSetHostWhitelist(tr_rpc_server* server, char const* whitelistStr)
-+{
-+    tr_rpcSetList(whitelistStr, &server->hostWhitelist);
-+}
-+
-+void tr_rpcSetWhitelist(tr_rpc_server* server, char const* whitelistStr)
-+{
-+    /* keep the string */
-+    char* const tmp = server->whitelistStr;
-+    server->whitelistStr = tr_strdup(whitelistStr);
-+    tr_free(tmp);
-+
-+    tr_rpcSetList(whitelistStr, &server->whitelist);
-+}
-+
- const char*
- tr_rpcGetWhitelist (const tr_rpc_server * server)
- {
-@@ -930,6 +1002,11 @@ tr_rpcGetWhitelistEnabled (const tr_rpc_server * server)
-   return server->isWhitelistEnabled;
- }
- 
-+void tr_rpcSetHostWhitelistEnabled(tr_rpc_server* server, bool isEnabled)
-+{
-+    server->isHostWhitelistEnabled = isEnabled;
-+}
-+
- /****
- *****  PASSWORD
- ****/
-@@ -1063,6 +1140,28 @@ tr_rpcInit (tr_session  * session, tr_variant * settings)
-   else
-     tr_rpcSetWhitelistEnabled (s, boolVal);
- 
-+  key = TR_KEY_rpc_host_whitelist_enabled;
-+
-+  if (!tr_variantDictFindBool(settings, key, &boolVal))
-+  {
-+      missing_settings_key(key);
-+  }
-+  else
-+  {
-+      tr_rpcSetHostWhitelistEnabled(s, boolVal);
-+  }
-+
-+  key = TR_KEY_rpc_host_whitelist;
-+
-+  if (!tr_variantDictFindStr(settings, key, &str, NULL) && str != NULL)
-+  {
-+      missing_settings_key(key);
-+  }
-+  else
-+  {
-+      tr_rpcSetHostWhitelist(s, str);
-+  }
-+
-   key = TR_KEY_rpc_authentication_required;
-   if (!tr_variantDictFindBool (settings, key, &boolVal))
-     missing_settings_key (key);
-diff --git a/libtransmission/rpc-server.h b/libtransmission/rpc-server.h
-index e0302c5ea..8c9e6b24e 100644
---- a/libtransmission/rpc-server.h
-+++ b/libtransmission/rpc-server.h
-@@ -49,6 +49,10 @@ void            tr_rpcSetWhitelist (tr_rpc_server * server,
- 
- const char*     tr_rpcGetWhitelist (const tr_rpc_server * server);
- 
-+void tr_rpcSetHostWhitelistEnabled(tr_rpc_server* server, bool isEnabled);
-+
-+void tr_rpcSetHostWhitelist(tr_rpc_server* server, char const* whitelist);
-+
- void            tr_rpcSetPassword (tr_rpc_server * server,
-                                    const char *    password);
- 
-diff --git a/libtransmission/session.c b/libtransmission/session.c
-index 844cadba8..58b717913 100644
---- a/libtransmission/session.c
-+++ b/libtransmission/session.c
-@@ -359,6 +359,8 @@ tr_sessionGetDefaultSettings (tr_variant * d)
-   tr_variantDictAddStr  (d, TR_KEY_rpc_username,                    "");
-   tr_variantDictAddStr  (d, TR_KEY_rpc_whitelist,                   TR_DEFAULT_RPC_WHITELIST);
-   tr_variantDictAddBool (d, TR_KEY_rpc_whitelist_enabled,           true);
-+  tr_variantDictAddStr(d, TR_KEY_rpc_host_whitelist, TR_DEFAULT_RPC_HOST_WHITELIST);
-+  tr_variantDictAddBool(d, TR_KEY_rpc_host_whitelist_enabled, true);
-   tr_variantDictAddInt  (d, TR_KEY_rpc_port,                        atoi (TR_DEFAULT_RPC_PORT_STR));
-   tr_variantDictAddStr  (d, TR_KEY_rpc_url,                         TR_DEFAULT_RPC_URL_STR);
-   tr_variantDictAddBool (d, TR_KEY_scrape_paused_torrents_enabled,  true);
-diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h
-index 4f76adfd6..e213a8f4e 100644
---- a/libtransmission/transmission.h
-+++ b/libtransmission/transmission.h
-@@ -123,6 +123,7 @@ const char* tr_getDefaultDownloadDir (void);
- #define TR_DEFAULT_BIND_ADDRESS_IPV4        "0.0.0.0"
- #define TR_DEFAULT_BIND_ADDRESS_IPV6             "::"
- #define TR_DEFAULT_RPC_WHITELIST          "127.0.0.1"
-+#define TR_DEFAULT_RPC_HOST_WHITELIST              ""
- #define TR_DEFAULT_RPC_PORT_STR                "9091"
- #define TR_DEFAULT_RPC_URL_STR       "/transmission/"
- #define TR_DEFAULT_PEER_PORT_STR              "51413"
-diff --git a/libtransmission/web.c b/libtransmission/web.c
-index ee495e9fc..c7f062730 100644
---- a/libtransmission/web.c
-+++ b/libtransmission/web.c
-@@ -594,6 +594,7 @@ tr_webGetResponseStr (long code)
-       case 415: return "Unsupported Media Type";
-       case 416: return "Requested Range Not Satisfiable";
-       case 417: return "Expectation Failed";
-+      case 421: return "Misdirected Request";
-       case 500: return "Internal Server Error";
-       case 501: return "Not Implemented";
-       case 502: return "Bad Gateway";