Debug: option access for expansion
[exim.git] / src / src / routers / queryprogram.c
index d59da53b272bdf2c1f85f0a1e19c6e8b3cecb651..dd5e24b9392cd3099971671b8a81d854390c888e 100644 (file)
@@ -2,9 +2,10 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
+/* Copyright (c) The Exim Maintainers 2020 - 2023 */
 /* Copyright (c) University of Cambridge 1995 - 2018 */
-/* Copyright (c) The Exim Maintainers 2020 - 2021 */
 /* See the file NOTICE for conditions of use and distribution. */
+/* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include "../exim.h"
 #include "rf_functions.h"
@@ -86,13 +87,13 @@ queryprogram_router_options_block *ob =
 
 /* A command must be given */
 
-if (ob->command == NULL)
+if (!ob->command)
   log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n  "
     "a command specification is required", rblock->name);
 
 /* A uid/gid must be supplied */
 
-if (!ob->cmd_uid_set && ob->expand_cmd_uid == NULL)
+if (!ob->cmd_uid_set && !ob->expand_cmd_uid)
   log_write(0, LOG_PANIC_DIE|LOG_CONFIG_FOR, "%s router:\n  "
     "command_user must be specified", rblock->name);
 }
@@ -286,9 +287,10 @@ 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 */
     US"queryprogram router",            /* for error messages */