Build: avoid compiling code for unused transports, routers, authenticators
[exim.git] / src / src / routers / queryprogram.c
index 644025a615d45adb9d7e9e2724440a11e239feca..b1d736f948c1063981b4f64ddc4f97e6b7ca0748 100644 (file)
@@ -2,11 +2,14 @@
 *     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"
+
+#ifdef ROUTER_QUERYPROGRAM     /* Remainder of file */
 #include "rf_functions.h"
 #include "queryprogram.h"
 
@@ -286,9 +289,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 */
@@ -533,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 */