From: Steve Ellcey <sellcey@cavium.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: DJ Delorie <dj@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH] Remove compat from DEFAULT_CONFIG lookup strings
Date: Tue, 22 Aug 2017 16:33:00 -0000 [thread overview]
Message-ID: <1503419610.28672.3.camel@cavium.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1708182211180.1807@digraph.polyomino.org.uk>
[-- Attachment #1: Type: text/plain, Size: 904 bytes --]
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?
Here is an updated patch that maintains the original semantics and
default settings when --enable-obsolete-nsl is used.
Steve Ellcey
sellcey@cavium.com
2017-08-22  Steve Ellcey  <sellcey@cavium.com>
* grp/initgroups.c: Include config.h.
(DEFAULT_CONFIG): New macro.
(internal_getgrouplist): Use DEFAULT_CONFIG.
* nscd/initgrcache.c (addinitgroupsX): Likewise.
* nss/nsswitch.c (__nss_disable_nscd): Likewise.
* nss/grp-lookup.c: Include config.h
(DEFAULT_CONFIG): Set definition based on LINK_OBSOLETE_NSL.
* nss/pwd-lookup.c (DEFAULT_CONFIG): Likewise.
* nss/spwd-lookup.c (DEFAULT_CONFIG): Likewise.
[-- Attachment #2: nls.compat.patch --]
[-- Type: text/x-patch, Size: 4484 bytes --]
diff --git a/grp/initgroups.c b/grp/initgroups.c
index 0d5b841..4448afe 100644
--- a/grp/initgroups.c
+++ b/grp/initgroups.c
@@ -26,10 +26,16 @@
#include <sys/types.h>
#include <nsswitch.h>
#include <scratch_buffer.h>
+#include <config.h>
#include "../nscd/nscd-client.h"
#include "../nscd/nscd_proto.h"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
/* Type of the lookup function. */
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
@@ -79,7 +85,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, DEFAULT_CONFIG,
&__nss_group_database);
__nss_initgroups_database = __nss_group_database;
diff --git a/nscd/initgrcache.c b/nscd/initgrcache.c
index 4deb483..4114fbe 100644
--- a/nscd/initgrcache.c
+++ b/nscd/initgrcache.c
@@ -25,6 +25,7 @@
#include <unistd.h>
#include <sys/mman.h>
#include <scratch_buffer.h>
+#include <config.h>
#include "dbg_log.h"
#include "nscd.h"
@@ -34,6 +35,11 @@
#include "../nss/nsswitch.h"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
/* Type of the lookup function. */
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
@@ -85,8 +91,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",
+ no_more = __nss_database_lookup ("group", NULL, DEFAULT_CONFIG,
&group_database);
else
no_more = 0;
diff --git a/nss/grp-lookup.c b/nss/grp-lookup.c
index 8cb00aa..7c019f8 100644
--- a/nss/grp-lookup.c
+++ b/nss/grp-lookup.c
@@ -16,7 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <config.h>
+
#define DATABASE_NAME group
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
#include "XXX-lookup.c"
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index 8f31658..f6365a9 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -40,6 +40,13 @@
#include "nsswitch.h"
#include "../nscd/nscd_proto.h"
#include <sysdep.h>
+#include <config.h>
+
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
/* Prototypes for the local functions. */
static name_database *nss_parse_file (const char *fname) internal_function;
@@ -848,8 +855,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", DEFAULT_CONFIG);
+ nss_load_all_libraries ("group", DEFAULT_CONFIG);
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..180ac7c 100644
--- a/nss/pwd-lookup.c
+++ b/nss/pwd-lookup.c
@@ -16,7 +16,13 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <config.h>
+
#define DATABASE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
#include "XXX-lookup.c"
diff --git a/nss/spwd-lookup.c b/nss/spwd-lookup.c
index 319a7bb..f12156d 100644
--- a/nss/spwd-lookup.c
+++ b/nss/spwd-lookup.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <config.h>
+
#define DATABASE_NAME shadow
#define ALTERNATE_NAME passwd
-#define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#ifdef LINK_OBSOLETE_NSL
+# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
+#else
+# define DEFAULT_CONFIG "files"
+#endif
#include "XXX-lookup.c"
next prev parent reply other threads:[~2017-08-22 16:33 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-17 21:31 Steve Ellcey
2017-08-18 0:18 ` DJ Delorie
2017-08-18 20:50 ` Steve Ellcey
2017-08-18 21:12 ` Joseph Myers
2017-08-18 21:35 ` Steve Ellcey
2017-08-18 22:12 ` Joseph Myers
2017-08-18 22:17 ` Steve Ellcey
2017-08-22 16:33 ` Steve Ellcey [this message]
2017-08-22 21:07 ` DJ Delorie
2017-08-28 20:23 ` Steve Ellcey
2017-08-28 20:48 ` Joseph Myers
2017-08-28 21:50 ` Steve Ellcey
2017-08-28 22:58 ` Joseph Myers
2017-08-29 19:04 ` Steve Ellcey
2017-08-29 20:23 ` Joseph Myers
2017-08-29 20:57 ` DJ Delorie
2017-08-31 7:21 ` Andreas Schwab
2017-08-31 15:25 ` Steve Ellcey
2017-09-11 20:01 ` Steve Ellcey
2017-09-11 20:39 ` DJ Delorie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1503419610.28672.3.camel@cavium.com \
--to=sellcey@cavium.com \
--cc=dj@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).