Remove compat from DEFAULT_CONFIG lookup strings
Commit Message
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.
Comments
On Fri, 18 Aug 2017, Steve Ellcey wrote:
> 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.
Does this affect any defaults visible to glibc users? If it does, it
needs an entry in the "Deprecated and removed features, and other changes
affecting compatibility" section of NEWS.
On Fri, 2017-08-18 at 21:12 +0000, Joseph Myers wrote:
> On Fri, 18 Aug 2017, Steve Ellcey wrote:
>
> >
> > 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.
> Does this affect any defaults visible to glibc users? If it does, it
> needs an entry in the "Deprecated and removed features, and other changes
> affecting compatibility" section of NEWS.
I think everything is already in the 2.26 Depreciated section. This
was done when the original patch to remove libnss_compat was made.
These changes are just dealing with the fact that that patch was
incomplete.
https://sourceware.org/ml/libc-alpha/2017-08/msg00010.html
* The NIS(+) name service modules, libnss_nis, libnss_nisplus, and
libnss_compat, are deprecated, and will not be built or installed by
default.
The NIS(+) support library, libnsl, is also deprecated. By default, a
compatibility shared library will be built and installed, but not headers
or development libraries. Only a few NIS-related programs require this
library. (In particular, the GNU C Library has never required programs
that use 'gethostbyname' to be linked with libnsl.)
Replacement implementations based on TIRPC, which additionally support
IPv6, are available from <https://github.com/thkukuk/>. The configure
option --enable-obsolete-nsl will cause libnsl's headers, and the NIS(+)
name service modules, to be built and installed.
On Fri, 18 Aug 2017, Steve Ellcey wrote:
> On Fri, 2017-08-18 at 21:12 +0000, Joseph Myers wrote:
> > On Fri, 18 Aug 2017, Steve Ellcey wrote:
> >
> > >
> > > 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.
> > Does this affect any defaults visible to glibc users? If it does, it
> > needs an entry in the "Deprecated and removed features, and other changes
> > affecting compatibility" section of NEWS.
>
> I think everything is already in the 2.26 Depreciated section. This
> was done when the original patch to remove libnss_compat was made.
> These changes are just dealing with the fact that that patch was
> incomplete.
But the impression that NEWS entry gives is that you can use
--enable-obsolete-nsl to get back the previous semantics. Does your patch
change the semantics in the --enable-obsolete-nsl case?
On Fri, 2017-08-18 at 22:12 +0000, Joseph Myers wrote:
>
> But the impression that NEWS entry gives is that you can use
> --enable-obsolete-nsl to get back the previous semantics. Does your patch
> change the semantics in the --enable-obsolete-nsl case?
That is a good point. I hadn't considered it, but this patch does
change the semantics when --enable-obsolete-nsl is used. I guess the
question is: do we think that is OK and just need to document the
changes or do we need to ifdef the code changes so that when --enable-
obsolete-nsl is used, we get the existing behavour. I am inclined to
ifdef the code to preserve the current behavour under the enable
option.
Steve Ellcey
sellcey@cavium.com
@@ -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;
@@ -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;
@@ -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"
@@ -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);
Â
@@ -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"
@@ -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"