[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[patches] Implement the OPTION_EGLIBC_DB_ALIASES option group



I've committed the following.

ChangeLog.eglibc:
2007-08-22  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	Implement the OPTION_EGLIBC_DB_ALIASES option group.
	* option-groups.def (OPTION_EGLIBC_DB_ALIASES): New entry.
	* option-groups.defaults (OPTION_EGLIBC_DB_ALIASES): Initialize.
	* inet/Makefile (routines): Move getaliasent_r, getaliasent,
	getaliasname, and getaliasname_r into the group.
	* nss/Makefile (databases-y): Move alias into the option group.
	(CFLAGS-getent.c): Define OPTION_EGLIBC_DB_ALIASES as appropriate.
	* nss/getent.c (print_aliases, aliases_keys): Define these
	functions only if OPTION_EGLIBC_DB_ALIASES is enabled.
	(DA): New macro.
	(databases): Use DA to decide whether to include the aliases
	database in the list.
	* nis/Makefile (databases-y): Renamed from databases; uses
	changed.  Put alias in the group.
	
Index: option-groups.def
===================================================================
--- option-groups.def	(revision 3240)
+++ option-groups.def	(working copy)
@@ -145,6 +145,20 @@
           WCHAR_T           - EGLIBC's internal form (target-endian,
                               32-bit ISO 10646)
 
+config OPTION_EGLIBC_DB_ALIASES
+   bool "Functions for accessing the mail aliases database"
+   help
+       This option group includues functions for looking up mail
+       aliases in '/etc/aliases' or using nsswitch.  It includes the
+       following functions:
+
+         endaliasent
+         getaliasbyname
+         getaliasbyname_r
+         getaliasent
+         getaliasent_r
+         setaliasent
+
 config OPTION_EGLIBC_ENVZ
    bool "Functions for handling envz-style environment vectors."
    help
Index: inet/Makefile
===================================================================
--- inet/Makefile	(revision 3240)
+++ inet/Makefile	(working copy)
@@ -46,12 +46,13 @@
 	    ether_aton ether_aton_r ether_hton ether_line \
 	    ether_ntoa ether_ntoa_r ether_ntoh \
 	    getnetgrent_r getnetgrent \
-	    getaliasent_r getaliasent getaliasname getaliasname_r \
 	    in6_addr getnameinfo if_index ifaddrs \
 	    getipv4sourcefilter setipv4sourcefilter \
 	    getsourcefilter setsourcefilter
 routines-$(OPTION_EGLIBC_RCMD) \
 	 += rcmd rexec ruserpass
+routines-$(OPTION_EGLIBC_DB_ALIASES) \
+	 += getaliasent_r getaliasent getaliasname getaliasname_r
 routines-$(OPTION_EGLIBC_ADVANCED_INET6) \
 	 += inet6_option inet6_opt inet6_rth
 
Index: nss/Makefile
===================================================================
--- nss/Makefile	(revision 3240)
+++ nss/Makefile	(working copy)
@@ -35,7 +35,8 @@
 databases-y		= grp pwd spwd 
 databases-$(OPTION_EGLIBC_INET) \
 			+= proto service hosts network rpc ethers \
-			   netgrp key alias
+			   netgrp key
+databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
 
 # This is the trivial part which goes into libc itself.
 routines-y		+= nsswitch getnssent getnssent_r \
@@ -132,8 +133,11 @@
 OPTION_EGLIBC_INET-CFLAGS-$(OPTION_EGLIBC_INET) = -DOPTION_EGLIBC_INET=1
 OPTION_EGLIBC_NSSWITCH-CFLAGS-$(OPTION_EGLIBC_NSSWITCH) \
 	= -DOPTION_EGLIBC_NSSWITCH=1
+OPTION_EGLIBC_DB_ALIASES-CFLAGS-$(OPTION_EGLIBC_DB_ALIASES) \
+	= -DOPTION_EGLIBC_DB_ALIASES=1
 
 CFLAGS-nsswitch.c    = $(OPTION_EGLIBC_INET-CFLAGS-y) \
 		       $(OPTION_EGLIBC_NSSWITCH-CFLAGS-y)
 CFLAGS-getnssent_r.c = $(OPTION_EGLIBC_INET-CFLAGS-y)
-CFLAGS-getent.c      = $(OPTION_EGLIBC_INET-CFLAGS-y)
+CFLAGS-getent.c      = $(OPTION_EGLIBC_INET-CFLAGS-y) \
+		       $(OPTION_EGLIBC_DB_ALIASES-y)
Index: nss/getent.c
===================================================================
--- nss/getent.c	(revision 3240)
+++ nss/getent.c	(working copy)
@@ -88,7 +88,7 @@
   fprintf (stream, gettext ("Written by %s.\n"), "Thorsten Kukuk");
 }
 
-#ifdef OPTION_EGLIBC_INET
+#ifdef OPTION_EGLIBC_DB_ALIASES
 /* This is for aliases */
 static inline void
 print_aliases (struct aliasent *alias)
@@ -133,7 +133,9 @@
 
   return result;
 }
+#endif /* OPTION_EGLIBC_DB_ALIASES */
 
+#ifdef OPTION_EGLIBC_INET
 /* This is for ethers */
 static int
 ethers_keys (int number, char *key[])
@@ -744,15 +746,23 @@
   } databases[] =
   {
 #define D(name) { #name, name ## _keys },
+
 #ifdef OPTION_EGLIBC_INET
 #define DN(name) D(name)
 #else
 #define DN(name)
 #endif
+
+#ifdef OPTION_EGLIBC_DB_ALIASES
+#define DA(name) D(name)
+#else
+#define DA(name)
+#endif
+
 DN(ahosts)
 DN(ahostsv4)
 DN(ahostsv6)
-DN(aliases)
+DA(aliases)
 DN(ethers)
 D(group)
 DN(hosts)
Index: option-groups.defaults
===================================================================
--- option-groups.defaults	(revision 3240)
+++ option-groups.defaults	(working copy)
@@ -11,6 +11,7 @@
 OPTION_EGLIBC_ADVANCED_INET6 = y
 OPTION_EGLIBC_CATGETS = y
 OPTION_EGLIBC_CHARSETS = y
+OPTION_EGLIBC_DB_ALIASES = y
 OPTION_EGLIBC_ENVZ = y
 OPTION_EGLIBC_FSTAB = y
 OPTION_EGLIBC_GETLOGIN = y
Index: nis/Makefile
===================================================================
--- nis/Makefile	(revision 3240)
+++ nis/Makefile	(working copy)
@@ -31,8 +31,9 @@
 
 # These are the databases available for the nis (and perhaps later nisplus)
 # service.  This must be a superset of the services in nss.
-databases		= proto service hosts network grp pwd rpc ethers \
-			  spwd netgrp alias publickey
+databases-y		:= proto service hosts network grp pwd rpc ethers \
+			   spwd netgrp publickey
+databases-$(OPTION_EGLIBC_DB_ALIASES) += alias
 
 # Specify rules for the nss_* modules.
 # The 'compat' module includes nis support, and the 'nss' directory
@@ -67,11 +68,11 @@
 libnss_compat-routines	:= $(addprefix compat-,grp pwd spwd initgroups)
 libnss_compat-inhibit-o	= $(filter-out .os,$(object-suffixes))
 
-libnss_nis-routines	:= $(addprefix nis-,$(databases)) nis-initgroups \
+libnss_nis-routines	:= $(addprefix nis-,$(databases-y)) nis-initgroups \
 			   nss-nis
 libnss_nis-inhibit-o	= $(filter-out .os,$(object-suffixes))
 
-libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases)) nisplus-parser \
+libnss_nisplus-routines	:= $(addprefix nisplus-,$(databases-y)) nisplus-parser \
 			   nss-nisplus nisplus-initgroups
 libnss_nisplus-inhibit-o = $(filter-out .os,$(object-suffixes))