2 * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
5 * By using this file, you agree to the terms and conditions set
6 * forth in the LICENSE file which can be found at the top level of
7 * the sendmail distribution.
12 SM_RCSID("@(#)$Id: cf.c,v 8.19 2002/09/24 20:40:59 ca Exp $")
13 #include <sendmail/pathnames.h>
16 ** GETCFNAME -- return the name of the .cf file to use.
18 ** Some systems (e.g., NeXT) determine this dynamically.
20 ** For others: returns submit.cf or sendmail.cf depending
24 ** opmode -- operation mode.
25 ** submitmode -- submit mode.
26 ** cftype -- may request a certain cf file.
27 ** conffile -- if set, return it.
34 getcfname(opmode
, submitmode
, cftype
, conffile
)
47 if (cftype
== SM_GET_SUBMIT_CF
||
48 ((submitmode
!= SUBMIT_UNKNOWN
||
49 opmode
== MD_DELIVER
||
50 opmode
== MD_ARPAFTP
||
52 cftype
!= SM_GET_SENDMAIL_CF
))
55 static char cf
[MAXPATHLEN
];
58 cflocation
= ni_propval("/locations", NULL
, "sendmail",
60 if (cflocation
!= NULL
)
61 (void) sm_strlcpy(cf
, cflocation
, sizeof cf
);
64 (void) sm_strlcpyn(cf
, sizeof cf
, 2, _DIR_SENDMAILCF
,
66 if (cftype
== SM_GET_SUBMIT_CF
|| stat(cf
, &sbuf
) == 0)
70 cflocation
= ni_propval("/locations", NULL
, "sendmail",
72 if (cflocation
!= NULL
)
75 return _PATH_SENDMAILCF
;