From b7c15c31519dc44c1f691e0466badd556ffe9423 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 18:18:56 +0200 Subject: Adding upstream version 3.7.10. Signed-off-by: Daniel Baumann --- src/postconf/postconf_misc.c | 60 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/postconf/postconf_misc.c (limited to 'src/postconf/postconf_misc.c') diff --git a/src/postconf/postconf_misc.c b/src/postconf/postconf_misc.c new file mode 100644 index 0000000..0107651 --- /dev/null +++ b/src/postconf/postconf_misc.c @@ -0,0 +1,60 @@ +/*++ +/* NAME +/* postconf_misc 3 +/* SUMMARY +/* miscellaneous low-level code +/* SYNOPSIS +/* #include +/* +/* void pcf_set_config_dir() +/* DESCRIPTION +/* pcf_set_config_dir() forcibly overrides the var_config_dir +/* parameter setting with the value from the environment or +/* with the default pathname, and updates the mail parameter +/* dictionary. +/* DIAGNOSTICS +/* Problems are reported to the standard error stream. +/* LICENSE +/* .ad +/* .fi +/* The Secure Mailer license must be distributed with this software. +/* AUTHOR(S) +/* Wietse Venema +/* IBM T.J. Watson Research +/* P.O. Box 704 +/* Yorktown Heights, NY 10598, USA +/*--*/ + +/* System library. */ + +#include + +/* Utility library. */ + +#include +#include + +/* Global library. */ + +#include +#include + +/* Application-specific. */ + +#include + +/* pcf_set_config_dir - forcibly override var_config_dir */ + +void pcf_set_config_dir(void) +{ + char *config_dir; + + if (var_config_dir) + myfree(var_config_dir); + if ((config_dir = safe_getenv(CONF_ENV_PATH)) != 0) { + var_config_dir = mystrdup(config_dir); + set_mail_conf_str(VAR_CONFIG_DIR, var_config_dir); + } else { + var_config_dir = mystrdup(DEF_CONFIG_DIR); + } +} -- cgit v1.2.3