#include <sendmail.h>
SM_RCSID("@(#)$Id: cf.c,v 8.18.2.1 2002/09/24 21:48:23 ca Exp $")
#include <sendmail/pathnames.h>
char *
getcfname(opmode, submitmode, cftype, conffile)
int opmode;
int submitmode;
int cftype;
char *conffile;
{
#if NETINFO
char *cflocation;
#endif
if (conffile != NULL)
return conffile;
if (cftype == SM_GET_SUBMIT_CF ||
((submitmode != SUBMIT_UNKNOWN ||
opmode == MD_DELIVER ||
opmode == MD_ARPAFTP ||
opmode == MD_SMTP) &&
cftype != SM_GET_SENDMAIL_CF))
{
struct stat sbuf;
static char cf[MAXPATHLEN];
#if NETINFO
cflocation = ni_propval("/locations", NULL, "sendmail",
"submit.cf", '\0');
if (cflocation != NULL)
(void) sm_strlcpy(cf, cflocation, sizeof cf);
else
#endif
(void) sm_strlcpyn(cf, sizeof cf, 2, _DIR_SENDMAILCF,
"submit.cf");
if (cftype == SM_GET_SUBMIT_CF || stat(cf, &sbuf) == 0)
return cf;
}
#if NETINFO
cflocation = ni_propval("/locations", NULL, "sendmail",
"sendmail.cf", '\0');
if (cflocation != NULL)
return cflocation;
#endif
return _PATH_SENDMAILCF;
}