mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
Remove compat from DEFAULT_CONFIG lookup strings
* 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. (DEFAULT_DEFCONFIG): New macro. (__nss_database_lookup): Use DEFAULT_DEFCONFIG. * 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. * manual/nss.texi: Update default values section.
This commit is contained in:
15
ChangeLog
15
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
2017-09-12 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.
|
||||||
|
(DEFAULT_DEFCONFIG): New macro.
|
||||||
|
(__nss_database_lookup): Use DEFAULT_DEFCONFIG.
|
||||||
|
* 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.
|
||||||
|
* manual/nss.texi: Update default values section.
|
||||||
|
|
||||||
2017-09-12 H.J. Lu <hongjiu.lu@intel.com>
|
2017-09-12 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
[BZ #21967]
|
[BZ #21967]
|
||||||
|
@ -26,10 +26,16 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <nsswitch.h>
|
#include <nsswitch.h>
|
||||||
#include <scratch_buffer.h>
|
#include <scratch_buffer.h>
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include "../nscd/nscd-client.h"
|
#include "../nscd/nscd-client.h"
|
||||||
#include "../nscd/nscd_proto.h"
|
#include "../nscd/nscd_proto.h"
|
||||||
|
|
||||||
|
#ifdef LINK_OBSOLETE_NSL
|
||||||
|
# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
|
||||||
|
#else
|
||||||
|
# define DEFAULT_CONFIG "files"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Type of the lookup function. */
|
/* Type of the lookup function. */
|
||||||
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
|
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
|
||||||
@ -77,7 +83,7 @@ internal_getgrouplist (const char *user, gid_t group, long int *size,
|
|||||||
&__nss_initgroups_database) < 0)
|
&__nss_initgroups_database) < 0)
|
||||||
{
|
{
|
||||||
if (__nss_group_database == NULL)
|
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_group_database);
|
||||||
|
|
||||||
__nss_initgroups_database = __nss_group_database;
|
__nss_initgroups_database = __nss_group_database;
|
||||||
|
@ -318,13 +318,17 @@ The @code{passwd}, @code{group}, and @code{shadow} databases are
|
|||||||
traditionally handled in a special way. The appropriate files in the
|
traditionally handled in a special way. The appropriate files in the
|
||||||
@file{/etc} directory are read but if an entry with a name starting
|
@file{/etc} directory are read but if an entry with a name starting
|
||||||
with a @code{+} character is found NIS is used. This kind of lookup
|
with a @code{+} character is found NIS is used. This kind of lookup
|
||||||
remains possible by using the special lookup service @code{compat}
|
remains possible if @theglibc{} was configured with the
|
||||||
and the default value for the three databases above is
|
@code{--enable-obsolete-nsl} option and the special lookup service
|
||||||
@code{compat [NOTFOUND=return] files}.
|
@code{compat} is used. If @theglibc{} was configured with the
|
||||||
|
@code{--enable-obsolete-nsl} option the default value for the three
|
||||||
|
databases above is @code{compat [NOTFOUND=return] files}. If the
|
||||||
|
@code{--enable-obsolete-nsl} option was not used the default value
|
||||||
|
for the services is @code{files}.
|
||||||
|
|
||||||
For all other databases the default value is
|
For all other databases the default value is @code{files} unless
|
||||||
@code{nis [NOTFOUND=return] files}. This solution gives the best
|
@theglibc{} was configured with @code{--enable-obsolete-rpc} option, in
|
||||||
chance to be correct since NIS and file based lookups are used.
|
which case it the default value is @code{nis [NOTFOUND=return] files}.
|
||||||
|
|
||||||
@cindex optimizing NSS
|
@cindex optimizing NSS
|
||||||
A second point is that the user should try to optimize the lookup
|
A second point is that the user should try to optimize the lookup
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#include <scratch_buffer.h>
|
#include <scratch_buffer.h>
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#include "dbg_log.h"
|
#include "dbg_log.h"
|
||||||
#include "nscd.h"
|
#include "nscd.h"
|
||||||
@ -34,6 +35,11 @@
|
|||||||
|
|
||||||
#include "../nss/nsswitch.h"
|
#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. */
|
/* Type of the lookup function. */
|
||||||
typedef enum nss_status (*initgroups_dyn_function) (const char *, gid_t,
|
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;
|
int no_more;
|
||||||
|
|
||||||
if (group_database == NULL)
|
if (group_database == NULL)
|
||||||
no_more = __nss_database_lookup ("group", NULL,
|
no_more = __nss_database_lookup ("group", NULL, DEFAULT_CONFIG,
|
||||||
"compat [NOTFOUND=return] files",
|
|
||||||
&group_database);
|
&group_database);
|
||||||
else
|
else
|
||||||
no_more = 0;
|
no_more = 0;
|
||||||
|
@ -16,7 +16,13 @@
|
|||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#define DATABASE_NAME group
|
#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"
|
#include "XXX-lookup.c"
|
||||||
|
@ -40,6 +40,15 @@
|
|||||||
#include "nsswitch.h"
|
#include "nsswitch.h"
|
||||||
#include "../nscd/nscd_proto.h"
|
#include "../nscd/nscd_proto.h"
|
||||||
#include <sysdep.h>
|
#include <sysdep.h>
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
|
#ifdef LINK_OBSOLETE_NSL
|
||||||
|
# define DEFAULT_CONFIG "compat [NOTFOUND=return] files"
|
||||||
|
# define DEFAULT_DEFCONFIG "nis [NOTFOUND=return] files"
|
||||||
|
#else
|
||||||
|
# define DEFAULT_CONFIG "files"
|
||||||
|
# define DEFAULT_DEFCONFIG "files"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Prototypes for the local functions. */
|
/* Prototypes for the local functions. */
|
||||||
static name_database *nss_parse_file (const char *fname);
|
static name_database *nss_parse_file (const char *fname);
|
||||||
@ -152,8 +161,7 @@ __nss_database_lookup (const char *database, const char *alternate_name,
|
|||||||
or null to use the most common default. */
|
or null to use the most common default. */
|
||||||
if (*ni == NULL)
|
if (*ni == NULL)
|
||||||
{
|
{
|
||||||
*ni = nss_parse_service_list (defconfig
|
*ni = nss_parse_service_list (defconfig ?: DEFAULT_DEFCONFIG);
|
||||||
?: "nis [NOTFOUND=return] files");
|
|
||||||
if (*ni != NULL)
|
if (*ni != NULL)
|
||||||
{
|
{
|
||||||
/* Record the memory we've just allocated in defconfig_entries list,
|
/* Record the memory we've just allocated in defconfig_entries list,
|
||||||
@ -847,8 +855,8 @@ __nss_disable_nscd (void (*cb) (size_t, struct traced_file *))
|
|||||||
is_nscd = true;
|
is_nscd = true;
|
||||||
|
|
||||||
/* Find all the relevant modules so that the init functions are called. */
|
/* 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 ("passwd", DEFAULT_CONFIG);
|
||||||
nss_load_all_libraries ("group", "compat [NOTFOUND=return] files");
|
nss_load_all_libraries ("group", DEFAULT_CONFIG);
|
||||||
nss_load_all_libraries ("hosts", "dns [!UNAVAIL=return] files");
|
nss_load_all_libraries ("hosts", "dns [!UNAVAIL=return] files");
|
||||||
nss_load_all_libraries ("services", NULL);
|
nss_load_all_libraries ("services", NULL);
|
||||||
|
|
||||||
|
@ -16,7 +16,13 @@
|
|||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#define DATABASE_NAME passwd
|
#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"
|
#include "XXX-lookup.c"
|
||||||
|
@ -16,8 +16,14 @@
|
|||||||
License along with the GNU C Library; if not, see
|
License along with the GNU C Library; if not, see
|
||||||
<http://www.gnu.org/licenses/>. */
|
<http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#define DATABASE_NAME shadow
|
#define DATABASE_NAME shadow
|
||||||
#define ALTERNATE_NAME passwd
|
#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"
|
#include "XXX-lookup.c"
|
||||||
|
Reference in New Issue
Block a user