Deleted Added
full compact
cf.c (98121) cf.c (110560)
1/*
2 * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
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.
8 *
9 */
10
11#include <sendmail.h>
1/*
2 * Copyright (c) 2000-2002 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 *
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.
8 *
9 */
10
11#include <sendmail.h>
12SM_RCSID("@(#)$Id: cf.c,v 8.18 2002/05/25 00:09:16 gshapiro Exp $")
12SM_RCSID("@(#)$Id: cf.c,v 8.18.2.1 2002/09/24 21:48:23 ca Exp $")
13#include <sendmail/pathnames.h>
14
15/*
16** GETCFNAME -- return the name of the .cf file to use.
17**
18** Some systems (e.g., NeXT) determine this dynamically.
19**
20** For others: returns submit.cf or sendmail.cf depending

--- 11 unchanged lines hidden (view full) ---

32
33char *
34getcfname(opmode, submitmode, cftype, conffile)
35 int opmode;
36 int submitmode;
37 int cftype;
38 char *conffile;
39{
13#include <sendmail/pathnames.h>
14
15/*
16** GETCFNAME -- return the name of the .cf file to use.
17**
18** Some systems (e.g., NeXT) determine this dynamically.
19**
20** For others: returns submit.cf or sendmail.cf depending

--- 11 unchanged lines hidden (view full) ---

32
33char *
34getcfname(opmode, submitmode, cftype, conffile)
35 int opmode;
36 int submitmode;
37 int cftype;
38 char *conffile;
39{
40#if NETINFO
41 char *cflocation;
42#endif /* NETINFO */
40
41 if (conffile != NULL)
42 return conffile;
43
43
44 if (conffile != NULL)
45 return conffile;
46
44#if NETINFO
45 {
46 char *cflocation;
47
48 cflocation = ni_propval("/locations", NULL, "sendmail",
49 "sendmail.cf", '\0');
50 if (cflocation != NULL)
51 return cflocation;
52 }
53#endif /* NETINFO */
54
55 if (cftype == SM_GET_SUBMIT_CF ||
56 ((submitmode != SUBMIT_UNKNOWN ||
57 opmode == MD_DELIVER ||
58 opmode == MD_ARPAFTP ||
59 opmode == MD_SMTP) &&
60 cftype != SM_GET_SENDMAIL_CF))
61 {
62 struct stat sbuf;
63 static char cf[MAXPATHLEN];
64
47 if (cftype == SM_GET_SUBMIT_CF ||
48 ((submitmode != SUBMIT_UNKNOWN ||
49 opmode == MD_DELIVER ||
50 opmode == MD_ARPAFTP ||
51 opmode == MD_SMTP) &&
52 cftype != SM_GET_SENDMAIL_CF))
53 {
54 struct stat sbuf;
55 static char cf[MAXPATHLEN];
56
65 (void) sm_strlcpyn(cf, sizeof cf, 2, _DIR_SENDMAILCF,
66 "submit.cf");
57#if NETINFO
58 cflocation = ni_propval("/locations", NULL, "sendmail",
59 "submit.cf", '\0');
60 if (cflocation != NULL)
61 (void) sm_strlcpy(cf, cflocation, sizeof cf);
62 else
63#endif /* NETINFO */
64 (void) sm_strlcpyn(cf, sizeof cf, 2, _DIR_SENDMAILCF,
65 "submit.cf");
67 if (cftype == SM_GET_SUBMIT_CF || stat(cf, &sbuf) == 0)
68 return cf;
69 }
66 if (cftype == SM_GET_SUBMIT_CF || stat(cf, &sbuf) == 0)
67 return cf;
68 }
69#if NETINFO
70 cflocation = ni_propval("/locations", NULL, "sendmail",
71 "sendmail.cf", '\0');
72 if (cflocation != NULL)
73 return cflocation;
74#endif /* NETINFO */
70 return _PATH_SENDMAILCF;
71}
75 return _PATH_SENDMAILCF;
76}