From 5f76de579ad3e3a34ff75a64718857c26ccc3991 Mon Sep 17 00:00:00 2001 From: Yurii Kovalchuk <103324562+yumirkov@users.noreply.github.com> Date: Mon, 23 Sep 2024 16:04:38 +0300 Subject: [PATCH] ATOR-190 - Fail fast on terms disagreement (#90) --- src/app/config/config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/config/config.c b/src/app/config/config.c index afb2fee9ea..aaefc8ba16 100644 --- a/src/app/config/config.c +++ b/src/app/config/config.c @@ -4616,7 +4616,8 @@ options_init_from_torrc(int argc, char **argv) } if (!get_options_mutable()->AgreeToTerms && (argeement == NULL || strcmp(argeement, "agreed") != 0)) { - if (get_options_mutable()->RunAsDaemon) { + if (get_options_mutable()->RunAsDaemon || !isatty(STDIN_FILENO)) { // Non-interactive mode: Fail fast + log_err(LD_CONFIG, "User has not agreed to the terms and conditions. Exiting."); tor_asprintf(&errmsg, "Not agreed to terms"); retval = -1; goto err;