aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1996-07-02 17:43:35 +0000
committerRoland McGrath <roland@gnu.org>1996-07-02 17:43:35 +0000
commitffee131630368bc2600747346d0b03025cbca6ee (patch)
tree4e496094645ba4e4d744868167cd0f79f118aa05
parenteb48c9632eb9b40b0855003d48e5547c542d2abe (diff)
downloadglibc-ffee131630368bc2600747346d0b03025cbca6ee.tar.xz
glibc-ffee131630368bc2600747346d0b03025cbca6ee.zip
Tue Jul 2 10:44:37 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* pwd/fgetpwent.c: Don't include ../nss/nss_files/files-parse.c to define parse_line function. (parse_line): #define to _nss_files_parse_pwent and add extern decl for that. * nss/nss_files/files-XXX.c (internal_getent): Return NSS_STATUS_TRYAGAIN for ERANGE error. * sysdeps/i386/strtok.S (LreturnNULL): Save current state ptr instead of null, so next round returns null again instead of bombing. Fix from drepper. * nss/nss_files/files-parse.c (LINE_PARSER): Take new first arg EOLSET. Remove ; after `ENTDATA_DECL (data)'. Truncate line at strpbrk (line, EOLSET "\n"). (ENTDATA_DECL): Put ; at end. (MIDLINE_COMMENTS): Macro removed. * nss/nss_files/files-ethers.c: Pass new argument. * nss/nss_files/files-hosts.c: Likewise. * nss/nss_files/files-network.c: Likewise. * nss/nss_files/files-parse.c: Likewise. * nss/nss_files/files-proto.c: Likewise. * nss/nss_files/files-rpc.c: Likewise. * nss/nss_files/files-service.c: Likewise. * grp/fgetgrent.c: Likewise. * pwd/fgetpwent.c: Likewise. * nss/nss_files/files-pwd.c: Get parse_line with extern decl, since fgetpwent.c already defines it. * nss/nss_files/files-grp.c: Likewise. * elf/dl-load.c (_dl_map_object): Use any object with matching l_name as well as any matching with l_libname. Fix DT_SONAME lookup to use string table properly. * elf/rtld.c (dl_main): Set _dl_rtld_map.l_name from _dl_argv[0] when invoked directly, and l_libname from that if PT_INTERP missing. Set l_name from l_libname only if not set from argv. * time/europe, time/northamerica: Updated from ADO 96i. * stdio-common/tst-ungetc.c: Include unistd.h.
-rw-r--r--ChangeLog44
-rw-r--r--elf/dl-load.c4
-rw-r--r--elf/rtld.c18
-rw-r--r--grp/fgetgrent.c4
-rw-r--r--nss/nss_files/files-XXX.c2
-rw-r--r--nss/nss_files/files-ethers.c3
-rw-r--r--nss/nss_files/files-grp.c10
-rw-r--r--nss/nss_files/files-hosts.c93
-rw-r--r--nss/nss_files/files-network.c13
-rw-r--r--nss/nss_files/files-parse.c17
-rw-r--r--nss/nss_files/files-proto.c3
-rw-r--r--nss/nss_files/files-pwd.c17
-rw-r--r--nss/nss_files/files-rpc.c3
-rw-r--r--nss/nss_files/files-service.c3
-rw-r--r--pwd/fgetpwent.c4
-rw-r--r--sysdeps/i386/strtok.S8
-rw-r--r--time/europe77
-rw-r--r--time/northamerica270
18 files changed, 375 insertions, 218 deletions
diff --git a/ChangeLog b/ChangeLog
index 3cd520683f..767732782f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,49 @@
+Tue Jul 2 10:44:37 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+
+ * pwd/fgetpwent.c: Don't include ../nss/nss_files/files-parse.c to
+ define parse_line function.
+ (parse_line): #define to _nss_files_parse_pwent and
+ add extern decl for that.
+
+ * nss/nss_files/files-XXX.c (internal_getent): Return
+ NSS_STATUS_TRYAGAIN for ERANGE error.
+
+ * sysdeps/i386/strtok.S (LreturnNULL): Save current state ptr instead
+ of null, so next round returns null again instead of bombing. Fix
+ from drepper.
+
+ * nss/nss_files/files-parse.c (LINE_PARSER): Take new first arg EOLSET.
+ Remove ; after `ENTDATA_DECL (data)'.
+ Truncate line at strpbrk (line, EOLSET "\n").
+ (ENTDATA_DECL): Put ; at end.
+ (MIDLINE_COMMENTS): Macro removed.
+ * nss/nss_files/files-ethers.c: Pass new argument.
+ * nss/nss_files/files-hosts.c: Likewise.
+ * nss/nss_files/files-network.c: Likewise.
+ * nss/nss_files/files-parse.c: Likewise.
+ * nss/nss_files/files-proto.c: Likewise.
+ * nss/nss_files/files-rpc.c: Likewise.
+ * nss/nss_files/files-service.c: Likewise.
+ * grp/fgetgrent.c: Likewise.
+ * pwd/fgetpwent.c: Likewise.
+ * nss/nss_files/files-pwd.c: Get parse_line with extern decl, since
+ fgetpwent.c already defines it.
+ * nss/nss_files/files-grp.c: Likewise.
+
+ * elf/dl-load.c (_dl_map_object): Use any object with matching l_name
+ as well as any matching with l_libname. Fix DT_SONAME lookup to use
+ string table properly.
+
+ * elf/rtld.c (dl_main): Set _dl_rtld_map.l_name from _dl_argv[0] when
+ invoked directly, and l_libname from that if PT_INTERP missing.
+ Set l_name from l_libname only if not set from argv.
+
+ * time/europe, time/northamerica: Updated from ADO 96i.
+
Mon Jul 1 15:44:34 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
+ * stdio-common/tst-ungetc.c: Include unistd.h.
+
* inet/Makefile (routines): Change getnetbypt to getnetbyad.
Mon Jul 1 13:32:42 1996 Miles Bader <miles@gnu.ai.mit.edu>
diff --git a/elf/dl-load.c b/elf/dl-load.c
index c19ebe722e..ff7f5cf487 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -460,11 +460,13 @@ _dl_map_object (struct link_map *loader, const char *name, int type)
/* Look for this name among those already loaded. */
for (l = _dl_loaded; l; l = l->l_next)
if (! strcmp (name, l->l_libname) || /* NAME was requested before. */
+ ! strcmp (name, l->l_name) || /* NAME was found before. */
/* If the requested name matches the soname of a loaded object,
use that object. */
(l->l_info[DT_SONAME] &&
! strcmp (name, (const char *) (l->l_addr +
- l->l_info[DT_SONAME]->d_un.d_ptr))))
+ l->l_info[DT_STRTAB]->d_un.d_ptr +
+ l->l_info[DT_SONAME]->d_un.d_val))))
{
/* The object is already loaded.
Just bump its reference count and return it. */
diff --git a/elf/rtld.c b/elf/rtld.c
index f20602d090..1cabe82660 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -117,7 +117,6 @@ dl_main (const ElfW(Phdr) *phdr,
{
const ElfW(Phdr) *ph;
struct link_map *l;
- const char *interpreter_name;
int lazy;
int list_only = 0;
@@ -154,7 +153,8 @@ file you run. This is mostly of use for maintainers to test new versions\n\
of this helper program; chances are you did not intend to run this program.\n",
NULL);
- interpreter_name = _dl_argv[0];
+ /* Note the place where the dynamic linker actually came from. */
+ _dl_rtld_map.l_name = _dl_argv[0];
if (! strcmp (_dl_argv[1], "--list"))
{
@@ -182,7 +182,6 @@ of this helper program; chances are you did not intend to run this program.\n",
l = _dl_new_object ((char *) "", "", lt_library);
l->l_phdr = phdr;
l->l_phnum = phent;
- interpreter_name = 0;
l->l_entry = *user_entry;
}
@@ -216,10 +215,14 @@ of this helper program; chances are you did not intend to run this program.\n",
dlopen call or DT_NEEDED entry, for something that wants to link
against the dynamic linker as a shared library, will know that
the shared object is already loaded. */
- interpreter_name = (void *) l->l_addr + ph->p_vaddr;
+ _dl_rtld_map.l_libname = (const char *) l->l_addr + ph->p_vaddr;
break;
}
- assert (interpreter_name); /* How else did we get here? */
+ if (! _dl_rtld_map.l_libname && _dl_rtld_map.l_name)
+ /* We were invoked directly, so the program might not have a PT_INTERP. */
+ _dl_rtld_map.l_libname = _dl_rtld_map.l_name;
+ else
+ assert (_dl_rtld_map.l_libname); /* How else did we get here? */
/* Extract the contents of the dynamic section for easy access. */
elf_get_dynamic_info (l->l_ld, l->l_info);
@@ -229,7 +232,10 @@ of this helper program; chances are you did not intend to run this program.\n",
/* Put the link_map for ourselves on the chain so it can be found by
name. */
- _dl_rtld_map.l_name = (char *) _dl_rtld_map.l_libname = interpreter_name;
+ if (! _dl_rtld_map.l_name)
+ /* If not invoked directly, the dynamic linker shared object file was
+ found by the PT_INTERP name. */
+ _dl_rtld_map.l_name = (char *) _dl_rtld_map.l_libname;
_dl_rtld_map.l_type = lt_library;
while (l->l_next)
l = l->l_next;
diff --git a/grp/fgetgrent.c b/grp/fgetgrent.c
index aced929621..38ccd15e6f 100644
--- a/grp/fgetgrent.c
+++ b/grp/fgetgrent.c
@@ -30,11 +30,11 @@ struct grent_data {};
#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',')
#include "../nss/nss_files/files-parse.c"
LINE_PARSER
-(
+(,
STRING_FIELD (result->gr_name, ISCOLON, 0);
STRING_FIELD (result->gr_passwd, ISCOLON, 0);
INT_FIELD (result->gr_gid, ISCOLON, 0, 10,);
-)
+ )
/* Read one entry from the given stream. */
diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
index 7291c75d84..b9c3579d5b 100644
--- a/nss/nss_files/files-XXX.c
+++ b/nss/nss_files/files-XXX.c
@@ -144,7 +144,7 @@ internal_getent (struct STRUCTURE *result,
if (buflen < (int) sizeof *data + 1)
{
errno = ERANGE;
- return NSS_STATUS_NOTFOUND;
+ return NSS_STATUS_TRYAGAIN;
}
do
diff --git a/nss/nss_files/files-ethers.c b/nss/nss_files/files-ethers.c
index e7579a48bc..b66a3c3d04 100644
--- a/nss/nss_files/files-ethers.c
+++ b/nss/nss_files/files-ethers.c
@@ -33,8 +33,7 @@ struct etherent_data {};
#define DATAFILE "/etc/ethers"
#include "files-parse.c"
LINE_PARSER
-(
- MIDLINE_COMMENTS;
+("#",
/* Read the ethernet address: 6 x 8bit hexadecimal number. */
{
size_t cnt;
diff --git a/nss/nss_files/files-grp.c b/nss/nss_files/files-grp.c
index 6d528a6df2..580dfbe3eb 100644
--- a/nss/nss_files/files-grp.c
+++ b/nss/nss_files/files-grp.c
@@ -27,12 +27,10 @@ struct grent_data {};
#define TRAILING_LIST_MEMBER gr_mem
#define TRAILING_LIST_SEPARATOR_P(c) ((c) == ',')
#include "files-parse.c"
-LINE_PARSER
-(
- STRING_FIELD (result->gr_name, ISCOLON, 0);
- STRING_FIELD (result->gr_passwd, ISCOLON, 0);
- INT_FIELD (result->gr_gid, ISCOLON, 0, 10,);
-)
+/* Our parser function is already defined in fgetgrent.c, so use that.
+ to parse lines from the database file. */
+extern int parse_line (char *line, struct STRUCTURE *result,
+ void *buffer, int buflen);
#include "files-XXX.c"
diff --git a/nss/nss_files/files-hosts.c b/nss/nss_files/files-hosts.c
index 15f00f31ce..19a0075ecf 100644
--- a/nss/nss_files/files-hosts.c
+++ b/nss/nss_files/files-hosts.c
@@ -43,52 +43,53 @@ struct hostent_data
#define TRAILING_LIST_SEPARATOR_P isspace
#include "files-parse.c"
LINE_PARSER
-({
- char *addr;
-
- STRING_FIELD (addr, isspace, 1);
-
- /* Parse address. */
- if ((_res.options & RES_USE_INET6)
- && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
- {
- result->h_addrtype = AF_INET6;
- result->h_length = IN6ADDRSZ;
- }
- else if (inet_pton (AF_INET, addr, entdata->host_addr) > 0)
- {
- if (_res.options & RES_USE_INET6)
- {
- 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;
- }
- }
- else
- /* Illegal address: ignore line. */
- return 0;
-
- /* Store a pointer to the address in the expected form. */
- entdata->h_addr_ptrs[0] = entdata->host_addr;
- entdata->h_addr_ptrs[1] = NULL;
- result->h_addr_list = entdata->h_addr_ptrs;
-
- /* If we need the host entry in IPv6 form change it now. */
- if (_res.options & RES_USE_INET6)
- {
- char *bufptr = data->linebuffer;
- int buflen = (char *) data + datalen - bufptr;
- map_v4v6_hostent (result, &bufptr, &buflen);
- }
-
- STRING_FIELD (result->h_name, isspace, 1);
-})
+("#",
+ {
+ char *addr;
+
+ STRING_FIELD (addr, isspace, 1);
+
+ /* Parse address. */
+ if ((_res.options & RES_USE_INET6)
+ && inet_pton (AF_INET6, addr, entdata->host_addr) > 0)
+ {
+ result->h_addrtype = AF_INET6;
+ result->h_length = IN6ADDRSZ;
+ }
+ else if (inet_pton (AF_INET, addr, entdata->host_addr) > 0)
+ {
+ if (_res.options & RES_USE_INET6)
+ {
+ 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;
+ }
+ }
+ else
+ /* Illegal address: ignore line. */
+ return 0;
+
+ /* Store a pointer to the address in the expected form. */
+ entdata->h_addr_ptrs[0] = entdata->host_addr;
+ entdata->h_addr_ptrs[1] = NULL;
+ result->h_addr_list = entdata->h_addr_ptrs;
+
+ /* If we need the host entry in IPv6 form change it now. */
+ if (_res.options & RES_USE_INET6)
+ {
+ char *bufptr = data->linebuffer;
+ int buflen = (char *) data + datalen - bufptr;
+ map_v4v6_hostent (result, &bufptr, &buflen);
+ }
+
+ STRING_FIELD (result->h_name, isspace, 1);
+ })
#include "files-XXX.c"
diff --git a/nss/nss_files/files-network.c b/nss/nss_files/files-network.c
index 504c420b04..c6cd718dd2 100644
--- a/nss/nss_files/files-network.c
+++ b/nss/nss_files/files-network.c
@@ -30,15 +30,16 @@ struct netent_data {};
#define TRAILING_LIST_SEPARATOR_P isspace
#include "files-parse.c"
LINE_PARSER
-({
- char *addr;
+("#",
+ {
+ char *addr;
- STRING_FIELD (result->n_name, isspace, 1);
+ STRING_FIELD (result->n_name, isspace, 1);
- STRING_FIELD (addr, isspace, 1);
- result->n_net = inet_network (addr);
+ STRING_FIELD (addr, isspace, 1);
+ result->n_net = inet_network (addr);
-})
+ })
#include "files-XXX.c"
diff --git a/nss/nss_files/files-parse.c b/nss/nss_files/files-parse.c
index be35ae1a8a..a9c461ef46 100644
--- a/nss/nss_files/files-parse.c
+++ b/nss/nss_files/files-parse.c
@@ -35,7 +35,7 @@ struct parser_data
{
#ifdef ENTDATA
struct ENTDATA entdata;
-#define ENTDATA_DECL(data) struct ENTDATA *const entdata = &data->entdata
+#define ENTDATA_DECL(data) struct ENTDATA *const entdata = &data->entdata;
#else
#define ENTDATA_DECL(data)
#endif
@@ -52,26 +52,21 @@ struct parser_data
#define parse_line CONCAT(_nss_files_parse_,ENTNAME)
#endif
-#define LINE_PARSER(BODY) \
+#define LINE_PARSER(EOLSET, BODY) \
parser_stclass int \
parse_line (char *line, struct STRUCTURE *result, \
struct parser_data *data, int datalen) \
{ \
- ENTDATA_DECL (data); \
+ ENTDATA_DECL (data) \
+ char *p = strpbrk (line, EOLSET "\n"); \
+ if (p) \
+ *p = '\0'; \
BODY; \
TRAILING_LIST_PARSER; \
return 1; \
}
-/* Comments can come mid-line; trim the line at the first # seen. */
-#define MIDLINE_COMMENTS \
- { \
- char *p = strchr (line, '#'); \
- if (p) \
- *p = '\0'; \
- }
-
#define STRING_FIELD(variable, terminator_p, swallow) \
{ \
variable = line; \
diff --git a/nss/nss_files/files-proto.c b/nss/nss_files/files-proto.c
index d67f8db8f6..ef5a7c2560 100644
--- a/nss/nss_files/files-proto.c
+++ b/nss/nss_files/files-proto.c
@@ -29,8 +29,7 @@ struct protoent_data {};
#define TRAILING_LIST_SEPARATOR_P isspace
#include "files-parse.c"
LINE_PARSER
-(
- MIDLINE_COMMENTS;
+("#",
STRING_FIELD (result->p_name, isspace, 1);
INT_FIELD (result->p_proto, isspace, 1, 10,);
)
diff --git a/nss/nss_files/files-pwd.c b/nss/nss_files/files-pwd.c
index 4b6a4b737f..6b39116a44 100644
--- a/nss/nss_files/files-pwd.c
+++ b/nss/nss_files/files-pwd.c
@@ -25,19 +25,10 @@ Cambridge, MA 02139, USA. */
struct pwent_data {};
#include "files-parse.c"
-LINE_PARSER
-({
- STRING_FIELD (result->pw_name, ISCOLON, 0);
- STRING_FIELD (result->pw_passwd, ISCOLON, 0);
- INT_FIELD (result->pw_uid, ISCOLON, 0, 10,);
- INT_FIELD (result->pw_gid, ISCOLON, 0, 10,);
- STRING_FIELD (result->pw_gecos, ISCOLON, 0);
- STRING_FIELD (result->pw_dir, ISCOLON, 0);
- result->pw_shell = line;
- line = strchr (line, '\n');
- if (line)
- *line = '\0';
-})
+/* Our parser function is already defined in fgetpwent.c, so use that.
+ to parse lines from the database file. */
+extern int parse_line (char *line, struct STRUCTURE *result,
+ void *buffer, int buflen);
#include "files-XXX.c"
diff --git a/nss/nss_files/files-rpc.c b/nss/nss_files/files-rpc.c
index fef0ff88b1..f8bef451fa 100644
--- a/nss/nss_files/files-rpc.c
+++ b/nss/nss_files/files-rpc.c
@@ -29,8 +29,7 @@ struct rpcent_data {};
#define TRAILING_LIST_SEPARATOR_P isspace
#include "files-parse.c"
LINE_PARSER
-(
- MIDLINE_COMMENTS;
+("#",
STRING_FIELD (result->r_name, isspace, 1);
INT_FIELD (result->r_number, isspace, 1, 10,);
)
diff --git a/nss/nss_files/files-service.c b/nss/nss_files/files-service.c
index 3bcb48787a..f0dba50fe6 100644
--- a/nss/nss_files/files-service.c
+++ b/nss/nss_files/files-service.c
@@ -31,8 +31,7 @@ struct servent_data {};
#include "files-parse.c"
#define ISSLASH(c) ((c) == '/')
LINE_PARSER
-(
- MIDLINE_COMMENTS;
+("#",
STRING_FIELD (result->s_name, isspace, 1);
INT_FIELD (result->s_port, ISSLASH, 10, 0, htons);
STRING_FIELD (result->s_proto, isspace, 1);
diff --git a/pwd/fgetpwent.c b/pwd/fgetpwent.c
index c29e96ec68..f8548fe29b 100644
--- a/pwd/fgetpwent.c
+++ b/pwd/fgetpwent.c
@@ -28,7 +28,7 @@ struct pwent_data {};
#include "../nss/nss_files/files-parse.c"
LINE_PARSER
-(
+(,
STRING_FIELD (result->pw_name, ISCOLON, 0);
STRING_FIELD (result->pw_passwd, ISCOLON, 0);
INT_FIELD (result->pw_uid, ISCOLON, 0, 10,);
@@ -36,7 +36,7 @@ LINE_PARSER
STRING_FIELD (result->pw_gecos, ISCOLON, 0);
STRING_FIELD (result->pw_dir, ISCOLON, 0);
result->pw_shell = line;
-)
+ )
/* Read one entry from the given stream. */
diff --git a/sysdeps/i386/strtok.S b/sysdeps/i386/strtok.S
index 2ef8803ef6..c38ebf90a2 100644
--- a/sysdeps/i386/strtok.S
+++ b/sysdeps/i386/strtok.S
@@ -269,15 +269,15 @@ L11:
LreturnNULL:
xorl %eax, %eax
- /* Store NULL as pointer to the next character. */
+ /* Store current pointer for next round. */
#ifdef USE_AS_STRTOK_R
movl 12(%esp), %ecx
- movl %eax, (%ecx)
+ movl %edx, (%ecx)
#else
# ifndef PIC
- movl %eax, save_ptr
+ movl %edx, save_ptr
# else
- movl %eax, save_ptr@GOTOFF(%ebx)
+ movl %edx, save_ptr@GOTOFF(%ebx)
popl %ebx
# endif
#endif
diff --git a/time/europe b/time/europe
index b96f23556d..ce66e8ab58 100644
--- a/time/europe
+++ b/time/europe
@@ -1,4 +1,4 @@
-# @(#)europe 7.37
+# @(#)europe 7.38
# This data is by no means authoritative; if you think you know better,
# go ahead and edit the file (and please send any changes to
@@ -125,6 +125,15 @@
# transition date for London, namely 1847 Sep 22. We don't know as much
# about Dublin, so we use 1880 Aug 2, the legal transition time.
+# From Paul Eggert (1996-06-12):
+# Summer Time was first seriously proposed by William Willett (1857-1915),
+# a London builder who circulated a pamphlet ``Waste of Daylight'' (1907)
+# that proposed advancing clocks 20 minutes on each of four Sundays in April,
+# and retarding them by the same amount on four Sundays in September.
+# A bill was drafted in 1909 and introduced in Parliament several times,
+# but it met with ridicule and opposition, especially from farming interests.
+# One-hour Summer Time was eventually adopted as a wartime measure in 1916.
+
# From Arthur David Olson (January 19, 1989):
#
# A source at the British Information Office in New York avers that it's
@@ -418,6 +427,22 @@
# who provided the wartime regulations and a snippet of Hansard explaining
# why double summer