From c83494a925f4b4b716f9ba3abcb5e695d3e2a8a9 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 16 Jul 2008 09:53:45 +0000 Subject: Updated to fedora-glibc-20080716T0944 --- ChangeLog | 52 +++++++ fedora/branch.mk | 4 +- fedora/glibc.spec.in | 10 +- libio/iosetvbuf.c | 2 +- localedata/ChangeLog | 11 ++ localedata/charmaps/UTF-8 | 2 +- localedata/locales/iso14651_t1_common | 270 ++++++++++++++++++++++++++++++++++ malloc/hooks.c | 4 +- nscd/connections.c | 112 ++++++++++---- resolv/res_query.c | 26 +++- resolv/res_send.c | 1 - stdio-common/Makefile | 8 +- stdio-common/tst-setvbuf1.c | 19 +++ stdio-common/tst-setvbuf1.expect | 2 + stdio-common/vfprintf.c | 11 +- sysdeps/mach/hurd/bits/fcntl.h | 2 + sysdeps/mach/hurd/open.c | 13 ++ sysdeps/mach/hurd/openat.c | 14 ++ time/mktime.c | 6 +- 19 files changed, 522 insertions(+), 47 deletions(-) create mode 100644 stdio-common/tst-setvbuf1.c create mode 100644 stdio-common/tst-setvbuf1.expect diff --git a/ChangeLog b/ChangeLog index 7edad286e1..2f4f0f3a6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,55 @@ +2008-07-15 Ulrich Drepper + + * stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn + doesn't manage to write anything, fail. + + * malloc/hooks.c (__malloc_check_init): Remove printf. + +2008-07-14 Samuel Thibault + + * sysdeps/mach/hurd/bits/fcntl.h: Include . + +2008-07-12 Ulrich Drepper + + * nscd/connections.c (main_loop_poll): Fix handling of read errors + from inotify. + (main_loop_epoll): Likewise. + +2008-07-09 Ulrich Drepper + + * resolv/res_send.c: Remove unnecessary res_pquery prototype. + + * resolv/res_query.c (__libc_res_nquery): Issue debug message only + if DEBUG is defined. + + * resolv/res_query.c (__libc_res_nquery): Align buffer for T_AAAA + query. Adjust buffer size computation for padding. + +2008-07-08 Ulrich Drepper + + * stdio-common/Makefile: Add rules to build and run tst-setvbuf1. + * stdio-common/tst-setvbuf1.c: New file. + * stdio-common/tst-setvbuf1.expect: New file. + + [BZ #6719] + * libio/iosetvbuf.c (_IO_setvbuf): Correctly clear buffering flags + when selecting fully-buffered stream. + Patch by Wang Xin . + +2008-07-06 Samuel Thibault + + * sysdeps/mach/hurd/open.c: Include . + (__open_2): New function. + (__open64_2): New alias to __open_2. + * sysdeps/mach/hurd/openat.c: Include . + (__openat_2): New function. + (__openat64_2): New alias to __openat_2. + +2008-07-06 Ulrich Drepper + + [BZ #6723] + * time/mktime.c (__mktime_internal): Normalize tp->tm_isdst value. + 2008-07-01 Samuel Thibault * sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL. diff --git a/fedora/branch.mk b/fedora/branch.mk index ab0528fd81..1b14d1b8f4 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-f8 -fedora-sync-date := 2008-07-03 12:03 UTC -fedora-sync-tag := fedora-glibc-20080703T1203 +fedora-sync-date := 2008-07-16 09:44 UTC +fedora-sync-tag := fedora-glibc-20080716T0944 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index f84d8f49ad..1c13bea7a8 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -19,7 +19,7 @@ Summary: The GNU libc libraries Name: glibc Version: @glibcversion@ -Release: 8 +Release: 9 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries. # Things that are linked directly into dynamically linked programs # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional @@ -976,6 +976,14 @@ rm -f *.filelist* %endif %changelog +* Wed Jul 16 2008 Jakub Jelinek 2.8.90-9 +- update from trunk + - fix unbuffered vfprintf if writing to the stream fails (#455360) + - remove useless "malloc: using debugging hooks" message (#455355) + - nscd fixes + - fix resolver alignment issues (#454500) + - fix setvbuf (BZ#6719) + * Thu Jul 3 2008 Jakub Jelinek 2.8.90-8 - update from trunk - watch even resolv.conf in nscd using inotify diff --git a/libio/iosetvbuf.c b/libio/iosetvbuf.c index 7580230eb6..a92eaebf85 100644 --- a/libio/iosetvbuf.c +++ b/libio/iosetvbuf.c @@ -45,7 +45,7 @@ _IO_setvbuf (fp, buf, mode, size) switch (mode) { case _IOFBF: - fp->_IO_file_flags &= ~_IO_LINE_BUF|_IO_UNBUFFERED; + fp->_IO_file_flags &= ~(_IO_LINE_BUF|_IO_UNBUFFERED); if (buf == NULL) { if (fp->_IO_buf_base == NULL) diff --git a/localedata/ChangeLog b/localedata/ChangeLog index a7291beec9..7c3f41d21b 100644 --- a/localedata/ChangeLog +++ b/localedata/ChangeLog @@ -1,3 +1,14 @@ +2008-07-11 Ulrich Drepper + + * locales/iso14651_t1_common: Add Kannada collation support. + Patch by Pravin Satpute . + +2008-07-08 Ulrich Drepper + + [BZ #6713] + * charmaps/UTF-8: Fix U1DBA entry representation. + Patch by Colin Watson. + 2008-06-27 Ulrich Drepper * tst-strptime.c (do_test): Add test of %EY. diff --git a/localedata/charmaps/UTF-8 b/localedata/charmaps/UTF-8 index d4375bbab4..34b2f7ee8f 100644 --- a/localedata/charmaps/UTF-8 +++ b/localedata/charmaps/UTF-8 @@ -5961,7 +5961,7 @@ CHARMAP /xe1/xb6/xb7 MODIFIER LETTER SMALL UPSILON /xe1/xb6/xb8 MODIFIER LETTER SMALL CAPITAL U /xe1/xb6/xb9 MODIFIER LETTER SMALL V WITH HOOK - /xe1/xb6/xbe MODIFIER LETTER SMALL TURNED V + /xe1/xb6/xba MODIFIER LETTER SMALL TURNED V /xe1/xb6/xbb MODIFIER LETTER SMALL Z /xe1/xb6/xbc MODIFIER LETTER SMALL Z WITH RETROFLEX HOOK /xe1/xb6/xbd MODIFIER LETTER SMALL Z WITH CURL diff --git a/localedata/locales/iso14651_t1_common b/localedata/locales/iso14651_t1_common index 35c0af0b21..cbca3eb863 100644 --- a/localedata/locales/iso14651_t1_common +++ b/localedata/locales/iso14651_t1_common @@ -64,6 +64,7 @@ script script script script +script # Déclaration des symboles internes / Declaration of internal symbols # @@ -816,6 +817,99 @@ collating-symbol collating-symbol collating-symbol +# +# +# kvd- denotes vowel modifier +# km- denotes matras +# kvw- denotes vowels +# denotes Nukta characters + +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" +collating-element from "" + +# defning symbols + +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol +collating-symbol + # Ordre des symboles internes / Order of internal symbols # # SYMB. N° @@ -1557,6 +1651,88 @@ collating-symbol +# +# +# +# collation weights in order + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + order_start ;forward;backward;forward;forward,position # # Tout caractère non précisément défini sera considéré comme caractère spécial @@ -3698,6 +3874,100 @@ order_start ;forward;forward;forward;forward,position IGNORE;;;IGNORE IGNORE;;;IGNORE +order_start ;forward;forward;forward;forward,position + <0>;"";"";IGNORE + <1>;"";"";IGNORE + <2>;"";"";IGNORE + <3>;"";"";IGNORE + <4>;"";"";IGNORE + <5>;"";"";IGNORE + <6>;"";"";IGNORE + <7>;"";"";IGNORE + <8>;"";"";IGNORE + <9>;"";"";IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + ;;;IGNORE + IGNORE;;;IGNORE + order_end END LC_COLLATE diff --git a/malloc/hooks.c b/malloc/hooks.c index 1e01b73afd..c88937665c 100644 --- a/malloc/hooks.c +++ b/malloc/hooks.c @@ -1,5 +1,5 @@ /* Malloc implementation for multiple threads without lock contention. - Copyright (C) 2001-2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2001-2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Wolfram Gloger , 2001. @@ -96,8 +96,6 @@ __malloc_check_init() __free_hook = free_check; __realloc_hook = realloc_check; __memalign_hook = memalign_check; - if(check_action & 1) - malloc_printerr (5, "malloc: using debugging hooks", NULL); } /* A simple, standard set of debugging hooks. Overhead is `only' one diff --git a/nscd/connections.c b/nscd/connections.c index 0afc95a227..e4d32b27de 100644 --- a/nscd/connections.c +++ b/nscd/connections.c @@ -1806,42 +1806,64 @@ main_loop_poll (void) size_t first = 1; #ifdef HAVE_INOTIFY - if (conns[1].fd == inotify_fd) + if (inotify_fd != -1 && conns[1].fd == inotify_fd) { if (conns[1].revents != 0) { - bool done[lastdb] = { false, }; + bool to_clear[lastdb] = { false, }; union { struct inotify_event i; char buf[100]; } inev; - while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev, - sizeof (inev))) - >= (ssize_t) sizeof (struct inotify_event)) + while (1) { + ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev, + sizeof (inev))); + if (nb < (ssize_t) sizeof (struct inotify_event)) + { + if (nb == -1) + { + /* Something went wrong when reading the inotify + data. Better disable inotify. */ + conns[1].fd = -1; + firstfree = 1; + if (nused == 2) + nused = 1; + close (inotify_fd); + inotify_fd = -1; + dbg_log (_("disabled inotify after read error")); + } + break; + } + /* Check which of the files changed. */ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) - if (!done[dbcnt] - && (inev.i.wd == dbs[dbcnt].inotify_descr - || (dbcnt == hstdb - && inev.i.wd == resolv_conf_descr))) + if (inev.i.wd == dbs[dbcnt].inotify_descr) { - if (dbcnt == hstdb - && inev.i.wd == resolv_conf_descr) - res_init (); - - pthread_mutex_lock (&dbs[dbcnt].prune_lock); - dbs[dbcnt].clear_cache = 1; - pthread_mutex_unlock (&dbs[dbcnt].prune_lock); - pthread_cond_signal (&dbs[dbcnt].prune_cond); - - done[dbcnt] = true; - break; + to_clear[dbcnt] = true; + goto next; } + + if (inev.i.wd == resolv_conf_descr) + { + res_init (); + to_clear[hstdb] = true; + } + next:; } + /* Actually perform the cache clearing. */ + for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) + if (to_clear[dbcnt]) + { + pthread_mutex_lock (&dbs[dbcnt].prune_lock); + dbs[dbcnt].clear_cache = 1; + pthread_mutex_unlock (&dbs[dbcnt].prune_lock); + pthread_cond_signal (&dbs[dbcnt].prune_cond); + } + --n; } @@ -1966,27 +1988,57 @@ main_loop_epoll (int efd) #ifdef HAVE_INOTIFY else if (revs[cnt].data.fd == inotify_fd) { + bool to_clear[lastdb] = { false, }; union { struct inotify_event i; char buf[100]; } inev; - while (TEMP_FAILURE_RETRY (read (inotify_fd, &inev, - sizeof (inev))) - >= (ssize_t) sizeof (struct inotify_event)) + while (1) { + ssize_t nb = TEMP_FAILURE_RETRY (read (inotify_fd, &inev, + sizeof (inev))); + if (nb < (ssize_t) sizeof (struct inotify_event)) + { + if (nb == -1) + { + /* Something went wrong when reading the inotify + data. Better disable inotify. */ + (void) epoll_ctl (efd, EPOLL_CTL_DEL, inotify_fd, + NULL); + close (inotify_fd); + inotify_fd = -1; + dbg_log (_("disabled inotify after read error")); + } + break; + } + /* Check which of the files changed. */ for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) if (inev.i.wd == dbs[dbcnt].inotify_descr) { - pthread_mutex_trylock (&dbs[dbcnt].prune_lock); - dbs[dbcnt].clear_cache = 1; - pthread_mutex_unlock (&dbs[dbcnt].prune_lock); - pthread_cond_signal (&dbs[dbcnt].prune_cond); - break; + to_clear[dbcnt] = true; + goto next; } + + if (inev.i.wd == resolv_conf_descr) + { + res_init (); + to_clear[hstdb] = true; + } + next:; } + + /* Actually perform the cache clearing. */ + for (size_t dbcnt = 0; dbcnt < lastdb; ++dbcnt) + if (to_clear[dbcnt]) + { + pthread_mutex_lock (&dbs[dbcnt].prune_lock); + dbs[dbcnt].clear_cache = 1; + pthread_mutex_unlock (&dbs[dbcnt].prune_lock); + pthread_cond_signal (&dbs[dbcnt].prune_cond); + } } #endif else @@ -2010,8 +2062,10 @@ main_loop_epoll (int efd) /* Now look for descriptors for accepted connections which have no reply in too long of a time. */ time_t laststart = now - ACCEPT_TIMEOUT; + assert (starttime[sock] == 0); + assert (inotify_fd == -1 || starttime[inotify_fd] == 0); for (int cnt = highest; cnt > STDERR_FILENO; --cnt) - if (cnt != sock && starttime[cnt] != 0 && starttime[cnt] < laststart) + if (starttime[cnt] != 0 && starttime[cnt] < laststart) { /* We are waiting for this one for too long. Close it. */ (void) epoll_ctl (efd, EPOLL_CTL_DEL, cnt, NULL); diff --git a/resolv/res_query.c b/resolv/res_query.c index 3d2f2fe3a9..b2b45acde7 100644 --- a/resolv/res_query.c +++ b/resolv/res_query.c @@ -146,18 +146,34 @@ __libc_res_nquery(res_state statp, { if ((oflags & RES_F_EDNS0ERR) == 0 && (statp->options & RES_USE_EDNS0) != 0) - n = __res_nopt(statp, n, query1, bufsize, anslen / 2); + { + n = __res_nopt(statp, n, query1, bufsize, anslen / 2); + if (n < 0) + goto unspec_nomem; + } nquery1 = n; - query2 = buf + nquery1; + /* Align the buffer. */ + int npad = ((nquery1 + __alignof__ (HEADER) - 1) + & ~(__alignof__ (HEADER) - 1)) - nquery1; + if (n > bufsize - npad) + { + n = -1; + goto unspec_nomem; + } + int nused = n + npad; + query2 = buf + nused; n = res_nmkquery(statp, QUERY, name, class, T_AAAA, NULL, 0, - NULL, query2, bufsize - n); + NULL, query2, bufsize - nused); if (n > 0 && (oflags & RES_F_EDNS0ERR) == 0 && (statp->options & RES_USE_EDNS0) != 0) - n = __res_nopt(statp, n, query2, bufsize - n, anslen / 2); + n = __res_nopt(statp, n, query2, bufsize - nused - n, + anslen / 2); nquery2 = n; } + + unspec_nomem:; } else { @@ -188,8 +204,10 @@ __libc_res_nquery(res_state statp, if ((statp->options & RES_USE_EDNS0) != 0 && ((oflags ^ statp->_flags) & RES_F_EDNS0ERR) != 0) { statp->_flags |= RES_F_EDNS0ERR; +#ifdef DEBUG if (statp->options & RES_DEBUG) printf(";; res_nquery: retry without EDNS0\n"); +#endif goto again; } #ifdef DEBUG diff --git a/resolv/res_send.c b/resolv/res_send.c index e78ff967aa..dec3ac7a3f 100644 --- a/resolv/res_send.c +++ b/resolv/res_send.c @@ -194,7 +194,6 @@ static int sock_eq(struct sockaddr_in6 *, struct sockaddr_in6 *); /* Reachover. */ static void convaddr4to6(struct sockaddr_in6 *sa); -void res_pquery(const res_state, const u_char *, int, FILE *); /* Public. */ diff --git a/stdio-common/Makefile b/stdio-common/Makefile index f8ae6f25d9..944270dafe 100644 --- a/stdio-common/Makefile +++ b/stdio-common/Makefile @@ -1,4 +1,4 @@ -# Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc. +# Copyright (C) 1991-2006, 2007, 2008 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 @@ -58,7 +58,7 @@ tests := tstscanf test_rdwr test-popen tstgetln test-fseek \ tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \ tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \ bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \ - scanf16 scanf17 + scanf16 scanf17 tst-setvbuf1 test-srcs = tst-unbputc tst-printf @@ -130,3 +130,7 @@ bug15-ENV = LOCPATH=$(common-objpfx)localedata ifneq (,$(filter %REENTRANT, $(defines))) CPPFLAGS += -D_IO_MTSAFE_IO endif + +$(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1 + $(built-program-cmd) > $@ 2>&1 + cmp tst-setvbuf1.expect $@ diff --git a/stdio-common/tst-setvbuf1.c b/stdio-common/tst-setvbuf1.c new file mode 100644 index 0000000000..22410939c9 --- /dev/null +++ b/stdio-common/tst-setvbuf1.c @@ -0,0 +1,19 @@ +#include + +static int +do_test (void) +{ + if (setvbuf (stderr, NULL, _IOFBF, BUFSIZ) != 0) + { + puts ("Set full buffer error."); + return 1; + } + + fprintf (stderr, "Output #1 .\n"); + printf ("Output #2 .\n"); + + return 0; +} + +#define TEST_FUNCTION do_test () +#include "../test-skeleton.c" diff --git a/stdio-common/tst-setvbuf1.expect b/stdio-common/tst-setvbuf1.expect new file mode 100644 index 0000000000..281c18ca1e --- /dev/null +++ b/stdio-common/tst-setvbuf1.expect @@ -0,0 +1,2 @@ +Output #2 . +Output #1 . diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c index ca6343c37f..714c76c3d4 100644 --- a/stdio-common/vfprintf.c +++ b/stdio-common/vfprintf.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007 +/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -2080,6 +2080,11 @@ _IO_helper_overflow (_IO_FILE *s, int c) { _IO_size_t written = _IO_sputn (target, s->_wide_data->_IO_write_base, used); + if (written == 0 || written == WEOF) + return WEOF; + __wmemmove (s->_wide_data->_IO_write_base, + s->_wide_data->_IO_write_base + written, + used - written); s->_wide_data->_IO_write_ptr -= written; } #else @@ -2087,6 +2092,10 @@ _IO_helper_overflow (_IO_FILE *s, int c) if (used) { _IO_size_t written = _IO_sputn (target, s->_IO_write_base, used); + if (written == 0 || written == EOF) + return EOF; + memmove (s->_IO_write_base, s->_IO_write_base + written, + used - written); s->_IO_write_ptr -= written; } #endif diff --git a/sysdeps/mach/hurd/bits/fcntl.h b/sysdeps/mach/hurd/bits/fcntl.h index 2f890c1b65..b4147cee51 100644 --- a/sysdeps/mach/hurd/bits/fcntl.h +++ b/sysdeps/mach/hurd/bits/fcntl.h @@ -22,6 +22,8 @@ # error "Never use directly; include instead." #endif +#include + /* File access modes. These are understood by io servers; they can be passed in `dir_lookup', and are returned by `io_get_openmodes'. Consequently they can be passed to `open', `hurd_file_name_lookup', and diff --git a/sysdeps/mach/hurd/open.c b/sysdeps/mach/hurd/open.c index bdfed5e311..519789f22f 100644 --- a/sysdeps/mach/hurd/open.c +++ b/sysdeps/mach/hurd/open.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -52,8 +53,20 @@ weak_alias (__libc_open, __open) libc_hidden_weak (__open) weak_alias (__libc_open, open) +int +__open_2 (file, oflag) + const char *file; + int oflag; +{ + if (oflag & O_CREAT) + __fortify_fail ("invalid open call: O_CREAT without mode"); + + return __open (file, oflag); +} + /* open64 is just the same as open for us. */ weak_alias (__libc_open, __libc_open64) weak_alias (__libc_open, __open64) libc_hidden_weak (_open64) weak_alias (__libc_open, open64) +strong_alias (__open_2, __open64_2) diff --git a/sysdeps/mach/hurd/openat.c b/sysdeps/mach/hurd/openat.c index 1faf857e16..f0a3404cd8 100644 --- a/sysdeps/mach/hurd/openat.c +++ b/sysdeps/mach/hurd/openat.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,20 @@ __openat (fd, file, oflag) libc_hidden_def (__openat) weak_alias (__openat, openat) +int +__openat_2 (fd, file, oflag) + int fd; + const char *file; + int oflag; +{ + if (oflag & O_CREAT) + __fortify_fail ("invalid openat call: O_CREAT without mode"); + + return __openat (fd, file, oflag); +} + /* openat64 is just the same as openat for us. */ weak_alias (__openat, __openat64) libc_hidden_weak (__openat64) weak_alias (__openat, openat64) +strong_alias (__openat_2, __openat64_2) diff --git a/time/mktime.c b/time/mktime.c index e299375a16..e47d69615a 100644 --- a/time/mktime.c +++ b/time/mktime.c @@ -1,5 +1,5 @@ /* Convert a `struct tm' to a time_t value. - Copyright (C) 1993-1999, 2002-2006, 2007 Free Software Foundation, Inc. + Copyright (C) 1993-1999, 2002-2007, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Paul Eggert . @@ -293,7 +293,9 @@ __mktime_internal (struct tm *tp, int mday = tp->tm_mday; int mon = tp->tm_mon; int year_requested = tp->tm_year; - int isdst = tp->tm_isdst; + /* Normalize the value. */ + int isdst = ((tp->tm_isdst >> (8 * sizeof (tp->tm_isdst) - 1)) + | (tp->tm_isdst != 0)); /* 1 if the previous probe was DST. */ int dst2; -- cgit v1.2.3