eliminate YPCOMPAT (do this automatically if NIS and NDBM are defined)
authorEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 15 Aug 1993 02:32:06 +0000 (18:32 -0800)
committerEric Allman <eric@ucbvax.Berkeley.EDU>
Sun, 15 Aug 1993 02:32:06 +0000 (18:32 -0800)
SCCS-vsn: usr.sbin/sendmail/src/READ_ME 8.13
SCCS-vsn: usr.sbin/sendmail/src/map.c 8.7
SCCS-vsn: usr.sbin/sendmail/src/Makefiles/Makefile.dist 8.4

usr/src/usr.sbin/sendmail/src/Makefiles/Makefile.dist
usr/src/usr.sbin/sendmail/src/READ_ME
usr/src/usr.sbin/sendmail/src/map.c

index 9bc9fed..04535ba 100644 (file)
@@ -5,9 +5,7 @@
 #  old make program (I recommend that you get and port the new make if you
 #  are going to be doing any signficant work on sendmail).
 #
 #  old make program (I recommend that you get and port the new make if you
 #  are going to be doing any signficant work on sendmail).
 #
-#  This has been tested on Ultrix.
-#
-#      @(#)Makefile.dist       8.3 (Berkeley) %G%
+#      @(#)Makefile.dist       8.4 (Berkeley) %G%
 #
 
 # use O=-O (usual) or O=-g (debugging)
 #
 
 # use O=-O (usual) or O=-g (debugging)
@@ -16,11 +14,9 @@ O=   -O
 # define the database mechanisms available for map & alias lookups:
 #      -DNDBM -- use new DBM
 #      -DNEWDB -- use new Berkeley DB
 # define the database mechanisms available for map & alias lookups:
 #      -DNDBM -- use new DBM
 #      -DNEWDB -- use new Berkeley DB
-#      -DNDBM -DNEWDB -DYPCOMPAT -- use both plus YP compatility
-#      -DNIS -- include client NIS support
+#      -DNIS -- include NIS support
 # The really old (V7) DBM library is no longer supported.
 # The really old (V7) DBM library is no longer supported.
-# If YPCOMPAT is defined and /var/yp/Makefile exists, sendmail will build
-#   both the NEWDB and DBM libraries (the DBM just for YP).
+# See READ_ME for a description of how these flags interact.
 #
 DBMDEF=        -DNDBM -DNEWDB
 
 #
 DBMDEF=        -DNDBM -DNEWDB
 
index 53e64f1..a59398d 100644 (file)
@@ -4,7 +4,7 @@
 #
 # %sccs.include.redist.sh%
 #
 #
 # %sccs.include.redist.sh%
 #
-#      @(#)READ_ME     8.12 (Berkeley) %G%
+#      @(#)READ_ME     8.13 (Berkeley) %G%
 #
 
 This directory contains the source files for sendmail.
 #
 
 This directory contains the source files for sendmail.
@@ -28,6 +28,42 @@ I provide them for information only.  Still, they may help you get
 started.  They have names like "Makefile.HPUX".
 
 
 started.  They have names like "Makefile.HPUX".
 
 
++----------------------+
+| DATABASE DEFINITIONS |
++----------------------+
+
+There are several database formats that can be used for the alias files
+and for general maps.  When used for alias files they interact in an
+attempt to be back compatible.
+
+The three options are NEWDB (the new Berkeley DB package), NDBM (the
+older DBM implementation -- the very old V7 implementation is no
+longer supported), and NIS (Network Information Services).  Used alone
+these just include the support they indicate.
+
+If NEWDB and NDBM are defined (but not NIS), then sendmail will read
+NDBM format alias files, but the next time a newaliases is run the
+format will be converted to NEWDB; that format will be used forever
+more.  This is intended as a transition feature.  [Note however that
+the NEWDB library also catches and maps NDBM calls; you will have to
+back out this feature to get this to work.  See ``Quirks'' section
+below for details.]
+
+If all three are defined, sendmail operates as described above, and also
+looks for the file /var/yp/Makefile.  If it exists, newaliases will
+build BOTH the NEWDB and NDBM format alias files.  However, it will
+only use the NEWDB file; the NDBM format file is used only by the
+NIS subsystem.
+
+If NDBM and NIS are defined (regardless of the definition of NEWDB
+or the existance of /var/yp/Makefile), sendmail adds the special
+tokens "YP_LAST_MODIFIED" and "YP_MASTER_NAME", both of which are
+required if the NDBM file is to be used as an NIS map.
+
+All of -DNEWDB, -DNDBM, and -DNIS are normally defined in the DBMDEF
+line in the Makefile.
+
+
 +---------------+
 | COMPILE FLAGS |
 +---------------+
 +---------------+
 | COMPILE FLAGS |
 +---------------+
@@ -132,14 +168,13 @@ Several are assumed based on other compilation flags -- if you want to
 flags that add support for special features include:
 
 NDBM           Include support for "new" DBM library for aliases and maps.
 flags that add support for special features include:
 
 NDBM           Include support for "new" DBM library for aliases and maps.
+               Normally defined in the Makefile.
 NEWDB          Include support for Berkeley "db" package (hash & btree)
 NEWDB          Include support for Berkeley "db" package (hash & btree)
-               for aliases and maps.
+               for aliases and maps.  Normally defined in the Makefile.
 NIS            Define this to get NIS (YP) support for aliases and maps.
 NIS            Define this to get NIS (YP) support for aliases and maps.
-YPCOMPAT       Define this to force building of DBM versions of alias
-               files even if you have NEWDB defined; this will only
-               occur on NIS master machines.  It is independent of NIS.
+               Normally defined in the Makefile.
 USERDB         Include support for the User Information Database.  Implied
 USERDB         Include support for the User Information Database.  Implied
-               by NEWDB conf.h.
+               by NEWDB in conf.h.
 IDENTPROTO     Define this to get IDENT (RFC 1413) protocol support.
                This is assumed unless you are running on Ultrix or
                HP-UX, both of which have a problem in the UDP
 IDENTPROTO     Define this to get IDENT (RFC 1413) protocol support.
                This is assumed unless you are running on Ultrix or
                HP-UX, both of which have a problem in the UDP
@@ -178,27 +213,36 @@ SETPROCTITLE      Try to set the string printed by "ps" to something
 | OPERATING SYSTEM AND COMPILE QUIRKS |
 +-------------------------------------+
 
 | OPERATING SYSTEM AND COMPILE QUIRKS |
 +-------------------------------------+
 
-If you are compiling on SunOS and want to use frozen configuration
-files, you must use -Bstatic -- if you do not, frozen configuration
-files fail in bizarre ways and you will open up several security holes.
+SunOS
+       If you are compiling on SunOS and want to use frozen configuration
+       files, you must use -Bstatic -- if you do not, frozen
+       configuration files fail in bizarre ways and you will open up
+       several security holes.
+
+       You may have to use -lresolv on SunOS.
 
 
-You may have to use -lresolv on SunOS.
+OSF/1
+       If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
 
 
-If you are compiling on OSF/1 (DEC Alpha), you must use -lmld.
+NeXT
+       If you are compiling on NeXT, you will have to create an empty
+       file "unistd.h" and create a file "dirent.h" containing:
 
 
-If you are compiling on NeXT, you will have to create an empty file
-"unistd.h" and create a file "dirent.h" containing:
+               #include <sys/dir.h>
+               #define dirent  direct
 
 
-       #include <sys/dir.h>
-       #define dirent  direct
+       (The Makefile.NeXT should try to do both of these for you.)
 
 
-(The Makefile.NeXT should try to do both of these for you.)
+BSDI (BSD/386)
+       I have reports that the "m4" from BSDI won't handle the config
+       files properly.  I haven't had a chance to test this myself.
 
 
-If you use both -DNDBM and -DNEWDB, you must delete the module ndbm.o
-from libdb.a and delete the file "ndbm.h" from the files that get
-installed (that is, use the OLD ndbm.h, not the new ndbm.h).  This
-compatibility module maps ndbm calls into DB calls, and breaks things
-rather badly.
+Both NEWDB and NDBM
+       If you use both -DNDBM and -DNEWDB, you must delete the module
+       ndbm.o from libdb.a and delete the file "ndbm.h" from the files
+       that get installed (that is, use the OLD ndbm.h, not the new
+       ndbm.h).  This compatibility module maps ndbm calls into DB
+       calls, and breaks things rather badly.
 
 
 +-----------------------------+
 
 
 +-----------------------------+
@@ -264,4 +308,4 @@ version.c   The version number and information about this
 
 Eric Allman
 
 
 Eric Allman
 
-(Version 8.12, last update %G% 08:10:30)
+(Version 8.13, last update %G% 11:32:03)
index c83e695..9f28d25 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #ifndef lint
  */
 
 #ifndef lint
-static char sccsid[] = "@(#)map.c      8.6 (Berkeley) %G%";
+static char sccsid[] = "@(#)map.c      8.7 (Berkeley) %G%";
 #endif /* not lint */
 
 #include "sendmail.h"
 #endif /* not lint */
 
 #include "sendmail.h"
@@ -497,7 +497,7 @@ ndbm_map_close(map)
 {
        if (bitset(MF_WRITABLE, map->map_mflags))
        {
 {
        if (bitset(MF_WRITABLE, map->map_mflags))
        {
-#ifdef YPCOMPAT
+#ifdef NIS
                bool inclnull;
                char buf[200];
 
                bool inclnull;
                char buf[200];
 
@@ -1099,7 +1099,7 @@ impl_map_open(map, mode)
        map->map_mflags |= MF_IMPL_HASH;
        if (hash_map_open(map, mode))
        {
        map->map_mflags |= MF_IMPL_HASH;
        if (hash_map_open(map, mode))
        {
-#if defined(NDBM) && defined(YPCOMPAT)
+#if defined(NDBM) && defined(NIS)
                if (mode == O_RDONLY || access("/var/yp/Makefile", R_OK) != 0)
 #endif
                        return TRUE;
                if (mode == O_RDONLY || access("/var/yp/Makefile", R_OK) != 0)
 #endif
                        return TRUE;