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

[commits] r3241 - in /trunk/libc: ./ inet/ nis/ nss/



Author: jimb
Date: Wed Aug 22 14:26:59 2007
New Revision: 3241

Log:
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.

Modified:
    trunk/libc/ChangeLog.eglibc
    trunk/libc/inet/Makefile
    trunk/libc/nis/Makefile
    trunk/libc/nss/Makefile
    trunk/libc/nss/getent.c
    trunk/libc/option-groups.def
    trunk/libc/option-groups.defaults

Modified: trunk/libc/ChangeLog.eglibc
==============================================================================
--- trunk/libc/ChangeLog.eglibc (original)
+++ trunk/libc/ChangeLog.eglibc Wed Aug 22 14:26:59 2007
@@ -1,3 +1,20 @@
+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.
+	
 2007-08-21  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>
 
 	Implement the OPTION_EGLIBC_WORDEXP option group.

Modified: trunk/libc/inet/Makefile
==============================================================================
--- trunk/libc/inet/Makefile (original)
+++ trunk/libc/inet/Makefile Wed Aug 22 14:26:59 2007
@@ -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
 

Modified: trunk/libc/nis/Makefile
==============================================================================
--- trunk/libc/nis/Makefile (original)
+++ trunk/libc/nis/Makefile Wed Aug 22 14:26:59 2007
@@ -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))
 

Modified: trunk/libc/nss/Makefile
==============================================================================
--- trunk/libc/nss/Makefile (original)
+++ trunk/libc/nss/Makefile Wed Aug 22 14:26:59 2007
@@ -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)

Modified: trunk/libc/nss/getent.c
==============================================================================
--- trunk/libc/nss/getent.c (original)
+++ trunk/libc/nss/getent.c Wed Aug 22 14:26:59 2007
@@ -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)

Modified: trunk/libc/option-groups.def
==============================================================================
--- trunk/libc/option-groups.def (original)
+++ trunk/libc/option-groups.def Wed Aug 22 14:26:59 2007
@@ -144,6 +144,23 @@
 
           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
+
+       When this option group is disabled, the NSS service libraries
+       also lack support for querying their mail alias tables.
 
 config OPTION_EGLIBC_ENVZ
    bool "Functions for handling envz-style environment vectors."

Modified: trunk/libc/option-groups.defaults
==============================================================================
--- trunk/libc/option-groups.defaults (original)
+++ trunk/libc/option-groups.defaults Wed Aug 22 14:26:59 2007
@@ -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