aboutsummaryrefslogtreecommitdiff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/nss.h5
-rw-r--r--nss/nsswitch.c19
2 files changed, 14 insertions, 10 deletions
diff --git a/nss/nss.h b/nss/nss.h
index 1ba7bc8..8cf2565 100644
--- a/nss/nss.h
+++ b/nss/nss.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,8 @@
#include <features.h>
/* Revision number of NSS interface (must be a string). */
-#define NSS_SHLIB_REVISION ".1"
+#define NSS_SHLIB_REVISION __nss_shlib_revision
+extern const char *const __nss_shlib_revision;
__BEGIN_DECLS
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 1b061fa..201a2bc 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -27,6 +27,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <gnu/lib-names.h>
#include "nsswitch.h"
@@ -63,8 +64,8 @@ static struct
__libc_lock_define_initialized (static, lock)
-/* Nonzero if the sevices are already initialized. */
-static int nss_initialized;
+/* String with revision number of the shared object files. */
+const char *const __nss_shlib_revision = LIBNSS_FILES_SO + 15;
/* The root of the whole data base. */
@@ -88,7 +89,8 @@ __nss_database_lookup (const char *database, const char *alternate_name,
return 0;
}
- if (nss_initialized == 0 && service_table == NULL)
+ /* Are we initialized yet? */
+ if (service_table == NULL)
/* Read config file. */
service_table = nss_parse_file (_PATH_NSSWITCH_CONF);
@@ -330,7 +332,7 @@ nss_lookup_function (service_user *ni, const char *fct_name)
{
/* Load the shared library. */
size_t shlen = (7 + strlen (ni->library->name) + 3
- + sizeof (NSS_SHLIB_REVISION));
+ + strlen (NSS_SHLIB_REVISION) + 1);
char shlib_name[shlen];
void do_open (void)
@@ -340,9 +342,10 @@ nss_lookup_function (service_user *ni, const char *fct_name)
}
/* Construct shared object name. */
- __stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"),
- ni->library->name),
- ".so" NSS_SHLIB_REVISION);
+ __stpcpy (__stpcpy (__stpcpy (__stpcpy (shlib_name, "libnss_"),
+ ni->library->name),
+ ".so"),
+ NSS_SHLIB_REVISION);
if (nss_dlerror_run (do_open) != 0)
/* Failed to load the library. */