[PATCH] Remove compat from DEFAULT_CONFIG lookup strings
Steve Ellcey
sellcey@cavium.com
Fri Aug 18 20:50:00 GMT 2017
On Thu, 2017-08-17 at 20:18 -0400, DJ Delorie wrote:
> Also found (crude search) in:
>
> ./nss/nsswitch.c:Â Â Â Â Â Â Â Â nss_load_all_libraries ("passwd", "compat
> [NOTFOUND=return] files");Â
> ./nss/nsswitch.c:Â Â Â Â Â Â Â Â nss_load_all_libraries ("group", "compat
> [NOTFOUND=return] files");Â
> ./grp/initgroups.c:Â Â Â Â Â Â no_more = __nss_database_lookup ("group",
> NULL, "compat files",Â
> ./nscd/initgrcache.c:Â Â Â Â "compat [NOTFOUND=return] files",Â
>
> Do these need to be tweaked also?
I would think so. Â I did a search and didn't find any more "compat"
lookups beyond what you found. Â Not doing these changes didn't cause
any testsuite failures but it does seem like they should be changed. Â I
updated them and reran the testsuite and got no regressions. Â Here is
an updated patch.
Steve Ellcey
sellcey@cavium.com
2017-08-18  Steve Ellcey  <sellcey@cavium.com>
* nss/grp-lookup.c (DEFAULT_CONFIG): Remove compat method.
* nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise.
* nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise.
* grp/initgroups.c (internal_getgrouplist): Update lookup
methods in __nss_database_lookup call.
* nscd/initgrcache.c (addinitgroupsX): Likewise.
* nss/nsswitch.c (__nss_disable_nscd): Likewise.
diff --git a/grp/initgroups.c b/grp/initgroups.c
index 0d5b841..9aef82c 100644
--- a/grp/initgroups.c
+++ b/grp/initgroups.c
@@ -79,7 +79,7 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
  &__nss_initgroups_database) < 0)
 {
   if (__nss_group_database == NULL)
- Â Â Â Â no_more = __nss_database_lookup ("group", NULL, "compat files",
+ Â Â Â Â no_more = __nss_database_lookup ("group", NULL, "files",
      &__nss_group_database);
Â
   __nss_initgroups_database = __nss_group_database;
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index 4deb483..71a5f6c 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -85,9 +85,7 @@ addinitgroupsX (struct database_dyn *db, int fd, request_header *req,
   int no_more;
Â
   if (group_database == NULL)
-Â Â Â Â no_more = __nss_database_lookup ("group", NULL,
- Â Â Â Â Â "compat [NOTFOUND=return] files",
- Â Â Â Â Â &group_database);
+Â Â Â Â no_more = __nss_database_lookup ("group", NULL, "files", &group_database);
   else
     no_more = 0;
   nip = group_database;
diff --git a/nss/grp-lookup.c b/nss/grp-lookup.c
index 8cb00aa..256d2af 100644
--- a/nss/grp-lookup.c
+++ b/nss/grp-lookup.c
@@ -17,6 +17,6 @@
    <http://www.gnu.org/licenses/>.  */
Â
 #define DATABASE_NAME group
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#define DEFAULT_CONFIG "files"
Â
 #include "XXX-lookup.c"
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 8f31658..349cd1c 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -848,8 +848,8 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
   is_nscd = true;
Â
   /* Find all the relevant modules so that the init functions are called.  */
-Â Â nss_load_all_libraries ("passwd", "compat [NOTFOUND=return] files");
-Â Â nss_load_all_libraries ("group", "compat [NOTFOUND=return] files");
+Â Â nss_load_all_libraries ("passwd", "files");
+Â Â nss_load_all_libraries ("group", "files");
   nss_load_all_libraries ("hosts", "dns [!UNAVAIL=return] files");
   nss_load_all_libraries ("services", NULL);
Â
diff --git a/nss/pwd-lookup.c b/nss/pwd-lookup.c
index 00040d4..8612c39 100644
--- a/nss/pwd-lookup.c
+++ b/nss/pwd-lookup.c
@@ -17,6 +17,6 @@
    <http://www.gnu.org/licenses/>.  */
Â
 #define DATABASE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#define DEFAULT_CONFIG "files"
Â
 #include "XXX-lookup.c"
diff --git a/nss/spwd-lookup.c b/nss/spwd-lookup.c
index 319a7bb..2c866d1 100644
--- a/nss/spwd-lookup.c
+++ b/nss/spwd-lookup.c
@@ -18,6 +18,6 @@
Â
 #define DATABASE_NAME shadow
 #define ALTERNATE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#define DEFAULT_CONFIG "files"
Â
 #include "XXX-lookup.c"
More information about the Libc-alpha
mailing list