Skip to content

Commit

Permalink
Merge remote branch 'origin/release/2.11/master' into fedora/2.11/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Schwab committed Mar 18, 2010
2 parents 07a2235 + 11c19d3 commit 46cbe83
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 121 deletions.
31 changes: 31 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,37 @@
used later with MMAP_FIXED | MMAP_SHARED to cope with different
alignment restrictions.

2010-01-14 Ulrich Drepper <drepper@redhat.com>

[BZ #11127]
* posix/regcomp.c (alc_eclosure_iter): Do not ignore
re_node_set_insert failure; return REG_ESPACE.
Patch by Paul Eggert.

2010-01-06 Ulrich Drepper <drepper@redhat.com>

* dirent/dirent.h: Fix typo in feature selection macro use.

2009-12-15 Ulrich Drepper <drepper@redhat.com>

* include/link.h (struct link_map): Move l_used into its own word.
* elf/dl-lookup.c (_dl_lookup_symbol_x): Only update l_used when it is
still zero.
* elf/dl-object.c (_dl_new_object): Set dl_used if we know it is
never really used.

2009-12-10 Ulrich Drepper <drepper@redhat.com>

[BZ #11000]
* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname4_r): Always set
*herrnop before returning.
* nis/nss_nisplus/nisplus-hosts.c (internal_gethostbyname2_r):
Likewise.
* nss/nss_files/files-hosts.c (_nss_files_gethostbyname4_r): Handle
TRYAGAIN errors separately.
* sysdeps/posix/getaddrinfo.c (gaih_inet): Fix error handling of
*name4_r after functions.

2009-11-24 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/grantpt.c (grantpt): Use CLOSE_ALL_FDS is available
Expand Down
4 changes: 2 additions & 2 deletions dirent/dirent.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1991-2000, 2003-2005, 2009 Free Software Foundation, Inc.
/* Copyright (C) 1991-2000,2003-2005,2009,2010 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
Expand Down Expand Up @@ -218,7 +218,7 @@ extern void seekdir (DIR *__dirp, long int __pos) __THROW __nonnull ((1));
extern long int telldir (DIR *__dirp) __THROW __nonnull ((1));
#endif

#if defined __USE_BSD || defined __USE_MISC || defined __XOPEN_2K8
#if defined __USE_BSD || defined __USE_MISC || defined __XOPEN2K8

/* Return the file descriptor used by DIRP. */
extern int dirfd (DIR *__dirp) __THROW __nonnull ((1));
Expand Down
7 changes: 4 additions & 3 deletions elf/dl-lookup.c
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
if (__builtin_expect (protected != 0, 0))
{
/* It is very tricky. We need to figure out what value to
return for the protected symbol. */
return for the protected symbol. */
if (type_class == ELF_RTYPE_CLASS_PLT)
{
if (current_value.s != NULL && current_value.m != undef_map)
Expand Down Expand Up @@ -822,7 +822,8 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map,
version, type_class, flags, skip_map);

/* The object is used. */
current_value.m->l_used = 1;
if (__builtin_expect (current_value.m->l_used == 0, 0))
current_value.m->l_used = 1;

if (__builtin_expect (GLRO(dl_debug_mask)
& (DL_DEBUG_BINDINGS|DL_DEBUG_PRELINK), 0))
Expand All @@ -844,7 +845,7 @@ _dl_setup_hash (struct link_map *map)
Elf_Symndx nchain;

if (__builtin_expect (map->l_info[DT_ADDRTAGIDX (DT_GNU_HASH) + DT_NUM
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_THISPROCNUM + DT_VERSIONTAGNUM
+ DT_EXTRANUM + DT_VALNUM] != NULL, 1))
{
Elf32_Word *hash32
Expand Down
8 changes: 6 additions & 2 deletions elf/dl-object.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Storage management for the chain of loaded shared objects.
Copyright (C) 1995-2002,2004,2006,2007,2008 Free Software Foundation, Inc.
Copyright (C) 1995-2002,2004,2006-2008,2009 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
Expand Down Expand Up @@ -67,6 +67,10 @@ _dl_new_object (char *realname, const char *libname, int type,

new->l_name = realname;
new->l_type = type;
/* If we set the bit now since we know it is never used we avoid
dirtying the cache line later. */
if ((GLRO(dl_debug_mask) & DL_DEBUG_UNUSED) == 0)
new->l_used = 1;
new->l_loader = loader;
#if NO_TLS_OFFSET != 0
new->l_tls_offset = NO_TLS_OFFSET;
Expand Down Expand Up @@ -174,7 +178,7 @@ _dl_new_object (char *realname, const char *libname, int type,
if (result == NULL)
{
/* We were not able to determine the current directory.
Note that free(origin) is OK if origin == NULL. */
Note that free(origin) is OK if origin == NULL. */
free (origin);
origin = (char *) -1;
goto out;
Expand Down
8 changes: 5 additions & 3 deletions include/link.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Data structure for communication from the run-time dynamic linker for
loaded ELF shared objects.
Copyright (C) 1995-2006, 2007 Free Software Foundation, Inc.
Copyright (C) 1995-2006, 2007, 2009 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
Expand Down Expand Up @@ -180,7 +180,6 @@ struct link_map
unsigned int l_need_tls_init:1; /* Nonzero if GL(dl_init_static_tls)
should be called on this link map
when relocation finishes. */
unsigned int l_used:1; /* Nonzero if the DSO is used. */
unsigned int l_auditing:1; /* Nonzero if the DSO is used in auditing. */
unsigned int l_audit_any_plt:1; /* Nonzero if at least one audit module
is interested in the PLT interception.*/
Expand Down Expand Up @@ -239,12 +238,15 @@ struct link_map
struct link_map **l_initfini;

/* List of the dependencies introduced through symbol binding. */
unsigned int l_reldepsmax;
struct link_map_reldeps
{
unsigned int act;
struct link_map *list[];
} *l_reldeps;
unsigned int l_reldepsmax;

/* Nonzero if the DSO is used. */
unsigned int l_used;

/* Various flag words. */
ElfW(Word) l_feature_1;
Expand Down
47 changes: 25 additions & 22 deletions nis/nss_nis/nis-hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ LINE_PARSER
{
assert ((flags & AI_V4MAPPED) == 0 || af != AF_UNSPEC);
if (flags & AI_V4MAPPED)
{
map_v4v6_address ((char *) entdata->host_addr,
(char *) entdata->host_addr);
result->h_addrtype = AF_INET6;
result->h_length = IN6ADDRSZ;
}
{
map_v4v6_address ((char *) entdata->host_addr,
(char *) entdata->host_addr);
result->h_addrtype = AF_INET6;
result->h_length = IN6ADDRSZ;
}
else
{
result->h_addrtype = AF_INET;
result->h_length = INADDRSZ;
}
{
result->h_addrtype = AF_INET;
result->h_length = INADDRSZ;
}
}
else if (af != AF_INET
&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
&& inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
{
result->h_addrtype = AF_INET6;
result->h_length = IN6ADDRSZ;
Expand Down Expand Up @@ -164,14 +164,14 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
int keylen;
int yperr;
if (new_start)
yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result,
yperr = yp_first (domain, "hosts.byname", &outkey, &keylen, &result,
&len);
else
yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey,
yperr = yp_next (domain, "hosts.byname", oldkey, oldkeylen, &outkey,
&keylen, &result, &len);

if (__builtin_expect (yperr != YPERR_SUCCESS, 0))
{
{
enum nss_status retval = yperr2nss (yperr);

switch (retval)
Expand All @@ -191,12 +191,12 @@ internal_nis_gethostent_r (struct hostent *host, char *buffer,
}

if (__builtin_expect ((size_t) (len + 1) > linebuflen, 0))
{
free (result);
{
free (result);
*h_errnop = NETDB_INTERNAL;
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}

char *p = strncpy (data->linebuffer, result, len);
data->linebuffer[len] = '\0';
Expand Down Expand Up @@ -233,7 +233,7 @@ _nss_nis_gethostent_r (struct hostent *host, char *buffer, size_t buflen,
__libc_lock_lock (lock);

status = internal_nis_gethostent_r (host, buffer, buflen, errnop, h_errnop,
((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
((_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET),
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0 ));

__libc_lock_unlock (lock);
Expand Down Expand Up @@ -346,7 +346,7 @@ _nss_nis_gethostbyname2_r (const char *name, int af, struct hostent *host,

return internal_gethostbyname2_r (name, af, host, buffer, buflen, errnop,
h_errnop,
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
((_res.options & RES_USE_INET6) ? AI_V4MAPPED : 0));
}


Expand Down Expand Up @@ -456,7 +456,10 @@ _nss_nis_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
{
char *domain;
if (yp_get_default_domain (&domain))
return NSS_STATUS_UNAVAIL;
{
*herrnop = NO_DATA;
return NSS_STATUS_UNAVAIL;
}

/* Convert name to lowercase. */
size_t namlen = strlen (name);
Expand Down
58 changes: 31 additions & 27 deletions nis/nss_nisplus/nisplus-hosts.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 1997-2003, 2005, 2006, 2008 Free Software Foundation, Inc.
/* Copyright (C) 1997-2003, 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
Expand Down Expand Up @@ -38,10 +38,10 @@ static nis_name tablename_val;
static u_long tablename_len;

#define NISENTRYVAL(idx, col, res) \
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val)
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val)

#define NISENTRYLEN(idx, col, res) \
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len)
(NIS_RES_OBJECT (res)[idx].EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len)

/* Get implementation for some internal functions. */
#include <resolv/mapv4v6addr.h>
Expand Down Expand Up @@ -287,15 +287,15 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
enum nss_status retval = niserr2nss (result->status);
if (retval == NSS_STATUS_TRYAGAIN)
{
*herrnop = NETDB_INTERNAL;
*errnop = errno;
}
return retval;
}
{
enum nss_status retval = niserr2nss (result->status);
if (retval == NSS_STATUS_TRYAGAIN)
{
*herrnop = NETDB_INTERNAL;
*errnop = errno;
}
return retval;
}

}
else
Expand All @@ -308,18 +308,18 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
return NSS_STATUS_TRYAGAIN;
}
if (niserr2nss (result->status) != NSS_STATUS_SUCCESS)
{
enum nss_status retval= niserr2nss (result->status);
{
enum nss_status retval= niserr2nss (result->status);

nis_freeresult (result);
result = saved_res;
if (retval == NSS_STATUS_TRYAGAIN)
{
*herrnop = NETDB_INTERNAL;
if (retval == NSS_STATUS_TRYAGAIN)
{
*herrnop = NETDB_INTERNAL;
*errnop = errno;
}
return retval;
}
}
return retval;
}
}

if (_res.options & RES_USE_INET6)
Expand All @@ -330,13 +330,13 @@ internal_nisplus_gethostent_r (struct hostent *host, char *buffer,
buflen, errnop, 0);

if (parse_res == -1)
{
{
nis_freeresult (result);
result = saved_res;
*herrnop = NETDB_INTERNAL;
*herrnop = NETDB_INTERNAL;
*errnop = ERANGE;
return NSS_STATUS_TRYAGAIN;
}
return NSS_STATUS_TRYAGAIN;
}
if (saved_res != NULL)
nis_freeresult (saved_res);

Expand Down Expand Up @@ -435,6 +435,7 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
if (result == NULL)
{
*errnop = ENOMEM;
*herrnop = NETDB_INTERNAL;
return NSS_STATUS_TRYAGAIN;
}

Expand All @@ -444,10 +445,13 @@ internal_gethostbyname2_r (const char *name, int af, struct hostent *host,
if (retval == NSS_STATUS_TRYAGAIN)
{
*errnop = errno;
*herrnop = NETDB_INTERNAL;
*herrnop = TRY_AGAIN;
}
else
__set_errno (olderr);
{
__set_errno (olderr);
*herrnop = NETDB_INTERNAL;
}
nis_freeresult (result);
return retval;
}
Expand Down Expand Up @@ -502,7 +506,7 @@ _nss_nisplus_gethostbyname_r (const char *name, struct hostent *host,
buflen, errnop, h_errnop,
AI_V4MAPPED);
if (status == NSS_STATUS_SUCCESS)
return status;
return status;
}

return internal_gethostbyname2_r (name, AF_INET, host, buffer,
Expand Down
5 changes: 5 additions & 0 deletions nss/nss_files/files-hosts.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,11 @@ _nss_files_gethostbyname4_r (const char *name, struct gaih_addrtuple **pat,
if (! keep_stream)
internal_endent ();
}
else if (status == NSS_STATUS_TRYAGAIN)
{
*errnop = errno;
*herrnop = TRY_AGAIN;
}
else
{
*errnop = errno;
Expand Down
Loading

0 comments on commit 46cbe83

Please sign in to comment.