File sudo-add-distconfdir.patch of Package sudo

diff --git a/Makefile.in b/Makefile.in
index c4055c3..d217214 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,3 +1,4 @@
+
 #
 # SPDX-License-Identifier: ISC
 #
@@ -31,6 +32,7 @@ exec_prefix = @exec_prefix@
 bindir = @bindir@
 sbindir = @sbindir@
 sysconfdir = @sysconfdir@
+distconfdir = @distconfdir@
 libexecdir = @libexecdir@
 includedir = @includedir@
 datarootdir = @datarootdir@
@@ -399,7 +401,9 @@ package: @PPFILES@
 		docdir=$(docdir) \
 		exampledir=$(exampledir) \
 		sysconfdir=$(sysconfdir) \
-		sudoersdir=$(sudoersdir) \
+		sudoersdir=$(sysconfdir) \
+		distconfdir=$(distconfdir) \
+		distsudoersdir=$(distconfdir) \
 		sudoers_uid=$(sudoers_uid) \
 		sudoers_gid=$(sudoers_gid) \
 		sudoers_mode=$(sudoers_mode) \
diff --git a/config.h.in b/config.h.in
index ba4d000..1a72b2d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1301,6 +1301,9 @@
 /* Define to 1 if you use GNU stow packaging. */
 #undef USE_STOW
 
+/* Define to 1 if you want to look for sudoers in both sysconfdir and distconfdir. */
+#undef HAVE_DISTCONF
+
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
diff --git a/configure b/configure
index 21da8f6..86d0831 100755
--- a/configure
+++ b/configure
@@ -900,6 +900,7 @@ runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
+distconfdir
 datadir
 datarootdir
 libexecdir
@@ -1006,6 +1007,7 @@ with_interfaces
 with_askpass
 with_exampledir
 with_plugindir
+with_distconf
 with_man
 with_mdoc
 enable_authentication
@@ -1128,6 +1130,7 @@ libexecdir='${exec_prefix}/libexec'
 datarootdir='${prefix}/share'
 datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
+distconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
 runstatedir='${localstatedir}/run'
@@ -1424,6 +1427,11 @@ do
   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
     sysconfdir=$ac_optarg ;;
 
+  -distconfdir | --distconfdir | --distconfdi | --distconfd)
+    ac_prev=distconfdir ;;
+  -distconfdir=* | --distconfdir=* | --distconfdi=* | --distconfd=*)
+    distconfdir=$ac_optarg ;;
+
   -target | --target | --targe | --targ | --tar | --ta | --t)
     ac_prev=target_alias ;;
   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
@@ -1527,7 +1535,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir runstatedir
+		libdir localedir mandir runstatedir distconfdir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1678,6 +1686,7 @@ Fine tuning of the installation directories:
   --sbindir=DIR           system admin executables [EPREFIX/sbin]
   --libexecdir=DIR        program executables [EPREFIX/libexec]
   --sysconfdir=DIR        read-only single-machine data [/etc]
+  --distconfdir=DIR       read-only single-machine data - alternate location [/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
   --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
@@ -1784,6 +1793,8 @@ Optional Features:
   --disable-pam-session   Disable PAM session support
   --enable-kerb5-instance instance string to append to the username (separated
                           by a slash)
+  --with-distconf         Look for the sudoers file in distconfdir
+                          before looking in sysconfdir
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -5289,6 +5300,21 @@ fi
 
 
 
+# Check whether --with-distconf was given.
+if test ${with_distconf+y}
+then :
+  withval=$with_distconf; case $with_distconf in
+    yes)	printf "%s\n" "#define HAVE_DISTCONF 1" >>confdefs.h
+
+		;;
+    no)		;;
+    *)		as_fn_error $? "--with-distconf does not take an argument." "$LINENO" 5
+		;;
+esac
+fi
+
+
+
 # Check whether --with-SecurID was given.
 if test ${with_SecurID+y}
 then :
diff --git a/configure.ac b/configure.ac
index 8eccad7..36a8e3b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -542,6 +542,15 @@ AC_ARG_WITH(long-otp-prompt, [AS_HELP_STRING([--with-long-otp-prompt], [use a tw
 		;;
 esac])
 
+AC_ARG_WITH(distconf, [AS_HELP_STRING([--with-distconf], [use distconfdir in addition to sysconfdir])],
+[case $with_distconf in
+    yes)	AC_DEFINE([HAVE_DISTCONF])
+		;;
+    no)		;;
+    *)		AC_MSG_ERROR([--with-distconf does not take an argument.])
+		;;
+esac])
+
 AC_ARG_WITH(SecurID, [AS_HELP_STRING([--with-SecurID[[=DIR]]], [enable SecurID support])],
 [case $with_SecurID in
     no)		;;
@@ -5227,6 +5236,8 @@ test "$localedir" = '${datarootdir}/locale' && localedir='$(datarootdir)/locale'
 test "$localstatedir" = '${prefix}/var' && localstatedir='$(prefix)/var'
 test "$runstatedir" = '${localstatedir}/run' && runstatedir='$(localstatedir)/run'
 test "$sysconfdir" = '${prefix}/etc' && sysconfdir='/etc'
+test "$distconfdir" = '${prefix}/etc' && distconfdir='/etc'
+
 
 dnl
 dnl Substitute into the Makefile and man pages
@@ -5525,6 +5536,7 @@ AH_TEMPLATE(STUB_LOAD_INTERFACES, [Define to 1 if the code in interfaces.c does
 AH_TEMPLATE(UMASK_OVERRIDE, [Define to 1 to use the umask specified in sudoers even when it is less restrictive than the invoking user's.])
 AH_TEMPLATE(USE_INSULTS, [Define to 1 if you want to insult the user for entering an incorrect password.])
 AH_TEMPLATE(USE_STOW, [Define to 1 if you use GNU stow packaging.])
+AH_TEMPLATE(HAVE_DISTCONF, [Define to 1 if you want to look for sudoers in both sysconfdir and distconfdir.])
 AH_TEMPLATE(WITHOUT_PASSWD, [Define to avoid using the passwd/shadow file for authentication.])
 AH_TEMPLATE(clockid_t, [Define to `int' if <time.h> does not define.])
 AH_TEMPLATE(sig_atomic_t, [Define to `int' if <signal.h> does not define.])
diff --git a/lib/util/Makefile.in b/lib/util/Makefile.in
index ad97748..43751ce 100644
--- a/lib/util/Makefile.in
+++ b/lib/util/Makefile.in
@@ -37,6 +37,7 @@ exec_prefix = @exec_prefix@
 bindir = @bindir@
 sbindir = @sbindir@
 sysconfdir = @sysconfdir@
+distconfdir = @distconfdir@
 libexecdir = @libexecdir@
 datarootdir = @datarootdir@
 localstatedir = @localstatedir@
@@ -65,7 +66,7 @@ INSTALL_OWNER = -o $(install_uid) -g $(install_gid)
 INSTALL_BACKUP = @INSTALL_BACKUP@
 
 # C preprocessor defines
-CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\"
+CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\" -D_PATH_DIST_SUDO_CONF=\"$(distconfdir)/sudo.conf\"
 
 # C preprocessor flags
 CPPFLAGS = -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) $(CPPDEFS) \
diff --git a/lib/util/sudo_conf.c b/lib/util/sudo_conf.c
index 5f046ff..bb2012b 100644
--- a/lib/util/sudo_conf.c
+++ b/lib/util/sudo_conf.c
@@ -644,6 +644,29 @@ sudo_conf_init(int conf_types)
     debug_return;
 }
 
+/* Locate the "sudo.conf" file.
+ * Look in _PATH_SUDO_CONF or _PATH_DIST_SUDO_CONF, depending on configuration.
+ * Returns a const string.
+ */
+static const char *
+sudo_locate_conf_file(void)
+{
+#ifdef HAVE_DISTCONF
+  /* Check to see if file exists in distconfig (/etc).
+   * If it does not, then use sysconfig (/usr/etc).
+   */
+  int fd;
+  fd = open(_PATH_DIST_SUDO_CONF, O_RDONLY);
+  if (fd >= 0) {
+    close(fd);
+    return _PATH_DIST_SUDO_CONF;
+  }
+#endif /* HAVE_DISTCONF */
+
+  return _PATH_SUDO_CONF;
+}
+
+
 /*
  * Read in /etc/sudo.conf and populates sudo_conf_data.
  */
@@ -679,7 +702,7 @@ sudo_conf_read_v1(const char *conf_file, int conf_types)
 	}
     } else {
 	int error;
-	conf_file = _PATH_SUDO_CONF;
+	conf_file = sudo_locate_conf_file();
 	fd = sudo_secure_open_file(conf_file, ROOT_UID, -1, &sb, &error);
 	if (fd == -1) {
 	    switch (error) {
diff --git a/logsrvd/Makefile.in b/logsrvd/Makefile.in
index c9ba865..e68ccbc 100644
--- a/logsrvd/Makefile.in
+++ b/logsrvd/Makefile.in
@@ -53,6 +53,7 @@ LIBS = $(LT_LIBS) @LIBTLS@
 
 # C preprocessor defines
 CPPDEFS = -D_PATH_SUDO_LOGSRVD_CONF=\"$(sysconfdir)/sudo_logsrvd.conf\" \
+	  -D_PATH_DIST_SUDO_LOGSRVD_CONF=\"$(distconfdir)/sudo_logsrvd.conf\" \
 	  -DLOCALEDIR=\"$(localedir)\"
 
 # C preprocessor flags
diff --git a/logsrvd/logsrvd.c b/logsrvd/logsrvd.c
index a09b7b6..b1963f8 100644
--- a/logsrvd/logsrvd.c
+++ b/logsrvd/logsrvd.c
@@ -85,7 +85,7 @@ TAILQ_HEAD(connection_list, connection_closure);
 static struct connection_list connections = TAILQ_HEAD_INITIALIZER(connections);
 static struct listener_list listeners = TAILQ_HEAD_INITIALIZER(listeners);
 static const char server_id[] = "Sudo Audit Server " PACKAGE_VERSION;
-static const char *conf_file = _PATH_SUDO_LOGSRVD_CONF;
+static const char *conf_file = NULL;
 
 /* Event loop callbacks. */
 static void client_msg_cb(int fd, int what, void *v);
@@ -1908,6 +1908,32 @@ help(void)
     exit(EXIT_SUCCESS);
 }
 
+/* Locate the "sudo_logsrvd.conf" file.
+ * Look in _PATH_SUDO_LOGSRVD_CONF or _PATH_DIST_SUDO_LOGSRVD_CONF, depending on configuration.
+ * Returns a const string.
+ */
+static void
+determine_conf_file()
+{
+  if (conf_file != NULL)
+    return;
+
+#ifdef HAVE_DISTCONF
+  /* Check to see if file exists in distconfig (/etc).
+   * If it does not, then use sysconfig (/usr/etc).
+   */
+  int fd;
+  conf_file = _PATH_DIST_SUDO_LOGSRVD_CONF;
+  fd = open(conf_file, O_RDONLY);
+  if (fd >= 0) {
+    close(fd);
+    return;
+  }
+#endif /* HAVE_DISTCONF */
+
+  conf_file = _PATH_SUDO_LOGSRVD_CONF;
+}
+
 static const char short_opts[] = "f:hnR:V";
 static struct option long_opts[] = {
     { "file",		required_argument,	NULL,	'f' },
@@ -1981,6 +2007,7 @@ main(int argc, char *argv[])
     }
 
     /* Read sudo_logsrvd.conf */
+    determine_conf_file();
     if (!logsrvd_conf_read(conf_file))
         exit(EXIT_FAILURE);
 
diff --git a/pathnames.h.in b/pathnames.h.in
index 76d7bb2..97bbc84 100644
--- a/pathnames.h.in
+++ b/pathnames.h.in
@@ -64,6 +64,13 @@
 # define _PATH_SUDO_CONF	"/etc/sudo.conf"
 #endif /* _PATH_SUDO_CONF */
 
+/*
+ * NOTE: _PATH_DIST_SUDO_CONF is usually overridden by the Makefile.
+ */
+#ifndef _PATH_DIST_SUDO_CONF
+# define _PATH_DIST_SUDO_CONF	"/etc/sudo.conf"
+#endif /* _PATH_DIST_SUDO_CONF */
+
 /*
  * NOTE: _PATH_SUDOERS is usually overridden by the Makefile.
  */
@@ -71,6 +78,13 @@
 # define _PATH_SUDOERS		"/etc/sudoers"
 #endif /* _PATH_SUDOERS */
 
+/*
+ * NOTE: PATH_DIST_SUDOERS is usually overridden by the Makefile.
+ */
+#ifndef _PATH_DIST_SUDOERS
+# define _PATH_DIST_SUDOERS		"/etc/sudoers"
+#endif /* _PATH_DIST_SUDOERS */
+
 /*
  * NOTE: _PATH_CVTSUDOERS_CONF is usually overridden by the Makefile.
  */
@@ -85,6 +99,13 @@
 # define _PATH_SUDO_LOGSRVD_CONF	"/etc/sudo_logsrvd.conf"
 #endif /* _PATH_SUDO_LOGSRVD_CONF */
 
+/*
+ * NOTE: _PATH_DIST_SUDO_LOGSRVD_CONF is usually overridden by the Makefile.
+ */
+#ifndef _PATH_DIST_SUDO_LOGSRVD_CONF
+# define _PATH_DIST_SUDO_LOGSRVD_CONF	"/etc/sudo_logsrvd.conf"
+#endif /* _PATH_DIST_SUDO_LOGSRVD_CONF */
+
 /*
  * The following paths are controlled via the configure script.
  */
diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in
index 29110dc..f370aaf 100644
--- a/plugins/sudoers/Makefile.in
+++ b/plugins/sudoers/Makefile.in
@@ -72,7 +72,8 @@ TESTSUDOERS_LIBS = $(NET_LIBS)
 
 # C preprocessor defines
 CPPDEFS = -DLIBDIR=\"$(libdir)\" -DLOCALEDIR=\"$(localedir)\" \
-	  -D_PATH_SUDOERS=\"$(sudoersdir)/sudoers\" \
+	  -D_PATH_SUDOERS=\"$(sysconfdir)/sudoers\" \
+	  -D_PATH_DIST_SUDOERS=\"$(distconfdir)/sudoers\" \
 	  -D_PATH_CVTSUDOERS_CONF=\"$(sysconfdir)/cvtsudoers.conf\" \
 	  -DSUDOERS_UID=$(sudoers_uid) -DSUDOERS_GID=$(sudoers_gid) \
 	  -DSUDOERS_MODE=$(sudoers_mode)
@@ -120,10 +121,12 @@ exec_prefix = @exec_prefix@
 bindir = @bindir@
 sbindir = @sbindir@
 sysconfdir = @sysconfdir@
+distconfdir = @distconfdir@
 libexecdir = @libexecdir@
 datarootdir = @datarootdir@
 localedir = @localedir@
 localstatedir = @localstatedir@
+with_distconf = @with_distconf@
 
 # File mode and map file to use for shared libraries/objects
 shlib_enable = @SHLIB_ENABLE@
diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c
index 2a6a76e..ce1be6b 100644
--- a/plugins/sudoers/policy.c
+++ b/plugins/sudoers/policy.c
@@ -126,7 +126,7 @@ sudoers_policy_deserialize_info(void *v, struct defaults_list *defaults)
     }
 
     /* Parse sudo.conf plugin args. */
-    sudoers_file = _PATH_SUDOERS;
+    locate_sudoers_file();
     sudoers_mode = SUDOERS_MODE;
     sudoers_uid = SUDOERS_UID;
     sudoers_gid = SUDOERS_GID;
diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c
index 4b9e796..8bf2c1a 100644
--- a/plugins/sudoers/sudoers.c
+++ b/plugins/sudoers/sudoers.c
@@ -193,6 +193,33 @@ sudoers_reinit_defaults(void)
     debug_return_bool(true);
 }
 
+/* Locate the sudoers file.
+ * Look in _PATH_SUDOERS or _PATH_DIST_SUDOERS, depending on configuration.
+ * Sets the global variable sudoers_file, returns nothing.
+ */
+void
+locate_sudoers_file(void)
+{
+  if (sudoers_file != NULL)
+    return;
+
+#ifdef HAVE_DISTCONF
+  /* Check to see if file exists in distconfig (/etc).
+   * If it does not, then use sysconfig (/usr/etc).
+   */
+  int fd;
+  sudoers_file = _PATH_DIST_SUDOERS;
+
+  fd = open(sudoers_file, O_RDONLY);
+  if (fd >= 0) {
+    close(fd);
+    return;
+  }
+#endif /* HAVE_DISTCONF */
+
+  sudoers_file = _PATH_SUDOERS;
+}
+
 int
 sudoers_init(void *info, sudoers_logger_t logger, char * const envp[])
 {
@@ -249,6 +276,7 @@ sudoers_init(void *info, sudoers_logger_t logger, char * const envp[])
     }
 
     /* Open and parse sudoers, set global defaults.  */
+    locate_sudoers_file();
     init_parser(sudoers_file, false, false);
     TAILQ_FOREACH_SAFE(nss, snl, entries, nss_next) {
 	if (nss->open(nss) == -1 || (nss->parse_tree = nss->parse(nss)) == NULL) {
diff --git a/plugins/sudoers/sudoers.h b/plugins/sudoers/sudoers.h
index cd92707..42ec932 100644
--- a/plugins/sudoers/sudoers.h
+++ b/plugins/sudoers/sudoers.h
@@ -423,6 +423,7 @@ FILE *open_sudoers(const char *, bool, bool *);
 bool cb_log_input(const char *file, int line, int column, const union sudo_defs_val *sd_un, int op);
 bool cb_log_output(const char *file, int line, int column, const union sudo_defs_val *sd_un, int op);
 int set_cmnd_path(const char *runchroot);
+void locate_sudoers_file(void);
 int sudoers_init(void *info, sudoers_logger_t logger, char * const envp[]);
 int sudoers_policy_main(int argc, char *const argv[], int pwflag, char *env_add[], bool verbose, void *closure);
 void sudoers_cleanup(void);
diff --git a/plugins/sudoers/toke.c b/plugins/sudoers/toke.c
index 10a7b97..a58f73c 100644
--- a/plugins/sudoers/toke.c
+++ b/plugins/sudoers/toke.c
@@ -3092,8 +3092,8 @@ char *sudoers;			/* sudoers file being parsed. */
 const char *sudoers_errstr;	/* description of last error from lexer. */
 struct sudolinebuf sudolinebuf;	/* sudoers line being parsed. */
 
-/* Default sudoers path, mode and owner (may be set via sudo.conf) */
-const char *sudoers_file = _PATH_SUDOERS;
+/* Sudoers path, mode and owner (may be set via sudo.conf) */
+const char *sudoers_file = NULL;
 mode_t sudoers_mode = SUDOERS_MODE;
 uid_t sudoers_uid = SUDOERS_UID;
 gid_t sudoers_gid = SUDOERS_GID;
diff --git a/plugins/sudoers/toke.l b/plugins/sudoers/toke.l
index 2f062ff..a0894c5 100644
--- a/plugins/sudoers/toke.l
+++ b/plugins/sudoers/toke.l
@@ -58,8 +58,8 @@ char *sudoers;			/* sudoers file being parsed. */
 const char *sudoers_errstr;	/* description of last error from lexer. */
 struct sudolinebuf sudolinebuf;	/* sudoers line being parsed. */
 
-/* Default sudoers path, mode and owner (may be set via sudo.conf) */
-const char *sudoers_file = _PATH_SUDOERS;
+/* Sudoers path, mode and owner (may be set via sudo.conf) */
+const char *sudoers_file = NULL;
 mode_t sudoers_mode = SUDOERS_MODE;
 uid_t sudoers_uid = SUDOERS_UID;
 gid_t sudoers_gid = SUDOERS_GID;
diff --git a/src/Makefile.in b/src/Makefile.in
index bfa9415..8fe8804 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -51,6 +51,7 @@ LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ $(LT_LIBS)
 
 # C preprocessor defines
 CPPDEFS = -D_PATH_SUDO_CONF=\"$(sysconfdir)/sudo.conf\" \
+	  -D_PATH_DIST_SUDO_CONF=\"$(distconfdir)/sudo.conf\" \
 	  -DLOCALEDIR=\"$(localedir)\"
 
 # C preprocessor flags
diff --git a/src/load_plugins.c b/src/load_plugins.c
index 5734602..9a75f9d 100644
--- a/src/load_plugins.c
+++ b/src/load_plugins.c
@@ -24,6 +24,7 @@
 #include <config.h>
 
 #include <sys/stat.h>
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -37,6 +38,36 @@
 /* We always use the same name for the sudoers plugin, regardless of the OS */
 #define SUDOERS_PLUGIN	"sudoers.so"
 
+/* Locate the "sudo.conf" file.
+ * Look in _PATH_SUDO_CONF or _PATH_DIST_SUDO_CONF, depending on configuration.
+ * Returns a const string.
+ */
+static const char *
+path_sudo_conf_file(void)
+{
+  static const char *retval = NULL;
+
+  if (retval != NULL)
+    return retval;
+
+#ifdef HAVE_DISTCONF
+  /* Check to see if file exists in distconfig (/etc).
+   * If it does not, then use sysconfig (/usr/etc).
+   */
+  int fd;
+  fd = open(_PATH_DIST_SUDO_CONF, O_RDONLY);
+  if (fd >= 0) {
+    close(fd);
+    retval = _PATH_DIST_SUDO_CONF;
+    return retval;
+  }
+#endif /* HAVE_DISTCONF */
+
+  retval = _PATH_SUDO_CONF;
+  return retval;
+}
+
+
 #ifdef ENABLE_SUDO_PLUGIN_API
 static int
 sudo_stat_plugin(struct plugin_info *info, char *fullpath,
@@ -107,7 +138,7 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
 
     if (sudo_stat_plugin(info, fullpath, pathsize, &sb) != 0) {
 	sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-	    _PATH_SUDO_CONF, info->lineno, info->symbol_name);
+	    path_sudo_conf_file(), info->lineno, info->symbol_name);
 	if (info->path[0] == '/') {
 	    sudo_warn("%s", info->path);
 	} else {
@@ -121,13 +152,13 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
     if (!sudo_conf_developer_mode()) {
         if (sb.st_uid != ROOT_UID) {
             sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-                _PATH_SUDO_CONF, info->lineno, info->symbol_name);
+                path_sudo_conf_file(), info->lineno, info->symbol_name);
             sudo_warnx(U_("%s must be owned by uid %d"), fullpath, ROOT_UID);
             goto done;
         }
         if ((sb.st_mode & (S_IWGRP|S_IWOTH)) != 0) {
             sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-                _PATH_SUDO_CONF, info->lineno, info->symbol_name);
+                path_sudo_conf_file(), info->lineno, info->symbol_name);
             sudo_warnx(U_("%s must be only be writable by owner"), fullpath);
             goto done;
         }
@@ -241,7 +272,7 @@ sudo_insert_plugin(struct plugin_container_list *plugin_list, void *handle,
 	plugin = sudo_plugin_try_to_clone(handle, info->symbol_name);
 	if (plugin == NULL) {
 	    sudo_warnx(U_("ignoring duplicate plugin \"%s\" in %s, line %d"),
-		info->symbol_name, _PATH_SUDO_CONF, info->lineno);
+		info->symbol_name, path_sudo_conf_file(), info->lineno);
 	    sudo_dso_unload(handle);
 	    goto done;
 	}
@@ -277,7 +308,7 @@ sudo_load_plugin(struct plugin_info *info, bool quiet)
 	if (!quiet) {
 	    const char *errstr = sudo_dso_strerror();
 	    sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-		_PATH_SUDO_CONF, info->lineno, info->symbol_name);
+		path_sudo_conf_file(), info->lineno, info->symbol_name);
 	    sudo_warnx(U_("unable to load %s: %s"), path,
 		errstr ? errstr : "unknown error");
 	}
@@ -287,7 +318,7 @@ sudo_load_plugin(struct plugin_info *info, bool quiet)
     if (!plugin) {
 	if (!quiet) {
 	    sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-		_PATH_SUDO_CONF, info->lineno, info->symbol_name);
+		path_sudo_conf_file(), info->lineno, info->symbol_name);
 	    sudo_warnx(U_("unable to find symbol \"%s\" in %s"),
 		info->symbol_name, path);
 	}
@@ -297,7 +328,7 @@ sudo_load_plugin(struct plugin_info *info, bool quiet)
     if (SUDO_API_VERSION_GET_MAJOR(plugin->version) != SUDO_API_VERSION_MAJOR) {
 	if (!quiet) {
 	    sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-		_PATH_SUDO_CONF, info->lineno, info->symbol_name);
+		path_sudo_conf_file(), info->lineno, info->symbol_name);
 	    sudo_warnx(U_("incompatible plugin major version %d (expected %d) found in %s"),
 		SUDO_API_VERSION_GET_MAJOR(plugin->version),
 		SUDO_API_VERSION_MAJOR, path);
@@ -312,12 +343,12 @@ sudo_load_plugin(struct plugin_info *info, bool quiet)
 	    if (strcmp(policy_plugin.name, info->symbol_name) == 0) {
 		if (!quiet) {
 		    sudo_warnx(U_("ignoring duplicate plugin \"%s\" in %s, line %d"),
-			info->symbol_name, _PATH_SUDO_CONF, info->lineno);
+			info->symbol_name, path_sudo_conf_file(), info->lineno);
 		}
 	    } else {
 		if (!quiet) {
 		    sudo_warnx(U_("ignoring policy plugin \"%s\" in %s, line %d"),
-			info->symbol_name, _PATH_SUDO_CONF, info->lineno);
+			info->symbol_name, path_sudo_conf_file(), info->lineno);
 		    sudo_warnx("%s",
 			U_("only a single policy plugin may be specified"));
 		}
@@ -344,7 +375,7 @@ sudo_load_plugin(struct plugin_info *info, bool quiet)
     default:
 	if (!quiet) {
 	    sudo_warnx(U_("error in %s, line %d while loading plugin \"%s\""),
-		_PATH_SUDO_CONF, info->lineno, info->symbol_name);
+		path_sudo_conf_file(), info->lineno, info->symbol_name);
 	    sudo_warnx(U_("unknown plugin type %d found in %s"), plugin->type, path);
 	}
 	goto done;
openSUSE Build Service is sponsored by