aboutsummaryrefslogtreecommitdiff
path: root/nss
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1996-08-30 00:58:28 +0000
committerUlrich Drepper <drepper@redhat.com>1996-08-30 00:58:28 +0000
commit6e953631df4b716fcf2d2bcfb62e44ffba2a6b40 (patch)
treea7258ce3689b120b270f0bedda5806092660774c /nss
parent747e2b436143d80406e21f647f7ba9837f73a173 (diff)
downloadglibc-6e953631df4b716fcf2d2bcfb62e44ffba2a6b40.tar
glibc-6e953631df4b716fcf2d2bcfb62e44ffba2a6b40.tar.gz
glibc-6e953631df4b716fcf2d2bcfb62e44ffba2a6b40.tar.bz2
glibc-6e953631df4b716fcf2d2bcfb62e44ffba2a6b40.zip
update from main archive 960829cvs/libc-960830
Fri Aug 30 01:26:44 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/unix/sysv/linux/i386/Dist: Add close.S. * sysdeps/unix/sysv/linux/m68k/Dist: Likewise. * sysdeps/unix/sysv/linux/alpha/Dist: Likewise. * version.c: Add comment about where to report bugs to. * catgets/gencat.c (usage): Likewise. * db/makedb.c (usage): Likewise. * locale/programs/locale.c (usage): Likewise. * locale/programs/localedef.c (usage): Likewise. * manual/socket.texi: A little bit better wording. Thu Aug 29 18:03:06 1996 Ulrich Drepper <drepper@cygnus.com> * Makerules: Make sure directory exists before generating stamp file. (BUILD_CFLAGS): Always refer to using $(..). * manual/Makefile: Make sure directory exists before generating stamp file. (make-target-directory): Add macro definition. * sysdeps/generic/Makefile: Make sure directory exists before generating stamp file. * Makefile (distribute): Add autolock.sh. Reported by Fila Kolodny. Tue Aug 27 10:06:22 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> When compiling in separate directory put objects into subdirectories matching the source layout. * Makeconfig (objpfx) [ifdef objdir]: Append $(subdir). When looking for configparms try in $(common-objpfx). Use $(common-objpfx)SUBDIR to find objects from other subdirectory builds. * Makerules: Add $(objpfx) to vpath list. (make-dummy-dep): Use $(common-objpfx) to avoid creating dummy.d more than once. All uses in dependency lists changed. (+make-deps): Make target directory. (sed-remove-objpfx): Substitute $(common-objpfx). (do-ar, build-extra-lib, $(common-objpfx)stub-$(subdir)): Use $(objpfx) instead of $(objdir) for cd command. (O%-lib): Always find libc relative to $(..). (subdir-stamps): Collect stamp files from subdirs. (common-mostlyclean): Remove stub file in $(common-objpfx). * MakeTAGS ($P/siglist.pot): Find siglist.c in stdio-common. * Rules (dep-dummy-lib): Use $(common-objpfx) to avoid creating to more than once. ($(objpfx)dummy.c, $(objpfx)empty.c): Change target name to use $(common-objfpx). All uses in dependency lists changed. (generated): Prepend $(..) to names. * bare/Makefile ($(objpfx)lib$(config-vendor).a): Remove $(objpfx) from $@. * nss/Makefile ($(objpfx)libnss_dns.so, $(objpfx)libnss_db.so): Use $(common-objpfx) instead of $(..) in dependencies. * sysdeps/mach/Makefile (mach-objpfx): Unconditionally use $(common-objpfx) instead of $(..) and (objpfx). * sysdeps/mach/hurd/Makefile (hurd-objpfx): Likewise. (rpath-link): Likewise. (rpcuserlibs): Likewise. * sysdeps/unix/Makefile [$(subdir) = stdio-common]: Check for errlist.c in $(objpfx), not $(common-objpfx). ($(common-objpfx)s-proto.d): Special rule not covered by pattern rule. * sysdeps/unix/make-syscalls.sh: Make syscall rules depending on s-proto.d in $(common-objpfx), not $(objpfx). Thu Aug 29 17:45:49 1996 Ulrich Drepper <drepper@cygnus.com> * nss/nsswitch.c (nss_dlerror_run): Free returned error string. Thu Aug 29 15:53:33 1996 Ulrich Drepper <drepper@cygnus.com> * sysdeps/libm-ieee754/e_acoshl.c: New file. `long double' implementation. * sysdeps/libm-ieee754/e_atanhl.c: Likewise. * sysdeps/libm-ieee754/e_remainderl.c: Likewise. * sysdeps/libm-ieee754/e_scalbl.c: Likewise. * sysdeps/libm-ieee754/s_asinhl.c: Likewise. * sysdeps/libm-ieee754/s_cosl.c: Likewise. * sysdeps/libm-ieee754/s_sinl.c: Likewise. * sysdeps/libm-ieee754/s_tanhl.c: Likewise. * sysdeps/libm-ieee754/s_tanl.c: Likewise. * stdio-common/printf_fp.c (__printf_fp): Use default value '.' if
Diffstat (limited to 'nss')
-rw-r--r--nss/Makefile5
-rw-r--r--nss/db-Makefile68
-rw-r--r--nss/nsswitch.c9
-rw-r--r--nss/nsswitch.conf16
4 files changed, 93 insertions, 5 deletions
diff --git a/nss/Makefile b/nss/Makefile
index 4a36dcf580..b900e96cc3 100644
--- a/nss/Makefile
+++ b/nss/Makefile
@@ -66,10 +66,9 @@ libnss_db-inhibit-o = $(filter-out .so,$(object-suffixes))
include ../Rules
-$(objpfx)libnss_dns.so: $(firstword $(objdir) $(..)resolv)/libresolv.so
+$(objpfx)libnss_dns.so: $(common-objpfx)resolv/libresolv.so
-$(objpfx)libnss_db.so: $(firstword $(objdir) $(..)db)/libdb.so \
- $(objpfx)libnss_files.so
+$(objpfx)libnss_db.so: $(common-objpfx)db/libdb.so $(objpfx)libnss_files.so
$(libnss_db-routines:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
@rm -f $@.new
diff --git a/nss/db-Makefile b/nss/db-Makefile
new file mode 100644
index 0000000000..881cabfa4b
--- /dev/null
+++ b/nss/db-Makefile
@@ -0,0 +1,68 @@
+DATABASES = $(wildcard /etc/passwd /etc/group /etc/ethers /etc/protocols \
+ /etc/rpc /etc/services /etc/shadow)
+
+VAR_DB = /var/db
+
+AWK = awk
+MAKEDB = makedb --quiet
+
+all: $(patsubst %,$(VAR_DB)/%.db,$(notdir $(DATABASES)))
+
+
+$(VAR_DB)/passwd.db: /etc/passwd
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/group.db: /etc/group
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+ /^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$3; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/ethers.db: /etc/ethers
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) '/^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/protocols.db: /etc/protocols
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) '/^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/rpc.db: /etc/rpc
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) '/^[^#]/ { printf ".%s ", $$1; print; \
+ printf "=%s ", $$2; print; \
+ for (i = 3; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s ", $$i; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/services.db: /etc/services
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS="[ \t/]+" } \
+ /^[^#]/ { printf ".%s/%s ", $$1, $$3; print; \
+ printf "=%s/%s ", $$2, $$3; print; \
+ for (i = 4; i <= NF && !($$i ~ /^#/); ++i) \
+ { printf ".%s/%s ", $$i, $$3; print } }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
+
+$(VAR_DB)/shadow.db: /etc/shadow
+ @echo -n "$(patsubst %.db,%,$(@F))... "
+ @$(AWK) 'BEGIN { FS=":"; OFS=":" } \
+ /^[^#]/ { printf ".%s ", $$1; print }' $^ | \
+ $(MAKEDB) -o $@ -
+ @echo "done."
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 16e1caf50d..79c9d2706d 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -235,12 +235,17 @@ __nss_configure_lookup (const char *dbname, const char *service_line)
static int
nss_dlerror_run (void (*operate) (void))
{
- const char *last_errstring = NULL;
+ char *last_errstring = NULL;
const char *last_object_name = NULL;
+ int result;
(void) _dl_catch_error (&last_errstring, &last_object_name, operate);
- return last_errstring != NULL;
+ result = last_errstring != NULL;
+ if (result)
+ free (last_errstring);
+
+ return result;
}
diff --git a/nss/nsswitch.conf b/nss/nsswitch.conf
new file mode 100644
index 0000000000..08bd96ea10
--- /dev/null
+++ b/nss/nsswitch.conf
@@ -0,0 +1,16 @@
+# /etc/nsswitch.conf
+#
+# Example configuration of GNU Name Service Switch functionality.
+#
+
+passwd: db files
+group: db files
+shadow: db files
+
+hosts: files dns
+networks: files dns
+
+protocols: db files
+services: db files
+ethers: db files
+rpc: db files