void-packages/srcpkgs/sudo/patches/0001-Fix-build-when-configu...

49 lines
1.6 KiB
Diff

From e22817e3abfee6fee779ab0b2d312d48323abb56 Mon Sep 17 00:00:00 2001
From: "Todd C. Miller" <Todd.Miller@sudo.ws>
Date: Mon, 30 Nov 2020 13:18:12 -0700
Subject: [PATCH] Fix build when configured using --without-sendmail Bug #947
---
lib/eventlog/eventlog.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git lib/eventlog/eventlog.c lib/eventlog/eventlog.c
index 8b190b7ce..ae97fdea9 100644
--- lib/eventlog/eventlog.c
+++ lib/eventlog/eventlog.c
@@ -78,7 +78,7 @@
static FILE *eventlog_stub_open_log(int type, const char *logfile);
static void eventlog_stub_close_log(int type, FILE *fp);
-/* Eventlog config settings */
+/* Eventlog config settings (default values). */
static struct eventlog_config evl_conf = {
EVLOG_NONE, /* type */
EVLOG_SUDO, /* format */
@@ -91,7 +91,11 @@ static struct eventlog_config evl_conf = {
false, /* omit_hostname */
_PATH_SUDO_LOGFILE, /* logpath */
"%h %e %T", /* time_fmt */
+#ifdef _PATH_SUDO_SENDMAIL
_PATH_SUDO_SENDMAIL, /* mailerpath */
+#else
+ NULL, /* mailerpath (disabled) */
+#endif
"-t", /* mailerflags */
NULL, /* mailfrom */
MAILTO, /* mailto */
@@ -1436,8 +1440,10 @@ eventlog_setconf(struct eventlog_config *conf)
evl_conf.logpath = _PATH_SUDO_LOGFILE;
if (evl_conf.time_fmt == NULL)
evl_conf.time_fmt = "%h %e %T";
+#ifdef _PATH_SUDO_SENDMAIL
if (evl_conf.mailerpath == NULL)
evl_conf.mailerpath = _PATH_SUDO_SENDMAIL;
+#endif
if (evl_conf.mailerflags == NULL)
evl_conf.mailerflags = "-t";
if (evl_conf.mailto == NULL)
--
2.29.2