Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
update from main archive 970122
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.
  • Loading branch information
Ulrich Drepper committed Jan 24, 1997
1 parent 8d57bee commit 9d187dd
Show file tree
Hide file tree
Showing 21 changed files with 203 additions and 111 deletions.
38 changes: 37 additions & 1 deletion 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.
Expand Down Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions Makerules
Expand Up @@ -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
Expand Down
20 changes: 17 additions & 3 deletions 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>
Expand All @@ -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
Expand All @@ -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.
Expand Down Expand Up @@ -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.
6 changes: 3 additions & 3 deletions dirent/dirent.h
@@ -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
Expand Down Expand Up @@ -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));
Expand Down
6 changes: 3 additions & 3 deletions 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion intl/Makefile
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions posix/unistd.h
Expand Up @@ -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. */
Expand Down
6 changes: 3 additions & 3 deletions 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
72 changes: 42 additions & 30 deletions stdio-common/bug7.c
Expand Up @@ -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.");
Expand Down
34 changes: 17 additions & 17 deletions stdio-common/tmpnam.c
@@ -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>
Expand Down
28 changes: 14 additions & 14 deletions stdio-common/tmpnam_r.c
@@ -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>
Expand Down
4 changes: 3 additions & 1 deletion string/string.h
Expand Up @@ -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. */
Expand Down
7 changes: 7 additions & 0 deletions sysdeps/unix/sysv/linux/alpha/sys/kernel_termios.h
@@ -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
Expand All @@ -16,3 +21,5 @@ struct __kernel_termios

#define _HAVE_C_ISPEED 1
#define _HAVE_C_OSPEED 1

#endif /* sys/kernel_termios.h */

0 comments on commit 9d187dd

Please sign in to comment.