From 818b44cc7c22696a3206229e4e15eeb9f130e2c0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 8 Dec 2016 12:10:06 -0500 Subject: Repair the (deprecated, ugly) DROPGUARDS controller function. This actually is much easier to write now that guard_selection_t is first-class. --- src/or/control.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/or/control.c') diff --git a/src/or/control.c b/src/or/control.c index 364d75c976..857b7325ae 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -4064,17 +4064,20 @@ handle_control_dropguards(control_connection_t *conn, smartlist_split_string(args, body, " ", SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); -#ifdef ENABLE_LEGACY_GUARD_ALGORITHM + static int have_warned = 0; + if (! have_warned) { + log_warn(LD_CONTROL, "DROPGUARDS is dangerous; make sure you understand " + "the risks before using it. It may be removed in a future " + "version of Tor."); + have_warned = 1; + } + if (smartlist_len(args)) { connection_printf_to_buf(conn, "512 Too many arguments to DROPGUARDS\r\n"); } else { remove_all_entry_guards(); send_control_done(conn); } -#else - // XXXX - connection_printf_to_buf(conn, "512 not supported\r\n"); -#endif SMARTLIST_FOREACH(args, char *, cp, tor_free(cp)); smartlist_free(args); -- cgit v1.2.3-54-g00ecf