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.
11 #pragma ident "%Z%%M% %I% %E% SMI"
14 SM_RCSID("@(#)$Id: cf.c,v 8.18.2.1 2002/09/24 21:48:23 ca Exp $")
15 #include <sendmail/pathnames.h>
18 ** GETCFNAME -- return the name of the .cf file to use.
20 ** Some systems (e.g., NeXT) determine this dynamically.
22 ** For others: returns submit.cf or sendmail.cf depending
26 ** opmode -- operation mode.
27 ** submitmode -- submit mode.
28 ** cftype -- may request a certain cf file.
29 ** conffile -- if set, return it.
36 getcfname(opmode
, submitmode
, cftype
, conffile
)
49 if (cftype
== SM_GET_SUBMIT_CF
||
50 ((submitmode
!= SUBMIT_UNKNOWN
||
51 opmode
== MD_DELIVER
||
52 opmode
== MD_ARPAFTP
||
54 cftype
!= SM_GET_SENDMAIL_CF
))
57 static char cf
[MAXPATHLEN
];
60 cflocation
= ni_propval("/locations", NULL
, "sendmail",
62 if (cflocation
!= NULL
)
63 (void) sm_strlcpy(cf
, cflocation
, sizeof cf
);
66 (void) sm_strlcpyn(cf
, sizeof cf
, 2, _DIR_SENDMAILCF
,
68 if (cftype
== SM_GET_SUBMIT_CF
|| stat(cf
, &sbuf
) == 0)
72 cflocation
= ni_propval("/locations", NULL
, "sendmail",
74 if (cflocation
!= NULL
)
77 return _PATH_SENDMAILCF
;