Postfix3.3.1
postconf_misc.c
[詳解]
1 /*++
2 /* NAME
3 /* postconf_misc 3
4 /* SUMMARY
5 /* miscellaneous low-level code
6 /* SYNOPSIS
7 /* #include <postconf.h>
8 /*
9 /* void pcf_set_config_dir()
10 /* DESCRIPTION
11 /* pcf_set_config_dir() forcibly overrides the var_config_dir
12 /* parameter setting with the value from the environment or
13 /* with the default pathname, and updates the mail parameter
14 /* dictionary.
15 /* DIAGNOSTICS
16 /* Problems are reported to the standard error stream.
17 /* LICENSE
18 /* .ad
19 /* .fi
20 /* The Secure Mailer license must be distributed with this software.
21 /* AUTHOR(S)
22 /* Wietse Venema
23 /* IBM T.J. Watson Research
24 /* P.O. Box 704
25 /* Yorktown Heights, NY 10598, USA
26 /*--*/
27 
28 /* System library. */
29 
30 #include <sys_defs.h>
31 
32 /* Utility library. */
33 
34 #include <mymalloc.h>
35 #include <safe.h>
36 
37 /* Global library. */
38 
39 #include <mail_params.h>
40 #include <mail_conf.h>
41 
42 /* Application-specific. */
43 
44 #include <postconf.h>
45 
46 /* pcf_set_config_dir - forcibly override var_config_dir */
47 
49 {
50  char *config_dir;
51 
52  if (var_config_dir)
54  if ((config_dir = safe_getenv(CONF_ENV_PATH)) != 0) {
55  var_config_dir = mystrdup(config_dir);
57  } else {
59  }
60 }
void myfree(void *ptr)
Definition: mymalloc.c:207
char * mystrdup(const char *str)
Definition: mymalloc.c:225
void set_mail_conf_str(const char *, const char *)
char * var_config_dir
Definition: mail_params.c:241
#define CONF_ENV_PATH
Definition: mail_conf.h:22
DEF_CONFIG_DIR
Definition: install_table.h:1
void pcf_set_config_dir(void)
Definition: postconf_misc.c:48
char * safe_getenv(const char *)
Definition: safe_getenv.c:38
VAR_CONFIG_DIR
Definition: install_table.h:1