]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
update from main archive 970122 cvs/libc-970124
authorUlrich Drepper <drepper@redhat.com>
Fri, 24 Jan 1997 02:23:54 +0000 (02:23 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 24 Jan 1997 02:23:54 +0000 (02:23 +0000)
1997-01-23  Paul Eggert  <eggert@twinsun.com>

* mktime.c (mktime): Invoke __tzset, not __tzset_internal, to set tz,
so that tzname is set as POSIX requires.

Fri Jan 24 02:49:18 1997  Ulrich Drepper  <drepper@cygnus.com>

* dirent/dirent.h: Declare readdir_r also when __USE_POSIX.
* grp/grp.h: Declare *_r functions also when __USE_POSIX.
* pwd/pwd.h: Likewise.
* time/time.h: Likewise.
* posix/unistd.h: Declare ttyname_r also when __USE_POSIX.
* string/string.h: Declare strtok_r also when __USE_POSIX.

* stdio-common/bug7.c: Use tmpnam to generate names for test files.

* stdio-common/tmpnam.c: Update copyright.
* stdio-common/tmpnam_r.c: Likewise.

* sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h: Protect
against multiple inclusion.  Include <termbits.h>.
* sysdeps/unix/sysv/linux/sys/kernel_termios.h: Likewise.

* sysdeps/unix/sysv/linux/net/if.h: Update according to recent
kernel headers.  Patch by Philip Blundell <pjb27@cam.ac.uk>.

Thu Jan 23 17:42:00 1997  Ulrich Drepper  <drepper@cygnus.com>

* sysdeps/unix/sysv/linux/sparc/clone.S: Correct author attribution.

* sysdeps/unix/sysv/linux/net/if_arp (MAX_ADDR_LEN): Add definition.

Thu Jan 23 14:20:34 1997  Ulrich Drepper  <drepper@cygnus.com>

* time/tzfile.c (__tzfile_read): Don't allow arbitrary files to be
read when running a setuid program.

21 files changed:
ChangeLog
Makerules
PROJECTS
dirent/dirent.h
grp/grp.h
intl/Makefile
posix/unistd.h
pwd/pwd.h
stdio-common/bug7.c
stdio-common/tmpnam.c
stdio-common/tmpnam_r.c
string/string.h
sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h
sysdeps/unix/sysv/linux/net/if.h
sysdeps/unix/sysv/linux/net/if_arp.h
sysdeps/unix/sysv/linux/sparc/clone.S
sysdeps/unix/sysv/linux/sys/kernel_termios.h
time/Makefile
time/mktime.c
time/time.h
time/tzfile.c

index 338352f251967053e720c57775ec28a130fa1f34..c19819349b5127d429334598c6b2049a3ac25f01 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,40 @@
+1997-01-23  Paul Eggert  <eggert@twinsun.com>
+
+       * mktime.c (mktime): Invoke __tzset, not __tzset_internal, to set tz,
+       so that tzname is set as POSIX requires.
+
+Fri Jan 24 02:49:18 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+       * dirent/dirent.h: Declare readdir_r also when __USE_POSIX.
+       * grp/grp.h: Declare *_r functions also when __USE_POSIX.
+       * pwd/pwd.h: Likewise.
+       * time/time.h: Likewise.
+       * posix/unistd.h: Declare ttyname_r also when __USE_POSIX.
+       * string/string.h: Declare strtok_r also when __USE_POSIX.
+
+       * stdio-common/bug7.c: Use tmpnam to generate names for test files.
+
+       * stdio-common/tmpnam.c: Update copyright.
+       * stdio-common/tmpnam_r.c: Likewise.
+
+       * sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h: Protect
+       against multiple inclusion.  Include <termbits.h>.
+       * sysdeps/unix/sysv/linux/sys/kernel_termios.h: Likewise.
+
+       * sysdeps/unix/sysv/linux/net/if.h: Update according to recent
+       kernel headers.  Patch by Philip Blundell <pjb27@cam.ac.uk>.
+
+Thu Jan 23 17:42:00 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+       * sysdeps/unix/sysv/linux/sparc/clone.S: Correct author attribution.
+
+       * sysdeps/unix/sysv/linux/net/if_arp (MAX_ADDR_LEN): Add definition.
+
+Thu Jan 23 14:20:34 1997  Ulrich Drepper  <drepper@cygnus.com>
+
+       * time/tzfile.c (__tzfile_read): Don't allow arbitrary files to be
+       read when running a setuid program.
+
 Thu Jan 23 04:06:42 1997  Ulrich Drepper  <drepper@cygnus.com>
 
        * Make-dist (.PHONY: dist): Remove duplicate declaration.
@@ -85,7 +122,6 @@ Wed Jan 22 13:19:56 1997  Richard Henderson  <rth@tamu.edu>
 Wed Jan 22 23:05:14 1997  Ulrich Drepper  <drepper@cygnus.com>
 
        * sysdeps/mach/hurd/vdprintf.c: Complete de-ANSI-declfication.
-       * sysdeps/posix/pipestream.c (writedecl): Fix typo.
        Reported by Marcus G. Daniels <marcus@shannon.sysc.pdx.edu>.
 
 Wed Jan 22 13:58:56 1997  Andreas Jaeger  <aj@arthur.pfalz.de>
index 95e1cbcb0fc1855dd56d648f2fedfb63bcbb2a77..a8509bccfc4efcfad8c10ea7ed3eba13162eb571 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -749,8 +749,8 @@ ifdef install-lib
 install-lib.a := $(filter lib%.a,$(install-lib))
 install-lib-non.a := $(filter-out lib%.a,$(install-lib))
 ifdef install-lib-non.a
-$(addprefix $(libdir)/$(libprefix),$(install-lib-non.a)): \
-  $(libdir)/$(libprefix)%: $(objpfx)%
+$(addprefix $(inst_libdir)/$(libprefix),$(install-lib-non.a)): \
+  $(inst_libdir)/$(libprefix)%: $(objpfx)%
        $(do-install)
 endif
 ifdef install-lib.a
index b7272eee9056a2dff1c7d83f468694e6a3c4ffb4..ea1c2081615234f15a221d9e2ee303f00fe1d0ef 100644 (file)
--- a/PROJECTS
+++ b/PROJECTS
@@ -1,6 +1,6 @@
 Open jobs for finishing GNU libc:
 ---------------------------------
-Status: October 1996
+Status: January 1997
 
 If you have time and talent to take over any of the jobs below please
 contact <bug-glibc@prep.ai.mit.edu>
@@ -10,6 +10,8 @@ contact <bug-glibc@prep.ai.mit.edu>
 [ 1] Port to new platforms or test current version on formerly supported
      platforms.
 
+**** See http://www.gnu.org/software/libc/porting.html for more details.
+
 
 [ 2] Test compliance with standards.  If you have access to recent
      standards (IEEE, ISO, ANSI, X/Open, ...) and/or test suites you
@@ -31,6 +33,8 @@ contact <bug-glibc@prep.ai.mit.edu>
 
      Implementation idea: use some functions from bash.
 
+**** Somebody is working on this.  Help may or may not be appreciated.
+
 
 [ 5] Write `long double' versions of the math functions.  This should be
      done in collaboration with the NetBSD and FreeBSD people.
@@ -83,5 +87,15 @@ contact <bug-glibc@prep.ai.mit.edu>
 [11] Rewrite utmp/wtmp functions to use database functions.  This is much
      better than the normal flat file format.
 
-     Please contact bug-glibc@prep.ai.mit.edu before starting to avoid
-     duplicated work.
+**** There are plans for a new approach to this problem.  Please contact
+     bug-glibc@prep.ai.mit.edu before starting to work.)
+
+
+[12] Several more or less small functions have to be written:
+
+     + tcgetid() and waitid()                  from XPG4.2
+     + grantpt(), ptsname(), unlockpt()                from XPG4.2
+     + getdate()                               from XPG4.2
+     + fmtmsg()                                        from SVID
+
+     More information are available on request.
index ac85b5f1c6131becefffe02c71e0238a1ca6988c..b5568b3c5a9035d7e2b723f141704aa5bfafacd3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -116,14 +116,14 @@ extern int closedir __P ((DIR *__dirp));
 extern struct dirent *__readdir __P ((DIR *__dirp));
 extern struct dirent *readdir __P ((DIR *__dirp));
 
-#ifdef __USE_REENTRANT
+#if defined __USE_POSIX || defined __USE_REENTRANT
 /* Reentrant version of `readdir'.  Return in RESULT a pointer to the
    next entry.  */
 extern int __readdir_r __P ((DIR *__dirp, struct dirent *entry,
                             struct dirent **result));
 extern int readdir_r __P ((DIR *__dirp, struct dirent *entry,
                           struct dirent **result));
-#endif
+#endif /* POSIX or reentrant */
 
 /* Rewind DIRP to the beginning of the directory.  */
 extern void rewinddir __P ((DIR *__dirp));
index 164bdd78a9ed63720a769f169b5dd82f5592af40..93ed68848b8cdf4f40963634334ae0c31d4d9200 100644 (file)
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997 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
@@ -91,7 +91,7 @@ extern struct group *getgrgid __P ((__gid_t __gid));
 /* Search for an entry with a matching group name.  */
 extern struct group *getgrnam __P ((__const char *__name));
 
-#ifdef __USE_REENTRANT
+#if defined __USE_POSIX || defined __USE_REENTRENT
 /* Reasonable value for the buffer sized used in the reentrant
    functions below.  But better use `sysconf'.  */
 #define        NSS_BUFLEN_GROUP        1024
@@ -132,7 +132,7 @@ extern int fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
                             struct group **__result));
 #endif
 
-#endif /* reentrant */
+#endif /* POSIX or reentrant */
 
 
 #ifdef __USE_BSD
index db4db7c16c8bc0e3a34eb5c42d0a1d3aae1c06ea..8f411fba9613e098873baf60b305ffd53cb0a1bd 100644 (file)
@@ -32,7 +32,7 @@ include ../Rules
 CPPFLAGS += -D'GNULOCALEDIR="$(localedir)"' \
            -D'LOCALE_ALIAS_PATH="$(localedir):$(i18ndir)"'
 
-$(localedir)/locale.alias: locale.alias
+$(inst_localedir)/locale.alias: locale.alias
        $(do-install)
 
 ifdef gettext-srcdir
index cfa53c7c8d2fbc7265d757dcfd71d5757dd94428..5c8d1b7f0430996e04324919d7888e71645c4aa7 100644 (file)
@@ -552,12 +552,11 @@ extern __pid_t vfork __P ((void));
 /* Return the pathname of the terminal FD is open on, or NULL on errors.
    The returned storage is good only until the next call to this function.  */
 extern char *ttyname __P ((int __fd));
-#ifdef __USE_REENTRANT
+
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, -1 otherwise.  */
 extern int __ttyname_r __P ((int __fd, char *__buf, size_t __buflen));
 extern int ttyname_r __P ((int __fd, char *__buf, size_t __buflen));
-#endif
 
 /* Return 1 if FD is a valid descriptor associated
    with a terminal, zero if not.  */
index 89cd03f95a2243eff06e9a8a6380324a9a70e9ee..68792d8a4be8f86c1b4c8aa1b3428a592108e4b8 100644 (file)
--- a/pwd/pwd.h
+++ b/pwd/pwd.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 1992, 1995, 1996, 1997 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
@@ -94,7 +94,7 @@ extern struct passwd *getpwuid __P ((__uid_t __uid));
 /* Search for an entry with a matching username.  */
 extern struct passwd *getpwnam __P ((__const char *__name));
 
-#ifdef __USE_REENTRANT
+#if defined __USE_POSIX || defined __USE_REENTRANT
 /* Reasonable value for the buffer sized used in the reentrant
    functions below.  But better use `sysconf'.  */
 #define        NSS_BUFLEN_PASSWD       1024
@@ -140,7 +140,7 @@ extern int fgetpwent_r __P ((FILE * __stream, struct passwd *__resultbuf,
                             struct passwd **__result));
 #endif
 
-#endif /* reentrant */
+#endif /* POSIX or reentrant */
 
 
 __END_DECLS
index 7b320aebd2481fcfed71224513a13ab641207f70..2b1efe3bc616384f32fb276c16739ab0d464cfde 100644 (file)
@@ -6,50 +6,62 @@ int
 main (int argc, char *argv[])
 {
   int lose = 0;
-  char filename[] = "/tmp/foo";
+  char filename[L_tmpnam];
   FILE *fp;
 
-  fp = fopen (filename, "w+");
-  fprintf (fp, "Hello world!\n");
-  fflush (fp);
-  fseek (fp, 5L, SEEK_SET);
-  if (fseek (fp, -1L, SEEK_CUR) < 0)
+  if (tmpnam (filename) == NULL)
     {
-      printf ("seek failed\n");
+      printf ("tmpnam failed\n");
       lose = 1;
     }
-  fclose (fp);
-  remove (filename);
+  else
+    {
+      fp = fopen (filename, "w+");
+      fprintf (fp, "Hello world!\n");
+      fflush (fp);
+      fseek (fp, 5L, SEEK_SET);
+      if (fseek (fp, -1L, SEEK_CUR) < 0)
+       {
+         printf ("seek failed\n");
+         lose = 1;
+       }
+      fclose (fp);
+      remove (filename);
+    }
 
   {
     FILE *file1;
     FILE *file2;
-    char filename1[] = "/tmp/foo";
-    char filename2[] = "/tmp/bar";
+    char filename1[L_tmpnam];
+    char filename2[L_tmpnam];
     int ch;
 
-    file1 = fopen (filename1, "w");
-    fclose (file1);
-
-    file2 = fopen (filename2, "w");
-    fputc ('x', file2);
-    fclose (file2);
-
-    file1 = fopen (filename1, "r");
-    file2 = freopen (filename2, "r", file1);
-    if ((ch = fgetc (file2)) != 'x')
+    if (tmpnam (filename1) == NULL || tmpnam (filename2) == NULL)
       {
-       printf ("wrong character in reopened file, value = %d\n", ch);
+       printf ("tmpnam failed\n");
        lose = 1;
       }
-#if 0
-    /* Hey, how did this ever worked?  `file1' is already closed!!!
-       -- drepper@gnu  */
-    fclose (file1);
-#endif
-    fclose (file2);
-    remove (filename1);
-    remove (filename2);
+    else
+      {
+
+       file1 = fopen (filename1, "w");
+       fclose (file1);
+
+       file2 = fopen (filename2, "w");
+       fputc ('x', file2);
+       fclose (file2);
+
+       file1 = fopen (filename1, "r");
+       file2 = freopen (filename2, "r", file1);
+       if ((ch = fgetc (file2)) != 'x')
+         {
+           printf ("wrong character in reopened file, value = %d\n", ch);
+           lose = 1;
+         }
+       fclose (file2);
+       remove (filename1);
+       remove (filename2);
+      }
   }
 
   puts (lose ? "Test FAILED!" : "Test succeeded.");
index 0f2199ea60b701bd4c53011e25a709f896992614..6e6dd510eaea8e7ffee1ea1c9752c5940c864bb0 100644 (file)
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1993, 1996 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+/* Copyright (C) 1991, 1993, 1996, 1997 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
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <string.h>
index 2794e7728e1036bad7b69d3d688b3d909bb356b6..a509a071d658b25adb7e322ed56cd02d8da338a0 100644 (file)
@@ -1,20 +1,20 @@
-/* Copyright (C) 1991, 1993, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1991, 1993, 1996, 1997 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
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
 
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Library General Public License for more details.
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
 
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB.  If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
 
 #include <stdio.h>
 #include <string.h>
index 4560f612b58e7b3dbf09d6cc88fd791c163729ff..99fb2d83aa565120e6128250c0212e21f8858a0c 100644 (file)
@@ -138,12 +138,14 @@ extern char *strstr __P ((__const char *__haystack, __const char *__needle));
 /* Divide S into tokens separated by characters in DELIM.  */
 extern char *strtok __P ((char *__s, __const char *__delim));
 
-#ifdef __USE_GNU
+#if defined __USE_POSIX || defined __USE_REENTRANT
 /* Divide S into tokens separated by characters in DELIM.  Information
    passed between calls are stored in SAVE_PTR.  */
 extern char *strtok_r __P ((char *__s, __const char *__delim,
                            char **__save_ptr));
+#endif
 
+#ifdef __USE_GNU
 /* Find the first occurrence of NEEDLE in HAYSTACK.
    NEEDLE is NEEDLELEN bytes long;
    HAYSTACK is HAYSTACKLEN bytes long.  */
index eebe976ce14e3f4fbf7205c39d462b191a932121..4be759a51fb1de737610bac8d3e23aad565f51c6 100644 (file)
@@ -1,5 +1,10 @@
+#ifndef _SYS_KERNEL_TERMIOS_H
+#define _SYS_KERNEL_TERMIOS_H 1
 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
 
+/* We need the definition of tcflag_t, cc_t, and speed_t.  */
+#include <termbits.h>
+
 #define __KERNEL_NCCS 19
 
 struct __kernel_termios
@@ -16,3 +21,5 @@ struct __kernel_termios
 
 #define _HAVE_C_ISPEED 1
 #define _HAVE_C_OSPEED 1
+
+#endif /* sys/kernel_termios.h */
index bf261175ec315eec6b1f0dcadb43ed6025be7f21..db86d20f23fff7331e309d8b7894950e0e46315c 100644 (file)
@@ -105,7 +105,7 @@ struct ifreq
        struct sockaddr ifru_netmask;
        struct sockaddr ifru_hwaddr;
        short int ifru_flags;
-       int ifru_metric;
+       int ifru_ivalue;
        int ifru_mtu;
        struct ifmap ifru_map;
        char ifru_slave[IFNAMSIZ];      /* Just fits the size */
@@ -120,11 +120,12 @@ struct ifreq
 #define        ifr_broadaddr   ifr_ifru.ifru_broadaddr /* broadcast address    */
 #define        ifr_netmask     ifr_ifru.ifru_netmask   /* interface net mask   */
 #define        ifr_flags       ifr_ifru.ifru_flags     /* flags                */
-#define        ifr_metric      ifr_ifru.ifru_metric    /* metric               */
+#define        ifr_metric      ifr_ifru.ifru_ivalue    /* metric               */
 #define        ifr_mtu         ifr_ifru.ifru_mtu       /* mtu                  */
 #define ifr_map                ifr_ifru.ifru_map       /* device map           */
 #define ifr_slave      ifr_ifru.ifru_slave     /* slave device         */
 #define        ifr_data        ifr_ifru.ifru_data      /* for use by interface */
+#define ifr_ifindex    ifr_ifru.ifru_ivalue    /* interface index      */
 
 
 /* Structure used in SIOCGIFCONF request.  Used to retrieve interface
index ae0e799fb6b138f338af667c0a34b1da1a5984bb..cf48f10f79dd6d6e6204b8354fa8dc947153923b 100644 (file)
 
 __BEGIN_DECLS
 
+/* Some internals from deep down in the kernel.  */
+#define MAX_ADDR_LEN   7
+
+
 /* This structure defines an ethernet arp header.  */
 
 /* ARP protocol opcodes. */
index 9e1ba812b0335fae6a76d4260d70fd8ba5c3f91a..64735e9dbcbf542437376100c3bc3d1e806077a5 100644 (file)
@@ -1,6 +1,5 @@
 /* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-   Contributed by Miguel de Icaza (miguel@nuclecu.unam.mx)
-   Based on code written for the Intel by Richard Henderson (rth@tamu.edu).
+   Contributed by Richard Henderson (rth@tamu.edu).
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public License as
index 95349760f04aeb4ea23c533a3a04f2e318b30ce1..629508e765b57bff2d9259479e5bc2481a7683e8 100644 (file)
@@ -1,5 +1,10 @@
+#ifndef _SYS_KERNEL_TERMIOS_H
+#define _SYS_KERNEL_TERMIOS_H 1
 /* The following corresponds to the values from the Linux 2.1.20 kernel.  */
 
+/* We need the definition of tcflag_t, cc_t, and speed_t.  */
+#include <termbits.h>
+
 #define __KERNEL_NCCS 19
 
 struct __kernel_termios
@@ -11,3 +16,5 @@ struct __kernel_termios
     cc_t c_line;               /* line discipline */
     cc_t c_cc[__KERNEL_NCCS];  /* control characters */
   };
+
+#endif /* sys/kernel_termios.h */
index 7f8513cc6a807ca18119d015000d4c61d17e6000..b994eee1ace2a621ec4ed1768cc361051366ba6d 100644 (file)
@@ -91,22 +91,22 @@ $(tzfiles:%=$(objpfx)z.%): $(objpfx)z.%: % Makefile
 # Kludge alert: we use an implicit rule (in what we are generating here)
 # because that is the only way to tell Make that the one command builds all
 # the files.
-       (echo 'define $*-zones'                                         ;\
-        awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^;\
-        echo 'endef'                                                   ;\
-        echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))'             ;\
-        echo 'ifdef $*-zones'                                          ;\
-        echo '$$(addprefix $$(datadir)/zone%/right/,$$($*-zones)): \'  ;\
-        echo '$< $$(objpfx)zic leapseconds yearistype'                 ;\
-        echo ' $$(tzcompile)'                                          ;\
-        echo '$$(addprefix $$(datadir)/zone%/posix/,$$($*-zones)): \'  ;\
-        echo '$< $$(objpfx)zic /dev/null yearistype'                   ;\
-        echo ' $$(tzcompile)'                                          ;\
-        echo '$$(addprefix $$(datadir)/zone%/,$$($*-zones)): \'        ;\
-        echo '$< $$(objpfx)zic $$(leapseconds) yearistype'             ;\
-        echo ' $$(tzcompile)'                                          ;\
-        echo 'endif'                                                   ;\
-        echo 'zonenames := $$(zonenames) $$($*-zones)'                 ;\
+       (echo 'define $*-zones'                                             ;\
+        awk '$$1 == "Zone" { print $$2 } $$1 == "Link" { print $$3 }' $^   ;\
+        echo 'endef'                                                       ;\
+        echo '$*-zones := $$(subst $$(nl), ,$$($*-zones))'                 ;\
+        echo 'ifdef $*-zones'                                              ;\
+        echo '$$(addprefix $$(inst_datadir)/zone%/right/,$$($*-zones)): \' ;\
+        echo '$< $$(objpfx)zic leapseconds yearistype'                     ;\
+        echo ' $$(tzcompile)'                                              ;\
+        echo '$$(addprefix $$(inst_datadir)/zone%/posix/,$$($*-zones)): \' ;\
+        echo '$< $$(objpfx)zic /dev/null yearistype'                       ;\
+        echo ' $$(tzcompile)'                                              ;\
+        echo '$$(addprefix $$(inst_datadir)/zone%/,$$($*-zones)): \'       ;\
+        echo '$< $$(objpfx)zic $$(leapseconds) yearistype'                 ;\
+        echo ' $$(tzcompile)'                                              ;\
+        echo 'endif'                                                       ;\
+        echo 'zonenames := $$(zonenames) $$($*-zones)'                     ;\
        ) > $@.new
        mv $@.new $@
 
index 223872f22880a1f3a248e3814abf726a23d7b350..fd242b15450036801ac467be1a9a39a2af9d0702 100644 (file)
@@ -85,9 +85,6 @@
   ((year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0))
 #endif
 
-/* Prototype for the internal function to get information based on TZ.  */
-extern void __tzset_internal __P ((int always));
-
 /* How many days come before each month (0-12).  */
 const unsigned short int __mon_yday[2][13] =
   {
@@ -164,8 +161,10 @@ mktime (tp)
      struct tm *tp;
 {
 #ifdef _LIBC
-  /* Update internal database according to current TZ setting.  */
-  __tzset_internal (1);
+  /* POSIX.1 8.1.1 requires that whenever mktime() is called, the
+     time zone names contained in the external variable `tzname' shall
+     be set as if the tzset() function had been called.  */
+  __tzset ();
 #endif
 
   return __mktime_internal (tp, localtime_r, &localtime_offset);
index d12236fdf2c376764e1bea25de87b2e6ad5df86a..681b6007d89309cc568a9c07cb687c76869ea7ed 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
@@ -171,7 +171,7 @@ extern struct tm *gmtime __P ((__const time_t *__timer));
    of *TIMER in the local timezone.  */
 extern struct tm *localtime __P ((__const time_t *__timer));
 
-#ifdef __USE_REENTRANT
+#if defined __USE_POSIX || defined __USE_REENTRANT
 /* Return the `struct tm' representation of *TIMER in UTC,
    using *TP to store the result.  */
 extern struct tm *__gmtime_r __P ((__const time_t *__timer,
@@ -185,7 +185,7 @@ extern struct tm *__localtime_r __P ((__const time_t *__timer,
                                      struct tm *__tp));
 extern struct tm *localtime_r __P ((__const time_t *__timer,
                                    struct tm *__tp));
-#endif /* reentrant */
+#endif /* POSIX or reentrant */
 
 /* Compute the `struct tm' representation of *T,
    offset OFFSET seconds east of UTC,
@@ -201,7 +201,7 @@ extern char *asctime __P ((__const struct tm *__tp));
 /* Equivalent to `asctime (localtime (timer))'.  */
 extern char *ctime __P ((__const time_t *__timer));
 
-#ifdef __USE_REENTRANT
+#if defined __USE_POSIX || defined __USE_REENTRANT
 /* Reentrant versions of the above functions.  */
 
 /* Return in BUF a string of the form "Day Mon dd hh:mm:ss yyyy\n"
@@ -211,7 +211,7 @@ extern char *asctime_r __P ((__const struct tm *__tp, char *__buf));
 
 /* Equivalent to `asctime_r (localtime_r (timer, *TMP*), buf)'.  */
 extern char *ctime_r __P ((__const time_t *__timer, char *__buf));
-#endif /* reentrant */
+#endif /* POSIX or reentrant */
 
 
 /* Defined in localtime.c.  */
index 761ddc95396f4ae10ebb309782d07911117ad32f..ed7b0932f3bb93e697e9c31a149f132a0bbe1bb9 100644 (file)
@@ -21,6 +21,7 @@
 #include <time.h>
 #include <string.h>
 #include <limits.h>
+#include <unistd.h>
 
 #define        NOID
 #include <tzfile.h>
@@ -79,6 +80,7 @@ decode (const void *ptr)
 void
 __tzfile_read (const char *file)
 {
+  static const char default_tzdir[] = TZDIR;
   size_t num_isstd, num_isgmt;
   register FILE *f;
   struct tzhead tzhead;
@@ -111,9 +113,19 @@ __tzfile_read (const char *file)
     /* User specified the empty string; use UTC explicitly.  */
     file = "Universal";
 
+  /* We must not allow to read an arbitrary file in a setuid program.
+     So we fail for any file which is not in the directory hierachy
+     starting at TZDIR.  */
+  if (__libc_enable_secure
+      && ((*file == '/'
+          && memcmp (file, default_tzdir, sizeof (default_tzdir) - 1) != 0)
+         || strstr (file, "../") != NULL))
+    /* This test a certainly a bit too restrictive but it should catch all
+       critical case.  */
+    return;
+
   if (*file != '/')
     {
-      static const char default_tzdir[] = TZDIR;
       const char *tzdir;
       unsigned int len, tzdir_len;
       char *new;