X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/a85c067ba6c6940512cf57ec213277a370d87e70..4687a69c269ee3f2a7f0625e0147a503fd9d3d0b:/src/src/routers/queryprogram.c diff --git a/src/src/routers/queryprogram.c b/src/src/routers/queryprogram.c index 51b7b7551..5f0f50cd9 100644 --- a/src/src/routers/queryprogram.c +++ b/src/src/routers/queryprogram.c @@ -2,12 +2,14 @@ * Exim - an Internet mail transport agent * *************************************************/ -/* Copyright (c) The Exim Maintainers 2020 - 2022 */ +/* Copyright (c) The Exim Maintainers 2020 - 2023 */ /* Copyright (c) University of Cambridge 1995 - 2018 */ /* See the file NOTICE for conditions of use and distribution. */ -/* SPDX-License-Identifier: GPL-2.0-only */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ #include "../exim.h" + +#ifdef ROUTER_QUERYPROGRAM /* Remainder of file */ #include "rf_functions.h" #include "queryprogram.h" @@ -287,12 +289,12 @@ if (curr_uid != root_uid && (uid != curr_uid || gid != curr_gid)) /* Set up the command to run */ +GET_OPTION("command"); if (!transport_set_up_command(&argvptr, /* anchor for arg list */ ob->command, /* raw command */ - TRUE, /* expand the arguments */ + TSUC_EXPAND_ARGS, /* arguments expanded but must not be tainted */ 0, /* not relevant when... */ NULL, /* no transporting address */ - FALSE, /* args must be untainted */ US"queryprogram router", /* for error messages */ &addr->message)) /* where to put error message */ return DEFER; @@ -361,10 +363,10 @@ buffer[len] = 0; DEBUG(D_route) debug_printf("command wrote: %s\n", buffer); rword = buffer; -while (isspace(*rword)) rword++; +Uskip_whitespace(&rword); rdata = rword; while (*rdata && !isspace(*rdata)) rdata++; -if (*rdata) *rdata++ = 0; +if (*rdata) *rdata++ = '\0'; /* The word must be a known yield name. If it is "REDIRECT", the rest of the line is redirection data, as for a .forward file. It may not contain filter @@ -535,5 +537,6 @@ addr->prop = addr_prop; return rf_queue_add(addr, addr_local, addr_remote, rblock, pw) ? OK : DEFER; } -#endif /*!MACRO_PREDEF*/ +#endif /*!MACRO_PREDEF*/ +#endif /*ROUTER_QUERYPROGRAM*/ /* End of routers/queryprogram.c */