summaryrefslogtreecommitdiff
path: root/stdio-common/tst-ungetc.c
AgeCommit message (Collapse)Author
2018-07-18Avoid insecure usage of tmpnam in tests.Joseph Myers
Various glibc testcases use tmpnam in ways subject to race conditions (generate a temporary file name, then later open that file without O_EXCL). This patch fixes those tests to use mkstemp - generally a minimal local fix to use mkstemp instead of tmpnam, rather than a larger fix to use other testsuite infrastructure for temporary files. The unchanged use of tmpnam in posix/wordexp-test.c would fail safe in the event of a race (it's generating a name for use with mkdir rather than for a file to be opened for writing). Tested for x86_64. * grp/tst_fgetgrent.c: Include <unistd.h>. (main): Use mkstemp instead of tmpnam. * io/test-utime.c (main): Likewise. * posix/annexc.c (macrofile): Change to modifiable array. (get_null_defines): Use mkstemp instead of tmpnam. Do not remove macrofile here. * posix/bug-getopt1.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt2.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt3.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt4.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * posix/bug-getopt5.c: Include <stdlib.h>. (do_test): Use mkstemp instead of tmpnam. * stdio-common/bug7.c: Include <stdlib.h> and <unistd.h>. (main): Use mkstemp instead of tmpnam. * stdio-common/tst-fdopen.c: Include <stdlib.h>. (main): Use mkstemp instead of tmpnam. * stdio-common/tst-ungetc.c: Include <stdlib.h>. (main): use mkstemp instead of tmpnam. * stdlib/isomac.c (macrofile): Change to modifiable array. (get_null_defines): Use mkstemp instead of tmpnam. Do not remove macrofile here.
2002-12-19Update.Ulrich Drepper
2002-12-19 Jakub Jelinek <jakub@redhat.com> * nscd/connections.c (nscd_run): Shut up warning. * tst-ungetc.c (assert): Undefined before redefining. 2002-12-19 Ulrich Drepper <drepper@redhat.com> * posix/regex.c: Use __builtin_expect even outside glibc if gcc 3 is used. 2002-12-17 Art Haas <ahaas@airmail.net> * iconvdata/cp737.h: Convert GCC extension initializer syntax to C99. * iconvdata/cp775.h: Likewise. * iconvdata/ibm1046.h: Likewise. * iconvdata/ibm1124.h: Likewise. * iconvdata/ibm1129.h: Likewise. * iconvdata/ibm1132.h: Likewise. * iconvdata/ibm1133.h: Likewise. * iconvdata/ibm1160.h: Likewise. * iconvdata/ibm1161.h: Likewise. * iconvdata/ibm1162.h: Likewise. * iconvdata/ibm1163.h: Likewise. * iconvdata/ibm1164.h: Likewise. (__ASSUME_CLONE_THREAD_FLAGS): Define for x86 and kernel >= 2.5.50.
2002-02-26Update.Ulrich Drepper
2002-02-25 Jakub Jelinek <jakub@redhat.com> * libio/iofopen.c (__fopen_maybe_mmap): Set the initial position to fp->_offset if it is set. * stdio-common/Makefile (tests): Add tst-fdopen. * stdio-common/tst-fdopen.c: New test. 2002-02-25 Jakub Jelinek <jakub@redhat.com> * libio/fileops.c (_IO_file_xsgetn_mmap): Handle reading from backup. * stdio-common/tst-ungetc.c (main): Add another test.
1998-10-23Update.Ulrich Drepper
* version.h (VERSION): Bump to 2.0.99. * posix/fnmath.h: Don't redefine __P when used in glibc. * posix/glob.h: Likewise. * inet/rcmd.c (__ivaliduser2): Fix memory leak. Patch by Dick Streefland <dick_streefland@tasking.com>. * stdio-common/tst-ungetc.c: Add more test cases. * sysdeps/unix/sysv/linux/Dist: Add linux_fsinfo.h. * sysdeps/unix/sysv/linux/fstatvfs.c: Move filesystem magic number definitions to ... * sysdeps/unix/sysv/linux/linux_fsinfo.h: ...here. New file. * sysdeps/unix/sysv/linux/fpathconf.c: New file. * sysdeps/unix/sysv/linux/pathconf.c: New file. * sysdeps/unix/sysv/linux/alpha/fpathconf.c: Handle _PC_LINK_MAX here. * sysdeps/unix/sysv/linux/alpha/pathconf.c: Likewise. 1998-10-20 Philip Blundell <pb@nexus.co.uk> * sysdeps/unix/sysv/linux/arm/bits/armsigctx.h: Include <asm/ptrace.h> to define struct pt_regs. * sysdeps/unix/sysv/linux/arm/profil-counter.h: Don't bother including <asm/ptrace.h> here. * sysdeps/unix/sysv/linux/arm/sysdep.S: Remove spurious call to C_SYMBOL_NAME macro. 1998-10-23 Andreas Jaeger <aj@arthur.rhein-neckar.de> * sysdeps/generic/sys/ptrace.h (__ptrace_request): Remove comma at end of enumerator list. * sysdeps/unix/sysv/linux/sys/ptrace.h (__ptrace_request): Likewise. * posix/wordexp.h: Likewise. * db/db.h: Use __PMT instead of __P in typedefs. * db/mpool.h: Likewise. * sysdeps/generic/bits/siginfo.h: Likewise. * nis/rpcsvc/ypclnt.h: Likewise. 1998-10-23 Ulrich Drepper <drepper@cygnus.com>
1996-07-02* nss/nss_files/files-ethers.c (ntohost): Fix db key.Roland McGrath
1996-03-12Tue Mar 12 04:42:01 1996 Roland McGrath <roland@charlie-brown.gnu.ai.mit.edu>Roland McGrath
* sysdeps/sparc/jmp_buf.h: Rewritten; use array of ints, not struct. * sysdeps/sparc/setjmp.S: Rewritten; store %fp value as well. * sysdeps/sparc/__longjmp.S: Rewritten; unwind frames one by one with `restore' until the target frame is hit. Sun Mar 10 20:29:40 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/unix/sysv/linux/sigsuspend.c: New file. * sysdeps/unix/sysv/linux/syscalls.list: Remove sigsuspend, add s_sigsuspend. Thu Mar 7 21:30:58 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * Makerules (+make-deps, sed-remove-objpfx): Quote periods on the left side of sed substitutions. Sun Mar 10 16:58:10 1996 Ulrich Drepper <drepper@gnu.ai.mit.edu> * stdio-common/printf_fp.c (hack_digit): __mpn_normal_size is not available anymore. Do it ourselves. * sysdeps/unix/sysv/linux/i386/fpu_control.h (_FPU_SETCW): Correct GCC `asm' syntax. * stdio-common/Makefile (tests): Add tst-ungetc. * stdio-common/tst-ungetc.c: New test from drepper. * stdio-common/tstscanf.c (main): New %[ test case from drepper. * sysdeps/libm-ieee754/s_scalbn.c (scalbn): Rename to __scalbn; somehow this was missed, though the weak alias is already there.