get sendmail.cf name from a routine (so it can autoconfigure on NeXt)
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 23 Sep 1993 00:02:55 +0000 (16:02 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Thu, 23 Sep 1993 00:02:55 +0000 (16:02 -0800)
SCCS-vsn: usr.sbin/sendmail/src/conf.c 8.36
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 8.20
SCCS-vsn: usr.sbin/sendmail/src/main.c 8.27

usr/src/usr.sbin/sendmail/src/conf.c
usr/src/usr.sbin/sendmail/src/main.c
usr/src/usr.sbin/sendmail/src/sendmail.h

index 1ed90db..c783649 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)conf.c     8.35 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c     8.36 (Berkeley) %G%";
 #endif /* not lint */
 
 # include "sendmail.h"
 #endif /* not lint */
 
 # include "sendmail.h"
@@ -101,7 +101,6 @@ struct hdrinfo      HdrInfo[] =
 **  Location of system files/databases/etc.
 */
 
 **  Location of system files/databases/etc.
 */
 
-char   *ConfFile =     _PATH_SENDMAILCF;       /* runtime configuration */
 char   *PidFile =      _PATH_SENDMAILPID;      /* stores daemon proc id */
 
 
 char   *PidFile =      _PATH_SENDMAILPID;      /* stores daemon proc id */
 
 
@@ -1615,3 +1614,16 @@ lockfile(fd, filename, ext, type)
                printf("FAIL\n");
        return FALSE;
 }
                printf("FAIL\n");
        return FALSE;
 }
+\f/*
+**  GETCFNAME -- return the name of the .cf file.
+**
+**     Some systems (e.g., NeXT) determine this dynamically.
+*/
+
+char *
+getcfname()
+{
+       if (ConfFile != NULL)
+               return ConfFile;
+       return _PATH_SENDMAILCF;
+}
index f5e4db7..9100e2b 100644 (file)
@@ -13,7 +13,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #endif /* not lint */
 
 #ifndef lint
-static char sccsid[] = "@(#)main.c     8.26 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c     8.27 (Berkeley) %G%";
 #endif /* not lint */
 
 #define        _DEFINE
 #endif /* not lint */
 
 #define        _DEFINE
@@ -124,6 +124,7 @@ main(argc, argv, envp)
        extern char **myhostname();
        extern char *arpadate();
        extern char *getauthinfo();
        extern char **myhostname();
        extern char *arpadate();
        extern char *getauthinfo();
+       extern char *getcfname();
        extern char *optarg;
        extern char **environ;
 
        extern char *optarg;
        extern char **environ;
 
@@ -574,7 +575,7 @@ main(argc, argv, envp)
        **      Extract special fields for local use.
        */
 
        **      Extract special fields for local use.
        */
 
-       readcf(ConfFile, safecf, CurEnv);
+       readcf(getcfname(), safecf, CurEnv);
 
        if (tTd(0, 1))
        {
 
        if (tTd(0, 1))
        {
index 2a32926..5841d75 100644 (file)
@@ -5,7 +5,7 @@
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)sendmail.h  8.19 (Berkeley) %G%
+ *     @(#)sendmail.h  8.20 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -15,7 +15,7 @@
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
 # ifdef _DEFINE
 # define EXTERN
 # ifndef lint
-static char SmailSccsId[] =    "@(#)sendmail.h 8.19            %G%";
+static char SmailSccsId[] =    "@(#)sendmail.h 8.20            %G%";
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
 # endif
 # else /*  _DEFINE */
 # define EXTERN extern
@@ -791,7 +791,7 @@ EXTERN bool UseErrorsTo;    /* use Errors-To: header (back compat) */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
 EXTERN bool    TryNullMXList;  /* if we are the best MX, try host directly */
 EXTERN char    SpaceSub;       /* substitution for <lwsp> */
 EXTERN int     PrivacyFlags;   /* privacy flags */
-extern char    *ConfFile;      /* location of configuration file [conf.c] */
+EXTERN char    *ConfFile;      /* location of configuration file [conf.c] */
 extern char    *PidFile;       /* location of proc id file [conf.c] */
 extern ADDRESS NullAddress;    /* a null (template) address [main.c] */
 EXTERN long    WkClassFact;    /* multiplier for message class -> priority */
 extern char    *PidFile;       /* location of proc id file [conf.c] */
 extern ADDRESS NullAddress;    /* a null (template) address [main.c] */
 EXTERN long    WkClassFact;    /* multiplier for message class -> priority */