diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-05-19 16:04:10 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-05-19 16:04:10 +0000 |
commit | 4cad81b6e72ed99c7816f28ad6828196b2ac7b65 (patch) | |
tree | 418c1c32beba4d79ae71206b90fbb6a8847eca2a | |
parent | 3ec0d26c76d6905501034692d05bddbabae64e76 (diff) |
Updated to fedora-glibc-20060519T1550cvs/fedora-glibc-2_4_90-8
57 files changed, 718 insertions, 324 deletions
@@ -1,3 +1,177 @@ +2006-05-19 Ulrich Drepper <drepper@redhat.com> + + * nis/nis_callback.c (__nis_create_callback): Calls to + svcudp_bufcreate and svctcp_create can fail. Free ->xprt if + asprintf call fails. + + * sysdeps/unix/sysv/linux/ifaddrs.c (__netlink_sendreq): Make sure + no uninitialized memory is passed to sendto. + +2006-05-18 Ulrich Drepper <drepper@redhat.com> + + * nis/nis_callback.c (__nis_create_callback): Use asprinf instead + of snprintf+strdup. Handle OOM. + * nis/nis_callback.c (__nis_create_callback): Allocate cb and + cb->serv together. Remove now obsolete free calls. + (__nis_destroy_callback): Remove now obsolete free call. + +2006-05-18 David Woodhouse <dwmw2@infradead.org> + + * sysdeps/posix/getaddrinfo.c: Add unique labels to the default + RFC3484 precedence table for fec0::/10 and fc00::/7 (site-local + and ULA respectively). Set precedence for IPv4 address to 10 as + defined in RFC3484 for preferring IPv6. + * posix/gai.conf: Update to match the new default tables. + +2006-05-18 Jakub Jelinek <jakub@redhat.com> + + * nis/nss_compat/compat-pwd.c (internal_setpwent): If nss_set*ent + returned NSS_STATUS_UNAVAIL, still return NSS_STATUS_SUCCESS. + * nis/nss_compat/compat-spwd.c (internal_setspent): Likewise. + * nis/nss_compat/compat-grp.c (internal_setgrent): Likewise. + + * nis/nss_compat/compat-initgroups.c (nss_setgrent, nss_endgrent): + Removed. + (init_nss_interface): Remove initialization of these variables. + +2006-05-18 Ulrich Drepper <drepper@redhat.com> + + * nis/nis_call.c (rec_dirsearch): Little optimization: pull + nis_free_directory forward to avoid duplication. + +2006-05-17 Ulrich Drepper <drepper@redhat.com> + + * nis/nis_call.c (rec_dirsearch): Handle __nis_finddirectory and + rec_dirsearch returning NULL. + (first_shoot): Handle __nis_finddirectory returning NULL. + (__nisfind_server): Fix leak when rec_dirsearch returns NULL. + + * sysdeps/unix/sysv/linux/sys/inotify.h: Define IN_CLOSE, IN_MOVE, + IN_ONLYDIR, IN_DONT_FOLLOW, and IN_MASK_ADD. + +2006-05-17 Jakub Jelinek <jakub@redhat.com> + + * sunrpc/key_call.c (getkeyserv_handle): Call auth_destroy if + pid changed. + +2006-05-15 Ulrich Drepper <drepper@redhat.com> + + * include/rpc/pmap_prot.h: Mark all functions as hidden. + + * nscd/nscd_initgroups.c: Mark __gr_map_handle as hidden. + * nscd/nscd_getgr_r.c: Likewise. + + * include/rpc/pmap_rmt.h: Mark all functions as hidden. + + * nscd/nscd_getai.c (__hst_map_handle): Mark as hidden. + * nscd/nscd_gethst_r.c (__hst_map_handle): Likewise. + + * stdlib/longlong.h (__clz_tab): Mark as hidden. + + * iconv/gconv_int.h: Mark __gconv_lock as hidden. + + * include/rpc/key_prot.h: Mark all _internal functions as hidden. + + * include/rpc/auth.h: Mark xdr_des_block_internal and + xdr_opaque_auth_internal as hidden. + + * sysdeps/unix/sysv/linux/getdents.c: Mark __have_no_getdents64 as + hidden. + + * include/rpc/xdr.h: Mark all _internal functions as hidden. + + * misc/getusershell.c (okshells): Don't use static initializers, + do it dynamically. + + * stdlib/fmtmsg.c (keywords): Change type of len element to + uint32_t to not waste space on 64bit machines. + + * locale/setlocale.c: Change _nl_category_names into a string. + Add new _nl_category_name_idxs. Change all users. + * locale/localeinfo.h: Adjust declaration of _nl_category_names. + Declare _nl_category_name_idxs. + * locale/findlocale.c: Adjust for _nl_category_names change. + * locale/loadlocale.c: Likewise. + * locale/newlocale.c: Likewise. + * intl/dcigettext.c: Likewise. + + * iconv/gconv_conf.c (add_alias): Move actual alias handling to... + (add_alias2): ...here. New function. + (__gconv_read_conf): Simplify builtin alias handling. + (builtin_aliases): Convert to string to avoid relocations. + * iconv/gconv_builtin.h: Add comment about correct formatting. + +2006-05-15 Jakub Jelinek <jakub@redhat.com> + + * resolv/res_debug.c (loc_ntoa): Make error const. + +2006-05-14 Andreas Schwab <schwab@suse.de> + + * math/complex.h [__LDBL_COMPAT]: Use __REDIRECT_NTH. + +2006-05-12 Jakub Jelinek <jakub@redhat.com> + + * sysdeps/unix/sysv/linux/sched_getaffinity.c: Include sys/param.h. + (__sched_getaffinity_new): Don't crash if cpusetsize is smaller than + sizeof (cpu_set_t). + +2006-05-11 Ulrich Drepper <drepper@redhat.com> + + * resolv/res_debug.c (loc_ntoa): Define error as array, not pointer. + + * include/arpa/nameser.h: Declare _ns_flagdata as hidden. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypresp_master. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypresp_master. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypbind_resp. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypbind_resp. + + * nis/nis_xdr.c: Add libnsl_hidden_def for xdr_cback_data. + * include/rpcsvc/nis_callback.h: Add libnsl_hidden_proto for + xdr_cback_data. + + * nis/ypupdate_xdr.c: Add libnsl_hidden_def for xdr_ypupdate_args. + * include/rpcsvc/ypupd.h: Add libnsl_hidden_proto for + xdr_ypupdate_args. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypresp_order. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypresp_order. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypresp_maplist. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypresp_maplist. + + * nis/nis_xdr.c: Add libnsl_hidden_def for xdr_obj_p. + * include/rpcsvc/nis_callback.h: New file. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypresp_val. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypresp_val. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypreq_nokey. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypreq_nokey. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypmaplist. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypmaplist. + + * nis/yp_xdr.c: Add libnsl_hidden_def for xdr_ypreq_nokey. + * include/rpcsvc/yp.h: Add libnsl_hidden_proto for xdr_ypreq_nokey. + + * nis/ypupdate_xdr.c: Add libnsl_hidden_def for xdr_ypdelete_args. + * include/rpcsvc/ypupd.h: Add libnsl_hidden_proto for + xdr_ypdelete_args. + + * nis/nis_xdr.h: Mark all functions as hidden. Remove + __BEGIN_DECLS and __END_DECLS, the header is not installed. + + * nis/nis_error.c: Remove table of strings. Use position + independent mechanism. + * nis/nis_error.h: New file. + +2006-05-11 Jakub Jelinek <jakub@redhat.com> + + * locale/programs/ld-time.c (time_finish): If wide era name or + format aren't provided, set both wname and wformat to L"". + 2006-05-10 Ulrich Drepper <drepper@redhat.com> * sysdeps/unix/sysv/linux/tcgetattr.c (__tcgetattr): Only store diff --git a/fedora/branch.mk b/fedora/branch.mk index 3f536bb857..cec9684bc5 100644 --- a/fedora/branch.mk +++ b/fedora/branch.mk @@ -3,5 +3,5 @@ glibc-branch := fedora glibc-base := HEAD DIST_BRANCH := devel COLLECTION := dist-fc4 -fedora-sync-date := 2006-05-11 13:25 UTC -fedora-sync-tag := fedora-glibc-20060511T1325 +fedora-sync-date := 2006-05-19 15:50 UTC +fedora-sync-tag := fedora-glibc-20060519T1550 diff --git a/fedora/glibc.spec.in b/fedora/glibc.spec.in index bbdbce1284..761bb5b799 100644 --- a/fedora/glibc.spec.in +++ b/fedora/glibc.spec.in @@ -1,4 +1,4 @@ -%define glibcrelease 7 +%define glibcrelease 8 %define auxarches i586 i686 athlon sparcv9 alphaev6 %define prelinkarches noarch %define xenarches i686 athlon @@ -1392,6 +1392,12 @@ rm -f *.filelist* %endif %changelog +* Fri May 19 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-8 +- update from CVS + - fix nss_compat when SETENT_BATCH_READ=TRUE is in /etc/default/nss + - fix RFC3484 precedence table for site-local and ULA addresses (#188364) + - fix a sunrpc memory leak + * Thu May 11 2006 Jakub Jelinek <jakub@redhat.com> 2.4.90-7 - update from CVS - fix tcgetattr (#177965) diff --git a/iconv/gconv_builtin.h b/iconv/gconv_builtin.h index bd34c256dc..ef9ab8d7cf 100644 --- a/iconv/gconv_builtin.h +++ b/iconv/gconv_builtin.h @@ -1,5 +1,5 @@ /* Builtin transformations. - Copyright (C) 1997-1999, 2000-2002 Free Software Foundation, Inc. + Copyright (C) 1997-1999, 2000-2002, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -18,6 +18,9 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +/* All encoding named must be in upper case. There must be no extra + spaces. */ + BUILTIN_ALIAS ("UCS4//", "ISO-10646/UCS4/") BUILTIN_ALIAS ("UCS-4//", "ISO-10646/UCS4/") BUILTIN_ALIAS ("UCS-4BE//", "ISO-10646/UCS4/") diff --git a/iconv/gconv_conf.c b/iconv/gconv_conf.c index ad5a7ee105..22ffa4f41c 100644 --- a/iconv/gconv_conf.c +++ b/iconv/gconv_conf.c @@ -1,5 +1,5 @@ /* Handle configuration data. - Copyright (C) 1997-2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1997-2003, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -78,11 +78,11 @@ static struct gconv_module builtin_modules[] = #undef BUILTIN_ALIAS }; -static const char *const builtin_aliases[] = +static const char builtin_aliases[] = { #define BUILTIN_TRANSFORMATION(From, To, Cost, Name, Fct, BtowcFct, \ MinF, MaxF, MinT, MaxT) -#define BUILTIN_ALIAS(From, To) From " " To, +#define BUILTIN_ALIAS(From, To) From "\0" To "\0" #include "gconv_builtin.h" @@ -124,13 +124,41 @@ detect_conflict (const char *alias) } +/* The actual code to add aliases. */ +static void +add_alias2 (const char *from, const char *to, const char *wp, void *modules) +{ + /* Test whether this alias conflicts with any available module. */ + if (detect_conflict (from)) + /* It does conflict, don't add the alias. */ + return; + + struct gconv_alias *new_alias = (struct gconv_alias *) + malloc (sizeof (struct gconv_alias) + (wp - from)); + if (new_alias != NULL) + { + void **inserted; + + new_alias->fromname = memcpy ((char *) new_alias + + sizeof (struct gconv_alias), + from, wp - from); + new_alias->toname = new_alias->fromname + (to - from); + + inserted = (void **) __tsearch (new_alias, &__gconv_alias_db, + __gconv_alias_compare); + if (inserted == NULL || *inserted != new_alias) + /* Something went wrong, free this entry. */ + free (new_alias); + } +} + + /* Add new alias. */ static void add_alias (char *rp, void *modules) { /* We now expect two more string. The strings are normalized (converted to UPPER case) and strored in the alias database. */ - struct gconv_alias *new_alias; char *from, *to, *wp; while (__isspace_l (*rp, _nl_C_locobj_ptr)) @@ -152,28 +180,7 @@ add_alias (char *rp, void *modules) return; *wp++ = '\0'; - /* Test whether this alias conflicts with any available module. */ - if (detect_conflict (from)) - /* It does conflict, don't add the alias. */ - return; - - new_alias = (struct gconv_alias *) - malloc (sizeof (struct gconv_alias) + (wp - from)); - if (new_alias != NULL) - { - void **inserted; - - new_alias->fromname = memcpy ((char *) new_alias - + sizeof (struct gconv_alias), - from, wp - from); - new_alias->toname = new_alias->fromname + (to - from); - - inserted = (void **) __tsearch (new_alias, &__gconv_alias_db, - __gconv_alias_compare); - if (inserted == NULL || *inserted != new_alias) - /* Something went wrong, free this entry. */ - free (new_alias); - } + add_alias2 (from, to, wp, modules); } @@ -588,12 +595,16 @@ __gconv_read_conf (void) } /* Add aliases for builtin conversions. */ - cnt = sizeof (builtin_aliases) / sizeof (builtin_aliases[0]); - while (cnt > 0) + const char *cp = builtin_aliases; + do { - char *copy = strdupa (builtin_aliases[--cnt]); - add_alias (copy, modules); + const char *from = cp; + const char *to = __rawmemchr (from, '\0') + 1; + cp = __rawmemchr (to, '\0') + 1; + + add_alias2 (from, to, cp, modules); } + while (*cp != '\0'); /* Restore the error number. */ __set_errno (save_errno); diff --git a/iconv/gconv_int.h b/iconv/gconv_int.h index ace2bae1c6..8d9cdaefc2 100644 --- a/iconv/gconv_int.h +++ b/iconv/gconv_int.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997-2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997-2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -128,7 +128,7 @@ extern struct gconv_module *__gconv_modules_db attribute_hidden; extern const char *__gconv_path_envvar attribute_hidden; /* Lock for the conversion database content. */ -__libc_lock_define (extern, __gconv_lock); +__libc_lock_define (extern, __gconv_lock attribute_hidden) /* The gconv functions expects the name to be in upper case and complete, diff --git a/include/arpa/nameser.h b/include/arpa/nameser.h index 449f5b452e..efbe956602 100644 --- a/include/arpa/nameser.h +++ b/include/arpa/nameser.h @@ -7,6 +7,8 @@ #include <stdint.h> #include <netinet/in.h> +extern struct _ns_flagdata _ns_flagdata[] attribute_hidden; + #if _STRING_ARCH_unaligned # undef NS_GET16 diff --git a/include/rpc/auth.h b/include/rpc/auth.h index a5e290b898..bc433b5930 100644 --- a/include/rpc/auth.h +++ b/include/rpc/auth.h @@ -22,8 +22,10 @@ DECLARE_NSS_PROTOTYPES (nisplus) #undef DECLARE_NSS_PROTOTYPES -extern bool_t xdr_des_block_internal (XDR *__xdrs, des_block *__blkp); -extern bool_t xdr_opaque_auth_internal (XDR *, struct opaque_auth *); +extern bool_t xdr_des_block_internal (XDR *__xdrs, des_block *__blkp) + attribute_hidden; +extern bool_t xdr_opaque_auth_internal (XDR *, struct opaque_auth *) + attribute_hidden; extern AUTH *authunix_create_internal (char *__machname, __uid_t __uid, __gid_t __gid, int __len, diff --git a/include/rpc/key_prot.h b/include/rpc/key_prot.h index ee30c65d3b..2da5de7f70 100644 --- a/include/rpc/key_prot.h +++ b/include/rpc/key_prot.h @@ -1,11 +1,15 @@ #include <sunrpc/rpc/key_prot.h> -extern bool_t xdr_cryptkeyres_internal (XDR *xdrs, cryptkeyres *objp); -extern bool_t xdr_keystatus_internal (XDR *, keystatus*); -extern bool_t xdr_keybuf_internal (XDR *, keybuf); -extern bool_t xdr_cryptkeyarg_internal (XDR *, cryptkeyarg*); -extern bool_t xdr_cryptkeyarg2_internal (XDR *, cryptkeyarg2*); -extern bool_t xdr_key_netstres_internal (XDR *, key_netstres*); -extern bool_t xdr_key_netstarg_internal (XDR *, key_netstarg*); -extern bool_t xdr_netnamestr_internal (XDR *, netnamestr*); -extern bool_t xdr_unixcred_internal (XDR *, unixcred*); +extern bool_t xdr_cryptkeyres_internal (XDR *xdrs, cryptkeyres *objp) + attribute_hidden; +extern bool_t xdr_keystatus_internal (XDR *, keystatus*) attribute_hidden; +extern bool_t xdr_keybuf_internal (XDR *, keybuf) attribute_hidden; +extern bool_t xdr_cryptkeyarg_internal (XDR *, cryptkeyarg*) attribute_hidden; +extern bool_t xdr_cryptkeyarg2_internal (XDR *, cryptkeyarg2*) + attribute_hidden; +extern bool_t xdr_key_netstres_internal (XDR *, key_netstres*) + attribute_hidden; +extern bool_t xdr_key_netstarg_internal (XDR *, key_netstarg*) + attribute_hidden; +extern bool_t xdr_netnamestr_internal (XDR *, netnamestr*) attribute_hidden; +extern bool_t xdr_unixcred_internal (XDR *, unixcred*) attribute_hidden; diff --git a/include/rpc/pmap_prot.h b/include/rpc/pmap_prot.h index e50d5e0c79..902faba019 100644 --- a/include/rpc/pmap_prot.h +++ b/include/rpc/pmap_prot.h @@ -1,5 +1,7 @@ #include <sunrpc/rpc/pmap_prot.h> -extern bool_t xdr_pmap_internal (XDR *__xdrs, struct pmap *__regs); -extern bool_t xdr_pmaplist_internal (XDR *__xdrs, struct pmaplist **__rp); +extern bool_t xdr_pmap_internal (XDR *__xdrs, struct pmap *__regs) + attribute_hidden; +extern bool_t xdr_pmaplist_internal (XDR *__xdrs, struct pmaplist **__rp) + attribute_hidden; diff --git a/include/rpc/pmap_rmt.h b/include/rpc/pmap_rmt.h index f8e586c27e..63e41cab28 100644 --- a/include/rpc/pmap_rmt.h +++ b/include/rpc/pmap_rmt.h @@ -1,5 +1,7 @@ #include <sunrpc/rpc/pmap_rmt.h> extern bool_t xdr_rmtcall_args_internal (XDR *__xdrs, - struct rmtcallargs *__crp); -extern bool_t xdr_rmtcallres_internal (XDR *__xdrs, struct rmtcallres *__crp); + struct rmtcallargs *__crp) + attribute_hidden; +extern bool_t xdr_rmtcallres_internal (XDR *__xdrs, struct rmtcallres *__crp) + attribute_hidden; diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h index ab43f83dcb..e10d53e3b1 100644 --- a/include/rpc/xdr.h +++ b/include/rpc/xdr.h @@ -1,36 +1,54 @@ #include <sunrpc/rpc/xdr.h> -extern bool_t xdr_void_internal (void); -extern bool_t xdr_bool_internal (XDR *__xdrs, bool_t *__bp); -extern bool_t xdr_u_hyper_internal (XDR *__xdrs, u_quad_t *__ullp); -extern bool_t xdr_u_long_internal (XDR *__xdrs, u_long *__ulp); -extern bool_t xdr_u_int_internal (XDR *__xdrs, u_int *__up); -extern bool_t xdr_u_short_internal (XDR *__xdrs, u_short *__usp); -extern bool_t xdr_hyper_internal (XDR *__xdrs, quad_t *__ullp); -extern bool_t xdr_long_internal (XDR *__xdrs, long *__ulp); -extern bool_t xdr_int_internal (XDR *__xdrs, int *__up); -extern bool_t xdr_short_internal (XDR *__xdrs, short *__usp); -extern bool_t xdr_enum_internal (XDR *__xdrs, enum_t *__ep); +extern bool_t xdr_void_internal (void) attribute_hidden; +extern bool_t xdr_bool_internal (XDR *__xdrs, bool_t *__bp) attribute_hidden; +extern bool_t xdr_u_hyper_internal (XDR *__xdrs, u_quad_t *__ullp) + attribute_hidden; +extern bool_t xdr_u_long_internal (XDR *__xdrs, u_long *__ulp) + attribute_hidden; +extern bool_t xdr_u_int_internal (XDR *__xdrs, u_int *__up) + attribute_hidden; +extern bool_t xdr_u_short_internal (XDR *__xdrs, u_short *__usp) + attribute_hidden; +extern bool_t xdr_hyper_internal (XDR *__xdrs, quad_t *__ullp) + attribute_hidden; +extern bool_t xdr_long_internal (XDR *__xdrs, long *__ulp) + attribute_hidden; +extern bool_t xdr_int_internal (XDR *__xdrs, int *__up) + attribute_hidden; +extern bool_t xdr_short_internal (XDR *__xdrs, short *__usp) + attribute_hidden; +extern bool_t xdr_enum_internal (XDR *__xdrs, enum_t *__ep) + attribute_hidden; extern bool_t xdr_union_internal (XDR *__xdrs, enum_t *__dscmp, char *__unp, const struct xdr_discrim *choices, - xdrproc_t dfault); + xdrproc_t dfault) attribute_hidden; extern bool_t xdr_string_internal (XDR *__xdrs, char **__cpp, u_int __maxsize); extern bool_t xdr_array_internal (XDR * _xdrs, caddr_t *__addrp, u_int *__sizep, u_int __maxsize, - u_int __elsize, xdrproc_t __elproc); + u_int __elsize, xdrproc_t __elproc) + attribute_hidden; extern bool_t xdr_reference_internal (XDR *__xdrs, caddr_t *__xpp, - u_int __size, xdrproc_t __proc); + u_int __size, xdrproc_t __proc) + attribute_hidden; extern bool_t xdr_bytes_internal (XDR *xdrs, char **cpp, u_int *sizep, - u_int maxsize); -extern bool_t xdr_netobj_internal (XDR *__xdrs, struct netobj *__np); -extern bool_t xdr_opaque_internal (XDR *__xdrs, caddr_t __cp, u_int __cnt); + u_int maxsize) attribute_hidden; +extern bool_t xdr_netobj_internal (XDR *__xdrs, struct netobj *__np) + attribute_hidden; +extern bool_t xdr_opaque_internal (XDR *__xdrs, caddr_t __cp, u_int __cnt) + attribute_hidden; extern void xdrrec_create_internal (XDR *__xdrs, u_int __sendsize, u_int __recvsize, caddr_t __tcp_handle, int (*__readit) (char *, char *, int), - int (*__writeit) (char *, char *, int)); -extern void xdrmem_create_internal (XDR *, const caddr_t, u_int, enum xdr_op); -extern bool_t xdrrec_endofrecord_internal (XDR *__xdrs, bool_t __sendnow); -extern bool_t xdrrec_skiprecord_internal (XDR *__xdrs); -extern bool_t xdrrec_eof_internal (XDR *__xdrs); + int (*__writeit) (char *, char *, int)) + attribute_hidden; +extern void xdrmem_create_internal (XDR *, const caddr_t, u_int, enum xdr_op) + attribute_hidden; +extern bool_t xdrrec_endofrecord_internal (XDR *__xdrs, bool_t __sendnow) + attribute_hidden; +extern bool_t xdrrec_skiprecord_internal (XDR *__xdrs) + attribute_hidden; +extern bool_t xdrrec_eof_internal (XDR *__xdrs) + attribute_hidden; libc_hidden_proto (xdrstdio_create) diff --git a/include/rpcsvc/nis_callback.h b/include/rpcsvc/nis_callback.h new file mode 100644 index 0000000000..dfa9cd3ef7 --- /dev/null +++ b/include/rpcsvc/nis_callback.h @@ -0,0 +1,7 @@ +#ifndef _RPCSVC_NIS_CALLBACK_H +#include <nis/rpcsvc/nis_callback.h> + +libnsl_hidden_proto (xdr_obj_p) +libnsl_hidden_proto (xdr_cback_data) + +#endif diff --git a/include/rpcsvc/yp.h b/include/rpcsvc/yp.h index cc4e00fd0b..04a973eae7 100644 --- a/include/rpcsvc/yp.h +++ b/include/rpcsvc/yp.h @@ -14,5 +14,13 @@ libnsl_hidden_proto (xdr_ypresp_all) libnsl_hidden_proto (xdr_yppush_status) libnsl_hidden_proto (xdr_ypbind_resptype) libnsl_hidden_proto (xdr_ypbind_binding) +libnsl_hidden_proto (xdr_ypreq_nokey) +libnsl_hidden_proto (xdr_ypmaplist) +libnsl_hidden_proto (xdr_ypreq_key) +libnsl_hidden_proto (xdr_ypresp_val) +libnsl_hidden_proto (xdr_ypresp_maplist) +libnsl_hidden_proto (xdr_ypresp_order) +libnsl_hidden_proto (xdr_ypbind_resp) +libnsl_hidden_proto (xdr_ypresp_master) #endif diff --git a/include/rpcsvc/ypupd.h b/include/rpcsvc/ypupd.h index 68116e629f..7601971512 100644 --- a/include/rpcsvc/ypupd.h +++ b/include/rpcsvc/ypupd.h @@ -2,5 +2,7 @@ #include <nis/rpcsvc/ypupd.h> libnsl_hidden_proto (xdr_yp_buf) +libnsl_hidden_proto (xdr_ypdelete_args) +libnsl_hidden_proto (xdr_ypupdate_args) #endif diff --git a/intl/dcigettext.c b/intl/dcigettext.c index f294dedf2f..b56196ccbe 100644 --- a/intl/dcigettext.c +++ b/intl/dcigettext.c @@ -1,5 +1,5 @@ /* Implementation of the internal dcigettext function. - Copyright (C) 1995-2002,2003,2004,2005 Free Software Foundation, Inc. + Copyright (C) 1995-2005, 2006 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 @@ -286,7 +286,8 @@ static const char *guess_category_value PARAMS ((int category, internal_function; #ifdef _LIBC # include "../locale/localeinfo.h" -# define category_to_name(category) _nl_category_names[category] +# define category_to_name(category) \ + _nl_category_names.str + _nl_category_name_idxs[category] #else static const char *category_to_name PARAMS ((int category)) internal_function; #endif diff --git a/locale/findlocale.c b/locale/findlocale.c index 04b197d266..ea24170df5 100644 --- a/locale/findlocale.c +++ b/locale/findlocale.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-2001, 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 1996-2001, 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -80,7 +80,8 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, variables. */ *name = getenv ("LC_ALL"); if (*name == NULL || (*name)[0] == '\0') - *name = getenv (_nl_category_names[category]); + *name = getenv (_nl_category_names.str + + _nl_category_name_idxs[category]); if (*name == NULL || (*name)[0] == '\0') *name = getenv ("LANG"); } @@ -145,7 +146,8 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, locale_path, locale_path_len, mask, language, territory, codeset, normalized_codeset, modifier, - _nl_category_names[category], 0); + _nl_category_names.str + + _nl_category_name_idxs[category], 0); if (locale_file == NULL) { @@ -155,7 +157,8 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len, locale_path, locale_path_len, mask, language, territory, codeset, normalized_codeset, modifier, - _nl_category_names[category], 1); + _nl_category_names.str + + _nl_category_name_idxs[category], 1); if (locale_file == NULL) /* This means we are out of core. */ return NULL; diff --git a/locale/loadlocale.c b/locale/loadlocale.c index 2a5935087c..467dff157a 100644 --- a/locale/loadlocale.c +++ b/locale/loadlocale.c @@ -1,5 +1,5 @@ /* Functions to read locale data files. - Copyright (C) 1996-2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1996-2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -198,7 +198,7 @@ _nl_load_locale (struct loaded_l10nfile *file, int category) + 5 + _nl_category_name_sizes[category] + 1); __mempcpy (__mempcpy (__mempcpy (newp, file->filename, filenamelen), "/SYS_", 5), - _nl_category_names[category], + _nl_category_names.str + _nl_category_name_idxs[category], _nl_category_name_sizes[category] + 1); fd = open_not_cancel_2 (newp, O_RDONLY); diff --git a/locale/localeinfo.h b/locale/localeinfo.h index 3b0ed4f30b..4f746a298d 100644 --- a/locale/localeinfo.h +++ b/locale/localeinfo.h @@ -1,5 +1,5 @@ /* Declarations for internal libc locale interfaces - Copyright (C) 1995-2001, 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 1995-2003, 2005, 2006 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 @@ -172,8 +172,22 @@ enum #define _ISCTYPE(c, desc) \ (((((const uint32_t *) (desc)) - 8)[(c) >> 5] >> ((c) & 0x1f)) & 1) -extern const char *const _nl_category_names[__LC_LAST] attribute_hidden; -extern const size_t _nl_category_name_sizes[__LC_LAST] attribute_hidden; +/* Category name handling variables. */ +#define CATNAMEMF(line) CATNAMEMF1 (line) +#define CATNAMEMF1(line) str##line +extern const union catnamestr_t +{ + struct + { +#define DEFINE_CATEGORY(category, category_name, items, a) \ + char CATNAMEMF (__LINE__)[sizeof (category_name)]; +#include "categories.def" +#undef DEFINE_CATEGORY + }; + char str[0]; +} _nl_category_names attribute_hidden; +const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden; +extern const uint8_t _nl_category_name_sizes[__LC_LAST] attribute_hidden; /* Name of the standard locales. */ extern const char _nl_C_name[] attribute_hidden; diff --git a/locale/newlocale.c b/locale/newlocale.c index b3d4b464b1..0c31ba48ae 100644 --- a/locale/newlocale.c +++ b/locale/newlocale.c @@ -1,5 +1,5 @@ /* Return a reference to locale information record. - Copyright (C) 1996, 1997, 1999, 2000, 2001, 2002, 2004, 2005 + Copyright (C) 1996, 1997, 1999, 2000-2002, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. @@ -133,7 +133,8 @@ __newlocale (int category_mask, const char *locale, __locale_t base) for (cnt = 0; cnt < __LC_LAST; ++cnt) if (cnt != LC_ALL && (size_t) (cp - np) == _nl_category_name_sizes[cnt] - && memcmp (np, _nl_category_names[cnt], cp - np) == 0) + && memcmp (np, (_nl_category_names.str + + _nl_category_name_idxs[cnt]), cp - np) == 0) break; if (cnt == __LC_LAST) diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c index 78aff7fee6..4f1dcb0ce7 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c @@ -467,15 +467,22 @@ No definition for %s category found"), "LC_TIME")); wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end offset */ wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end start */ wstr = wstr ? wcschr (wstr + 1, L':') : NULL; /* end end */ - time->era_entries[idx].wname = (uint32_t *) wstr + 1; if (wstr != NULL) { + time->era_entries[idx].wname = (uint32_t *) wstr + 1; wstr = wcschr (wstr + 1, L':'); /* end name */ - *wstr = L'\0'; - time->era_entries[idx].wformat = (uint32_t *) wstr + 1; + if (wstr != NULL) + { + *wstr = L'\0'; + time->era_entries[idx].wformat = (uint32_t *) wstr + 1; + } + else + time->era_entries[idx].wname = + time->era_entries[idx].wformat = (uint32_t *) L""; } else - time->era_entries[idx].wformat = NULL; + time->era_entries[idx].wname = + time->era_entries[idx].wformat = (uint32_t *) L""; } } diff --git a/locale/setlocale.c b/locale/setlocale.c index 50bf8e772f..c1b8c3faec 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995-2000, 2002, 2003, 2004 +/* Copyright (C) 1991, 1992, 1995-2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -66,18 +66,27 @@ static char *const _nl_current_used[] = #endif -/* Define an array of category names (also the environment variable names), - indexed by integral category. */ -const char *const _nl_category_names[] = +/* Define an array of category names (also the environment variable names). */ +const union catnamestr_t _nl_category_names attribute_hidden = { + { #define DEFINE_CATEGORY(category, category_name, items, a) \ - [category] = category_name, + category_name, #include "categories.def" -#undef DEFINE_CATEGORY - [LC_ALL] = "LC_ALL" +#undef DEFINE_CATEGORY + } }; + +const uint8_t _nl_category_name_idxs[__LC_LAST] attribute_hidden = + { +#define DEFINE_CATEGORY(category, category_name, items, a) \ + [category] = offsetof (union catnamestr_t, CATNAMEMF (__LINE__)), +#include "categories.def" +#undef DEFINE_CATEGORY + }; + /* An array of their lengths, for convenience. */ -const size_t _nl_category_name_sizes[] = +const uint8_t _nl_category_name_sizes[] attribute_hidden = { #define DEFINE_CATEGORY(category, category_name, items, a) \ [category] = sizeof (category_name) - 1, @@ -173,7 +182,7 @@ new_composite_name (int category, const char *newnames[__LC_LAST]) const char *name = (category == LC_ALL ? newnames[i] : category == i ? newnames[0] : _nl_global_locale.__names[i]); - p = __stpcpy (p, _nl_category_names[i]); + p = __stpcpy (p, _nl_category_names.str + _nl_category_name_idxs[i]); *p++ = '='; p = __stpcpy (p, name); *p++ = ';'; @@ -275,7 +284,9 @@ setlocale (int category, const char *locale) for (cnt = 0; cnt < __LC_LAST; ++cnt) if (cnt != LC_ALL && (size_t) (cp - np) == _nl_category_name_sizes[cnt] - && memcmp (np, _nl_category_names[cnt], cp - np) == 0) + && (memcmp (np, (_nl_category_names.str + + _nl_category_name_idxs[cnt]), cp - np) + == 0)) break; if (cnt == __LC_LAST) diff --git a/math/complex.h b/math/complex.h index 229bb7dca6..751aaf763f 100644 --- a/math/complex.h +++ b/math/complex.h @@ -89,7 +89,7 @@ __BEGIN_DECLS # ifdef __LDBL_COMPAT # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ - extern type __REDIRECT(__MATH_PRECNAME(function), args, function) __THROW + extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) # endif # ifndef _Mlong_double_ diff --git a/misc/getusershell.c b/misc/getusershell.c index f41c6fa5f0..255b579b1a 100644 --- a/misc/getusershell.c +++ b/misc/getusershell.c @@ -46,7 +46,15 @@ static char sccsid[] = "@(#)getusershell.c 8.1 (Berkeley) 6/4/93"; * /etc/shells. */ +/* NB: we do not initialize okshells here. The initialization needs + relocations. These interfaces are used so rarely that this is not + justified. Instead explicitly initialize the array when it is + used. */ +#if 0 static const char *const okshells[] = { _PATH_BSHELL, _PATH_CSHELL, NULL }; +#else +static const char *okshells[3]; +#endif static char **curshell, **shells, *strings; static char **initshells (void) __THROW; @@ -97,21 +105,22 @@ initshells() free(strings); strings = NULL; if ((fp = fopen(_PATH_SHELLS, "rc")) == NULL) - return (char **) okshells; + goto init_okshells_noclose; if (fstat64(fileno(fp), &statb) == -1) { + init_okshells: (void)fclose(fp); + init_okshells_noclose: + okshells[0] = _PATH_BSHELL; + okshells[1] = _PATH_CSHELL; return (char **) okshells; } - if ((strings = malloc((u_int)statb.st_size + 1)) == NULL) { - (void)fclose(fp); - return (char **) okshells; - } + if ((strings = malloc((u_int)statb.st_size + 1)) == NULL) + goto init_okshells; shells = calloc((unsigned)statb.st_size / 3, sizeof (char *)); if (shells == NULL) { - (void)fclose(fp); free(strings); strings = NULL; - return (char **) okshells; + goto init_okshells; } sp = shells; cp = strings; diff --git a/nis/nis_call.c b/nis/nis_call.c index 32d29ae99f..753ef77997 100644 --- a/nis/nis_call.c +++ b/nis/nis_call.c @@ -368,6 +368,12 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status) domain ! (Now I understand why a root server must be a replica of the parent domain) */ fd_res = __nis_finddirectory (dir, ndomain); + if (fd_res == NULL) + { + nis_free_directory (dir); + *status = NIS_NOMEMORY; + return NULL; + } *status = fd_res->status; if (fd_res->status != NIS_SUCCESS) { @@ -375,27 +381,25 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status) __free_fdresult (fd_res); return dir; } + nis_free_directory (dir); obj = calloc (1, sizeof (directory_obj)); + if (obj == NULL) + { + __free_fdresult (fd_res); + *status = NIS_NOMEMORY; + return NULL; + } xdrmem_create (&xdrs, fd_res->dir_data.dir_data_val, fd_res->dir_data.dir_data_len, XDR_DECODE); _xdr_directory_obj (&xdrs, obj); xdr_destroy (&xdrs); __free_fdresult (fd_res); - if (obj != NULL) - { - /* We have found a NIS+ server serving ndomain, now - let us search for "name" */ - nis_free_directory (dir); - return rec_dirsearch (name, obj, status); - } - else - { - /* Ups, very bad. Are we already the root server ? */ - nis_free_directory (dir); - return NULL; - } + + /* We have found a NIS+ server serving ndomain, now + let us search for "name" */ + return rec_dirsearch (name, obj, status); } - break; + break; case LOWER_NAME: { directory_obj *obj; @@ -433,6 +437,12 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status) strcpy (cp, domain); fd_res = __nis_finddirectory (dir, leaf); + if (fd_res == NULL) + { + nis_free_directory (dir); + *status = NIS_NOMEMORY; + return NULL; + } *status = fd_res->status; if (fd_res->status != NIS_SUCCESS) { @@ -440,21 +450,24 @@ rec_dirsearch (const_nis_name name, directory_obj *dir, nis_error *status) __free_fdresult (fd_res); return dir; } - obj = calloc(1, sizeof(directory_obj)); - xdrmem_create(&xdrs, fd_res->dir_data.dir_data_val, - fd_res->dir_data.dir_data_len, XDR_DECODE); - _xdr_directory_obj(&xdrs, obj); - xdr_destroy(&xdrs); - __free_fdresult (fd_res); - if (obj != NULL) + nis_free_directory (dir); + obj = calloc (1, sizeof(directory_obj)); + if (obj == NULL) { - /* We have found a NIS+ server serving ndomain, now - let us search for "name" */ - nis_free_directory (dir); - return rec_dirsearch (name, obj, status); + __free_fdresult (fd_res); + *status = NIS_NOMEMORY; + return NULL; } + xdrmem_create (&xdrs, fd_res->dir_data.dir_data_val, + fd_res->dir_data.dir_data_len, XDR_DECODE); + _xdr_directory_obj (&xdrs, obj); + xdr_destroy (&xdrs); + __free_fdresult (fd_res); + /* We have found a NIS+ server serving ndomain, now + let us search for "name" */ + return rec_dirsearch (name, obj, status); } - break; + break; case BAD_NAME: nis_free_directory (dir); *status = NIS_BADNAME; @@ -484,6 +497,8 @@ first_shoot (const_nis_name name, directory_obj *dir) return dir; fd_res = __nis_finddirectory (dir, domain); + if (fd_res == NULL) + return NULL; if (fd_res->status == NIS_SUCCESS && (obj = calloc (1, sizeof (directory_obj))) != NULL) { @@ -513,28 +528,30 @@ __nisfind_server (const_nis_name name, directory_obj **dir) dir = __nis_cache_search (name, flags, &cinfo); #endif + nis_error result = NIS_SUCCESS; if (*dir == NULL) { nis_error status; directory_obj *obj; *dir = readColdStartFile (); - if (*dir == NULL) /* No /var/nis/NIS_COLD_START->no NIS+ installed */ + if (*dir == NULL) + /* No /var/nis/NIS_COLD_START->no NIS+ installed. */ return NIS_UNAVAIL; /* Try at first, if servers in "dir" know our object */ obj = first_shoot (name, *dir); if (obj == NULL) { - *dir = rec_dirsearch (name, *dir, &status); - if (*dir == NULL) - return status; + obj = rec_dirsearch (name, *dir, &status); + if (obj == NULL) + result = status; } - else - *dir = obj; + + *dir = obj; } - return NIS_SUCCESS; + return result; } nis_error diff --git a/nis/nis_callback.c b/nis/nis_callback.c index 7d1b9f8e53..6582315c70 100644 --- a/nis/nis_callback.c +++ b/nis/nis_callback.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998, 1999, 2000, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997,1998,1999,2000,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997. @@ -275,15 +275,14 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *, int sock = RPC_ANYSOCK; struct sockaddr_in sin; socklen_t len = sizeof (struct sockaddr_in); - char addr[NIS_MAXNAMELEN + 1]; unsigned short port; + int nomsg = 0; - cb = (struct nis_cb *) calloc (1, sizeof (struct nis_cb)); + cb = (struct nis_cb *) calloc (1, + sizeof (struct nis_cb) + sizeof (nis_server)); if (__builtin_expect (cb == NULL, 0)) goto failed; - cb->serv = (nis_server *) calloc (1, sizeof (nis_server)); - if (__builtin_expect (cb->serv == NULL, 0)) - goto failed; + cb->serv = (nis_server *) (cb + 1); cb->serv->name = strdup (nis_local_principal ()); if (__builtin_expect (cb->serv->name == NULL, 0)) goto failed; @@ -326,15 +325,20 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *, cb->serv->ep.ep_val[0].proto = strdup ((flags & USE_DGRAM) ? "udp" : "tcp"); if (__builtin_expect (cb->serv->ep.ep_val[0].proto == NULL, 0)) goto failed; - cb->xprt = (flags & USE_DGRAM) ? svcudp_bufcreate (sock, 100, 8192) : - svctcp_create (sock, 100, 8192); + cb->xprt = ((flags & USE_DGRAM) + ? svcudp_bufcreate (sock, 100, 8192) + : svctcp_create (sock, 100, 8192)); + if (cb->xprt == NULL) + { + nomsg = 1; + goto failed; + } cb->sock = cb->xprt->xp_sock; if (!svc_register (cb->xprt, CB_PROG, CB_VERS, cb_prog_1, 0)) { xprt_unregister (cb->xprt); svc_destroy (cb->xprt); xdr_free ((xdrproc_t) _xdr_nis_server, (char *) cb->serv); - free (cb->serv); free (cb); syslog (LOG_ERR, "NIS+: failed to register callback dispatcher"); return NULL; @@ -345,30 +349,31 @@ __nis_create_callback (int (*callback) (const_nis_name, const nis_object *, xprt_unregister (cb->xprt); svc_destroy (cb->xprt); xdr_free ((xdrproc_t) _xdr_nis_server, (char *) cb->serv); - free (cb->serv); free (cb); syslog (LOG_ERR, "NIS+: failed to read local socket info"); return NULL; } port = ntohs (sin.sin_port); get_myaddress (&sin); - snprintf (addr, sizeof (addr), "%s.%d.%d", inet_ntoa (sin.sin_addr), - (port & 0xFF00) >> 8, port & 0x00FF); - cb->serv->ep.ep_val[0].uaddr = strdup (addr); + + if (asprintf (&cb->serv->ep.ep_val[0].uaddr, "%s.%d.%d", + inet_ntoa (sin.sin_addr), (port & 0xFF00) >> 8, port & 0x00FF) + < 0) + goto failed; return cb; failed: if (cb) { + if (cb->xprt) + svc_destroy (cb->xprt); if (cb->serv) - { - xdr_free ((xdrproc_t) _xdr_nis_server, (char *) cb->serv); - free (cb->serv); - } + xdr_free ((xdrproc_t) _xdr_nis_server, (char *) cb->serv); free (cb); } - syslog (LOG_ERR, "NIS+: out of memory allocating callback"); + if (!nomsg) + syslog (LOG_ERR, "NIS+: out of memory allocating callback"); return NULL; } @@ -379,7 +384,6 @@ __nis_destroy_callback (struct nis_cb *cb) svc_destroy (cb->xprt); close (cb->sock); xdr_free ((xdrproc_t) _xdr_nis_server, (char *) cb->serv); - free (cb->serv); free (cb); return NIS_SUCCESS; diff --git a/nis/nis_error.c b/nis/nis_error.c index 7db885ef93..d92ad03604 100644 --- a/nis/nis_error.c +++ b/nis/nis_error.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 1998, 1999, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (c) 1997,1998,1999,2004,2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. @@ -24,65 +24,41 @@ #include <rpcsvc/nis.h> -static const char *nis_errlist[] = +#define MF(line) MF1 (line) +#define MF1(line) str##line +static const union msgstr_t { - N_("Success"), - N_("Probable success"), - N_("Not found"), - N_("Probably not found"), - N_("Cache expired"), - N_("NIS+ servers unreachable"), - N_("Unknown object"), - N_("Server busy, try again"), - N_("Generic system error"), - N_("First/next chain broken"), - N_("Permission denied"), - N_("Not owner"), - N_("Name not served by this server"), - N_("Server out of memory"), - N_("Object with same name exists"), - N_("Not master server for this domain"), - N_("Invalid object for operation"), - N_("Malformed name, or illegal name"), - N_("Unable to create callback"), - N_("Results sent to callback proc"), - N_("Not found, no such name"), - N_("Name/entry isn't unique"), - N_("Modification failed"), - N_("Database for table does not exist"), - N_("Entry/table type mismatch"), - N_("Link points to illegal name"), - N_("Partial success"), - N_("Too many attributes"), - N_("Error in RPC subsystem"), - N_("Missing or malformed attribute"), - N_("Named object is not searchable"), - N_("Error while talking to callback proc"), - N_("Non NIS+ namespace encountered"), - N_("Illegal object type for operation"), - N_("Passed object is not the same object on server"), - N_("Modify operation failed"), - N_("Query illegal for named table"), - N_("Attempt to remove a non-empty table"), - N_("Error in accessing NIS+ cold start file. Is NIS+ installed?"), - N_("Full resync required for directory"), - N_("NIS+ operation failed"), - N_("NIS+ service is unavailable or not installed"), - N_("Yes, 42 is the meaning of life"), - N_("Unable to authenticate NIS+ server"), - N_("Unable to authenticate NIS+ client"), - N_("No file space on server"), - N_("Unable to create process on server"), - N_("Master server busy, full dump rescheduled.") -}; + struct + { +#define S(s) char MF(__LINE__)[sizeof (s)]; +#include "nis_error.h" +#undef S + }; + char str[0]; +} msgstr = + { + { +#define S(s) s, +#include "nis_error.h" +#undef S + } + }; + +static const unsigned short int msgidx[] = + { +#define S(s) offsetof (union msgstr_t, MF (__LINE__)), +#include "nis_error.h" +#undef S + }; + const char * nis_sperrno (const nis_error status) { - if (status >= (sizeof (nis_errlist) / sizeof (nis_errlist[0]))) + if (status >= sizeof (msgidx) / sizeof (msgidx[0])) return "???"; else - return gettext (nis_errlist[status]); + return gettext (msgstr.str + msgidx[status]); } libnsl_hidden_def (nis_sperrno) @@ -105,7 +81,7 @@ nis_sperror_r (const nis_error status, const char *label, if (snprintf (buffer, buflen, "%s: %s", label, nis_sperrno (status)) >= buflen) { - errno = ERANGE; + __set_errno (ERANGE); return NULL; } diff --git a/nis/nis_error.h b/nis/nis_error.h new file mode 100644 index 0000000000..add1316d9f --- /dev/null +++ b/nis/nis_error.h @@ -0,0 +1,48 @@ +S(N_("Success")) +S(N_("Probable success")) +S(N_("Not found")) +S(N_("Probably not found")) +S(N_("Cache expired")) +S(N_("NIS+ servers unreachable")) +S(N_("Unknown object")) +S(N_("Server busy, try again")) +S(N_("Generic system error")) +S(N_("First/next chain broken")) +S(N_("Permission denied")) +S(N_("Not owner")) +S(N_("Name not served by this server")) +S(N_("Server out of memory")) +S(N_("Object with same name exists")) +S(N_("Not master server for this domain")) +S(N_("Invalid object for operation")) +S(N_("Malformed name, or illegal name")) +S(N_("Unable to create callback")) +S(N_("Results sent to callback proc")) +S(N_("Not found, no such name")) +S(N_("Name/entry isn't unique")) +S(N_("Modification failed")) +S(N_("Database for table does not exist")) +S(N_("Entry/table type mismatch")) +S(N_("Link points to illegal name")) +S(N_("Partial success")) +S(N_("Too many attributes")) +S(N_("Error in RPC subsystem")) +S(N_("Missing or malformed attribute")) +S(N_("Named object is not searchable")) +S(N_("Error while talking to callback proc")) +S(N_("Non NIS+ namespace encountered")) +S(N_("Illegal object type for operation")) +S(N_("Passed object is not the same object on server")) +S(N_("Modify operation failed")) +S(N_("Query illegal for named table")) +S(N_("Attempt to remove a non-empty table")) +S(N_("Error in accessing NIS+ cold start file. Is NIS+ installed?")) +S(N_("Full resync required for directory")) +S(N_("NIS+ operation failed")) +S(N_("NIS+ service is unavailable or not installed")) +S(N_("Yes, 42 is the meaning of life")) +S(N_("Unable to authenticate NIS+ server")) +S(N_("Unable to authenticate NIS+ client")) +S(N_("No file space on server")) +S(N_("Unable to create process on server")) +S(N_("Master server busy, full dump rescheduled.")) diff --git a/nis/nis_xdr.c b/nis/nis_xdr.c index 1ef08c7890..3d4f7268c0 100644 --- a/nis/nis_xdr.c +++ b/nis/nis_xdr.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1997, 1998, 2005 Free Software Foundation, Inc. +/* Copyright (c) 1997, 1998, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1997. @@ -433,6 +433,7 @@ xdr_obj_p (XDR *xdrs, obj_p *objp) return xdr_pointer (xdrs, (char **)objp, sizeof (nis_object), (xdrproc_t)_xdr_nis_object); } +libnsl_hidden_def (xdr_obj_p) bool_t xdr_cback_data (XDR *xdrs, cback_data *objp) @@ -441,3 +442,4 @@ xdr_cback_data (XDR *xdrs, cback_data *objp) &objp->entries.entries_len, ~0, sizeof (obj_p), (xdrproc_t) xdr_obj_p); } +libnsl_hidden_def (xdr_cback_data) diff --git a/nis/nis_xdr.h b/nis/nis_xdr.h index 2f1a179e0a..791a964d2f 100644 --- a/nis/nis_xdr.h +++ b/nis/nis_xdr.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1998, 1999 Free Software Foundation, Inc. +/* Copyright (c) 1998, 1999, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. @@ -22,24 +22,20 @@ #include <features.h> -__BEGIN_DECLS - -extern bool_t _xdr_nis_attr (XDR *, nis_attr*); -extern bool_t _xdr_nis_name (XDR *, nis_name*); -extern bool_t _xdr_nis_server (XDR *, nis_server*); -extern bool_t _xdr_directory_obj (XDR *, directory_obj*); -extern bool_t _xdr_nis_object (XDR *, nis_object*); -extern bool_t _xdr_nis_error (XDR *, nis_error*); -extern bool_t _xdr_nis_result (XDR *, nis_result*); -extern bool_t _xdr_ns_request (XDR *, ns_request*); -extern bool_t _xdr_ib_request (XDR *, ib_request*); -extern bool_t _xdr_ping_args (XDR *, ping_args*); -extern bool_t _xdr_cp_result (XDR *, cp_result*); -extern bool_t _xdr_nis_tag (XDR *, nis_tag*); -extern bool_t _xdr_nis_taglist (XDR *, nis_taglist*); -extern bool_t _xdr_fd_args (XDR *, fd_args*); -extern bool_t _xdr_fd_result (XDR *, fd_result*); - -__END_DECLS +extern bool_t _xdr_nis_attr (XDR *, nis_attr*) attribute_hidden; +extern bool_t _xdr_nis_name (XDR *, nis_name*) attribute_hidden; +extern bool_t _xdr_nis_server (XDR *, nis_server*) attribute_hidden; +extern bool_t _xdr_directory_obj (XDR *, directory_obj*) attribute_hidden; +extern bool_t _xdr_nis_object (XDR *, nis_object*) attribute_hidden; +extern bool_t _xdr_nis_error (XDR *, nis_error*) attribute_hidden; +extern bool_t _xdr_nis_result (XDR *, nis_result*) attribute_hidden; +extern bool_t _xdr_ns_request (XDR *, ns_request*) attribute_hidden; +extern bool_t _xdr_ib_request (XDR *, ib_request*) attribute_hidden; +extern bool_t _xdr_ping_args (XDR *, ping_args*) attribute_hidden; +extern bool_t _xdr_cp_result (XDR *, cp_result*) attribute_hidden; +extern bool_t _xdr_nis_tag (XDR *, nis_tag*) attribute_hidden; +extern bool_t _xdr_nis_taglist (XDR *, nis_taglist*) attribute_hidden; +extern bool_t _xdr_fd_args (XDR *, fd_args*) attribute_hidden; +extern bool_t _xdr_fd_result (XDR *, fd_result*) attribute_hidden; #endif diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c index d51eb6d0f2..093876fd74 100644 --- a/nis/nss_compat/compat-grp.c +++ b/nis/nss_compat/compat-grp.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1996. @@ -138,7 +138,11 @@ internal_setgrent (ent_t *ent, int stayopen) rewind (ent->stream); if (status == NSS_STATUS_SUCCESS && nss_setgrent) - return nss_setgrent (stayopen); + { + status = nss_setgrent (stayopen); + if (status == NSS_STATUS_UNAVAIL) + status = NSS_STATUS_SUCCESS; + } return status; } diff --git a/nis/nss_compat/compat-initgroups.c b/nis/nss_compat/compat-initgroups.c index 9574ea7c0b..70403a0785 100644 --- a/nis/nss_compat/compat-initgroups.c +++ b/nis/nss_compat/compat-initgroups.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1998-2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998. @@ -36,7 +36,6 @@ static service_user *ni; static enum nss_status (*nss_initgroups_dyn) (const char *, gid_t, long int *, long int *, gid_t **, long int, int *); -static enum nss_status (*nss_setgrent) (int stayopen); static enum nss_status (*nss_getgrnam_r) (const char *name, struct group * grp, char *buffer, size_t buflen, int *errnop); @@ -45,7 +44,6 @@ static enum nss_status (*nss_getgrgid_r) (gid_t gid, struct group * grp, int *errnop); static enum nss_status (*nss_getgrent_r) (struct group * grp, char *buffer, size_t buflen, int *errnop); -static enum nss_status (*nss_endgrent) (void); /* Protect global state against multiple changers. */ __libc_lock_define_initialized (static, lock) @@ -92,11 +90,9 @@ init_nss_interface (void) && __nss_database_lookup ("group_compat", NULL, "nis", &ni) >= 0) { nss_initgroups_dyn = __nss_lookup_function (ni, "initgroups_dyn"); - nss_setgrent = __nss_lookup_function (ni, "setgrent"); nss_getgrnam_r = __nss_lookup_function (ni, "getgrnam_r"); nss_getgrgid_r = __nss_lookup_function (ni, "getgrgid_r"); nss_getgrent_r = __nss_lookup_function (ni, "getgrent_r"); - nss_endgrent = __nss_lookup_function (ni, "endgrent"); } __libc_lock_unlock (lock); diff --git a/nis/nss_compat/compat-pwd.c b/nis/nss_compat/compat-pwd.c index 43ccb27071..1031714529 100644 --- a/nis/nss_compat/compat-pwd.c +++ b/nis/nss_compat/compat-pwd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. @@ -258,7 +258,11 @@ internal_setpwent (ent_t *ent, int stayopen) give_pwd_free (&ent->pwd); if (status == NSS_STATUS_SUCCESS && nss_setpwent) - return nss_setpwent (stayopen); + { + status = nss_setpwent (stayopen); + if (status == NSS_STATUS_UNAVAIL) + status = NSS_STATUS_SUCCESS; + } return status; } diff --git a/nis/nss_compat/compat-spwd.c b/nis/nss_compat/compat-spwd.c index 120e3bd38d..5c820a5f65 100644 --- a/nis/nss_compat/compat-spwd.c +++ b/nis/nss_compat/compat-spwd.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996-1999,2001-2004,2005 Free Software Foundation, Inc. +/* Copyright (C) 1996-1999,2001-2005,2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1996. @@ -212,7 +212,11 @@ internal_setspent (ent_t *ent, int stayopen) give_spwd_free (&ent->pwd); if (status == NSS_STATUS_SUCCESS && nss_setspent) - return nss_setspent (stayopen); + { + status = nss_setspent (stayopen); + if (status == NSS_STATUS_UNAVAIL) + status = NSS_STATUS_SUCCESS; + } return status; } diff --git a/nis/yp_xdr.c b/nis/yp_xdr.c index 0ee80126e8..b87ee06151 100644 --- a/nis/yp_xdr.c +++ b/nis/yp_xdr.c @@ -103,6 +103,7 @@ xdr_ypreq_key (XDR *xdrs, ypreq_key *objp) return FALSE; return xdr_keydat (xdrs, &objp->key); } +libnsl_hidden_def (xdr_ypreq_key) bool_t xdr_ypreq_nokey (XDR *xdrs, ypreq_nokey *objp) @@ -111,6 +112,7 @@ xdr_ypreq_nokey (XDR *xdrs, ypreq_nokey *objp) return FALSE; return xdr_mapname (xdrs, &objp->map); } +libnsl_hidden_def (xdr_ypreq_nokey) bool_t xdr_ypreq_xfr (XDR *xdrs, ypreq_xfr *objp) @@ -131,6 +133,7 @@ xdr_ypresp_val (XDR *xdrs, ypresp_val *objp) return FALSE; return xdr_valdat (xdrs, &objp->val); } +libnsl_hidden_def (xdr_ypresp_val) bool_t xdr_ypresp_key_val (XDR *xdrs, ypresp_key_val *objp) @@ -150,6 +153,7 @@ xdr_ypresp_master (XDR *xdrs, ypresp_master *objp) return FALSE; return xdr_peername (xdrs, &objp->peer); } +libnsl_hidden_def (xdr_ypresp_master) bool_t xdr_ypresp_order (XDR *xdrs, ypresp_order *objp) @@ -158,6 +162,7 @@ xdr_ypresp_order (XDR *xdrs, ypresp_order *objp) return FALSE; return xdr_u_int (xdrs, &objp->ordernum); } +libnsl_hidden_def (xdr_ypresp_order) bool_t xdr_ypresp_all (XDR *xdrs, ypresp_all *objp) @@ -193,6 +198,7 @@ xdr_ypmaplist (XDR *xdrs, ypmaplist *objp) return xdr_pointer (xdrs, (char **) &objp->next, sizeof (ypmaplist), (xdrproc_t) xdr_ypmaplist); } +libnsl_hidden_def (xdr_ypmaplist) bool_t xdr_ypresp_maplist (XDR *xdrs, ypresp_maplist *objp) @@ -202,6 +208,7 @@ xdr_ypresp_maplist (XDR *xdrs, ypresp_maplist *objp) return xdr_pointer (xdrs, (char **) &objp->maps, sizeof (ypmaplist), (xdrproc_t) xdr_ypmaplist); } +libnsl_hidden_def (xdr_ypresp_maplist) bool_t xdr_yppush_status (XDR *xdrs, yppush_status *objp) @@ -248,6 +255,7 @@ xdr_ypbind_resp (XDR *xdrs, ypbind_resp *objp) } return FALSE; } +libnsl_hidden_def (xdr_ypbind_resp) bool_t xdr_ypbind_setdom (XDR *xdrs, ypbind_setdom *objp) diff --git a/nis/ypupdate_xdr.c b/nis/ypupdate_xdr.c index 4789e47c3e..0f5469fa23 100644 --- a/nis/ypupdate_xdr.c +++ b/nis/ypupdate_xdr.c @@ -50,6 +50,7 @@ xdr_ypupdate_args (XDR *xdrs, ypupdate_args *objp) return FALSE; return xdr_yp_buf (xdrs, &objp->datum); } +libnsl_hidden_def (xdr_ypupdate_args) bool_t xdr_ypdelete_args (XDR *xdrs, ypdelete_args *objp) @@ -58,3 +59,4 @@ xdr_ypdelete_args (XDR *xdrs, ypdelete_args *objp) return FALSE; return xdr_yp_buf (xdrs, &objp->key); } +libnsl_hidden_def (xdr_ypdelete_args) diff --git a/nptl/ChangeLog b/nptl/ChangeLog index 80eb4ad9f3..04a4cfad4e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,19 @@ +2006-05-15 Ulrich Drepper <drepper@redhat.com> + + * sysdeps/unix/sysv/linux/fork.h: Makr __fork_handlers as hidden. + +2006-05-11 Ulrich Drepper <drepper@redhat.com> + + * pthread_key_create.c (__pthread_key_create): Do away with + __pthread_keys_lock. + + * sysdeps/unix/sysv/linux/pthread_setaffinity.c + (__kernel_cpumask_size): Mark as hidden. + * sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c: Likewise. + + * sem_open.c (__sem_mappings_lock): Mark as hidden. + * semaphoreP.h (__sem_mappings_lock): Likewise. + 2006-05-10 Ulrich Drepper <drepper@redhat.com> * pthread_atfork.c: Mark __dso_handle as hidden. diff --git a/nptl/pthread_key_create.c b/nptl/pthread_key_create.c index cf35bc8776..5fc8846243 100644 --- a/nptl/pthread_key_create.c +++ b/nptl/pthread_key_create.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -19,45 +19,36 @@ #include <errno.h> #include "pthreadP.h" +#include <atomic.h> -/* Internal mutex for __pthread_keys table handling. */ -lll_lock_t __pthread_keys_lock = LLL_LOCK_INITIALIZER; - int __pthread_key_create (key, destr) pthread_key_t *key; void (*destr) (void *); { - int result = EAGAIN; - size_t cnt; - - lll_lock (__pthread_keys_lock); - /* Find a slot in __pthread_kyes which is unused. */ - for (cnt = 0; cnt < PTHREAD_KEYS_MAX; ++cnt) - if (KEY_UNUSED (__pthread_keys[cnt].seq) - && KEY_USABLE (__pthread_keys[cnt].seq)) - { - /* We found an unused slot. */ - ++__pthread_keys[cnt].seq; - - /* Remember the destructor. */ - __pthread_keys[cnt].destr = destr; - - /* Return the key to the caller. */ - *key = cnt; - - /* The call succeeded. */ - result = 0; - - /* We found a key and can stop now. */ - break; - } - - lll_unlock (__pthread_keys_lock); - - return result; + for (size_t cnt = 0; cnt < PTHREAD_KEYS_MAX; ++cnt) + { + uintptr_t seq = __pthread_keys[cnt].seq; + + if (KEY_UNUSED (seq) && KEY_USABLE (seq) + /* We found an unused slot. Try to allocate it. */ + && ! atomic_compare_and_exchange_bool_acq (&__pthread_keys[cnt].seq, + seq + 1, seq)) + { + /* Remember the destructor. */ + __pthread_keys[cnt].destr = destr; + + /* Return the key to the caller. */ + *key = cnt; + + /* The call succeeded. */ + return 0; + } + } + + return EAGAIN; } strong_alias (__pthread_key_create, pthread_key_create) strong_alias (__pthread_key_create, __pthread_key_create_internal) diff --git a/nptl/sem_open.c b/nptl/sem_open.c index a4b2f5b3ac..66bcb13aec 100644 --- a/nptl/sem_open.c +++ b/nptl/sem_open.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -147,7 +147,7 @@ __sem_search (const void *a, const void *b) void *__sem_mappings attribute_hidden; /* Lock to protect the search tree. */ -lll_lock_t __sem_mappings_lock = LLL_LOCK_INITIALIZER; +lll_lock_t __sem_mappings_lock attribute_hidden = LLL_LOCK_INITIALIZER; /* Search for existing mapping and if possible add the one provided. */ diff --git a/nptl/semaphoreP.h b/nptl/semaphoreP.h index d14ea92c74..754609a1a8 100644 --- a/nptl/semaphoreP.h +++ b/nptl/semaphoreP.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -48,7 +48,7 @@ extern pthread_once_t __namedsem_once attribute_hidden; extern void *__sem_mappings attribute_hidden; /* Lock to protect the search tree. */ -extern lll_lock_t __sem_mappings_lock; +extern lll_lock_t __sem_mappings_lock attribute_hidden; /* Initializer for mountpoint. */ diff --git a/nptl/sysdeps/unix/sysv/linux/fork.h b/nptl/sysdeps/unix/sysv/linux/fork.h index d093ccc907..6458977b99 100644 --- a/nptl/sysdeps/unix/sysv/linux/fork.h +++ b/nptl/sysdeps/unix/sysv/linux/fork.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -41,7 +41,7 @@ struct fork_handler }; /* The single linked list of all currently registered for handlers. */ -extern struct fork_handler *__fork_handlers; +extern struct fork_handler *__fork_handlers attribute_hidden; /* Function to call to unregister fork handlers. */ diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c b/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c index ca84f1c9bd..355e695ec2 100644 --- a/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c +++ b/nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -27,7 +27,7 @@ /* Defined in pthread_setaffinity.c. */ -extern size_t __kernel_cpumask_size; +extern size_t __kernel_cpumask_size attribute_hidden; extern int __determine_cpumask_size (pid_t tid); diff --git a/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c index 5b24c694a9..3776e26e4b 100644 --- a/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c +++ b/nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2003. @@ -25,7 +25,7 @@ #include <shlib-compat.h> -size_t __kernel_cpumask_size; +size_t __kernel_cpumask_size attribute_hidden; /* Determine the current affinity. As a side affect we learn diff --git a/nscd/nscd_getai.c b/nscd/nscd_getai.c index 4e3dfad1ea..b59c31ea26 100644 --- a/nscd/nscd_getai.c +++ b/nscd/nscd_getai.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -34,7 +34,7 @@ extern int __nss_not_use_nscd_hosts; /* We use the mapping from nscd_gethst. */ -libc_locked_map_ptr (extern, __hst_map_handle); +libc_locked_map_ptr (extern, __hst_map_handle) attribute_hidden; int diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c index dae1c0da54..922b906c19 100644 --- a/nscd/nscd_getgr_r.c +++ b/nscd/nscd_getgr_r.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. +/* Copyright (C) 1998-2000, 2002-2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1998. @@ -67,7 +66,7 @@ __nscd_getgrgid_r (gid_t gid, struct group *resultbuf, char *buffer, } -libc_locked_map_ptr (,__gr_map_handle); +libc_locked_map_ptr (,__gr_map_handle) attribute_hidden; /* Note that we only free the structure if necessary. The memory mapping is not removed since it is not visible to the malloc handling. */ diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c index 9fa10e2740..516977bcc4 100644 --- a/nscd/nscd_gethst_r.c +++ b/nscd/nscd_gethst_r.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1998-2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1998-2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1998. @@ -87,7 +87,7 @@ __nscd_gethostbyaddr_r (const void *addr, socklen_t len, int type, } -libc_locked_map_ptr (, __hst_map_handle); +libc_locked_map_ptr (, __hst_map_handle) attribute_hidden; /* Note that we only free the structure if necessary. The memory mapping is not removed since it is not visible to the malloc handling. */ diff --git a/nscd/nscd_initgroups.c b/nscd/nscd_initgroups.c index cf5af6edc1..3d82275d7e 100644 --- a/nscd/nscd_initgroups.c +++ b/nscd/nscd_initgroups.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2004. @@ -30,7 +30,7 @@ /* We use the same mapping as in nscd_getgr. */ -libc_locked_map_ptr (extern, __gr_map_handle); +libc_locked_map_ptr (extern, __gr_map_handle) attribute_hidden; int diff --git a/posix/gai.conf b/posix/gai.conf index 5f063f5c3c..0e334ac2c5 100644 --- a/posix/gai.conf +++ b/posix/gai.conf @@ -24,17 +24,29 @@ #label 2002::/16 2 #label ::/96 3 #label ::ffff:0:0/96 4 +#label fec0::/10 5 +#label fc00::/7 6 +# +# This default differs from the tables given in RFC 3484 by handling +# (now obsolete) site-local IPv6 addresses and Unique Local Addresses. +# The reason for this difference is that these addresses are never +# NATed while IPv4 site-local addresses most probably are. Given +# the precedence of IPv6 over IPv4 (see below) on machines having only +# site-local IPv4 and IPv6 addresses a lookup for a global address would +# see the IPv6 be preferred. The result is a long delay because the +# site-local IPv6 addresses cannot be used while the IPv4 address is +# (at least for the foreseeable future) NATed. # # precedence <mask> <value> -# Add another rule the to RFC 3484 precendence table. See section 2.1 +# Add another rule the to RFC 3484 precedence table. See section 2.1 # and 10.3 in RFC 3484. The default is: # -#precendence ::1/128 50 -#precendence ::/0 40 -#precendence 2002::/16 30 -#precendence ::/96 20 -#precendence ::ffff:0:0/96 10 +#precedence ::1/128 50 +#precedence ::/0 40 +#precedence 2002::/16 30 +#precedence ::/96 20 +#precedence ::ffff:0:0/96 10 # # For sites which prefer IPv4 connections change the last line to # -#precendence ::ffff:0:0/96 100 +#precedence ::ffff:0:0/96 100 diff --git a/resolv/res_debug.c b/resolv/res_debug.c index 9b308b189a..d9f1607df6 100644 --- a/resolv/res_debug.c +++ b/resolv/res_debug.c @@ -896,7 +896,7 @@ loc_ntoa(binary, ascii) const u_char *binary; char *ascii; { - static char *error = "?"; + static const char error[] = "?"; static char tmpbuf[sizeof "1000 60 60.000 N 1000 60 60.000 W -12345678.00m 90000000.00m 90000000.00m 90000000.00m"]; const u_char *cp = binary; @@ -976,11 +976,11 @@ loc_ntoa(binary, ascii) altmeters = (altval / 100) * altsign; if ((sizestr = strdup(precsize_ntoa(sizeval))) == NULL) - sizestr = error; + sizestr = (char *) error; if ((hpstr = strdup(precsize_ntoa(hpval))) == NULL) - hpstr = error; + hpstr = (char *) error; if ((vpstr = strdup(precsize_ntoa(vpval))) == NULL) - vpstr = error; + vpstr = (char *) error; sprintf(ascii, "%d %.2d %.2d.%.3d %c %d %.2d %.2d.%.3d %c %d.%.2dm %sm %sm %sm", @@ -988,11 +988,11 @@ loc_ntoa(binary, ascii) longdeg, longmin, longsec, longsecfrac, eastwest, altmeters, altfrac, sizestr, hpstr, vpstr); - if (sizestr != error) + if (sizestr != (char *) error) free(sizestr); - if (hpstr != error) + if (hpstr != (char *) error) free(hpstr); - if (vpstr != error) + if (vpstr != (char *) error) free(vpstr); return (ascii); diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c index e0f4061cee..2a4d16a461 100644 --- a/stdlib/fmtmsg.c +++ b/stdlib/fmtmsg.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1997,1999,2000-2003,2005 Free Software Foundation, Inc. +/* Copyright (C) 1997,1999,2000-2003,2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997. @@ -44,7 +44,7 @@ enum static const struct { - size_t len; + uint32_t len; /* Adjust the size if new elements are added. */ const char name[12]; } keywords[] = diff --git a/stdlib/longlong.h b/stdlib/longlong.h index 4e1931d823..ca6285a19b 100644 --- a/stdlib/longlong.h +++ b/stdlib/longlong.h @@ -1,7 +1,6 @@ /* longlong.h -- definitions for mixed size 32/64 bit arithmetic. Copyright (C) 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -46,7 +45,7 @@ #define UDWtype UDItype #endif -extern const UQItype __clz_tab[256]; +extern const UQItype __clz_tab[256] attribute_hidden; /* Define auxiliary asm macros. diff --git a/sunrpc/key_call.c b/sunrpc/key_call.c index 63293aefa5..611c37256c 100644 --- a/sunrpc/key_call.c +++ b/sunrpc/key_call.c @@ -400,6 +400,7 @@ getkeyserv_handle (int vers) /* if pid has changed, destroy client and rebuild */ if (kcp->client != NULL && kcp->pid != __getpid ()) { + auth_destroy (kcp->client->cl_auth); clnt_destroy (kcp->client); kcp->client = NULL; } diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index a78c670bfb..a35b8662d5 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -1202,6 +1202,21 @@ static const struct prefixentry default_labels[] = = { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, 96, 4 }, + /* The next two entries differ from RFC 3484. We need to treat + IPv6 site-local addresses special because they are never NATed, + unlike site-locale IPv4 addresses. If this would not happen, on + machines which have only IPv4 and IPv6 site-local addresses, the + sorting would prefer the IPv6 site-local addresses, causing + unnecessary delays when trying to connect to a global IPv6 address + through a site-local IPv6 address. */ + { { .in6_u + = { .u6_addr8 = { 0xfe, 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 10, 5 }, + { { .in6_u + = { .u6_addr8 = { 0xfc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, + 7, 6 }, { { .in6_u = { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, @@ -1231,7 +1246,7 @@ static const struct prefixentry default_precedence[] = { { .in6_u = { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00 } } }, - 96, 100 }, + 96, 10 }, { { .in6_u = { .u6_addr8 = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } } }, diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c index 963b40d91d..836cbf3922 100644 --- a/sysdeps/unix/sysv/linux/getdents.c +++ b/sysdeps/unix/sysv/linux/getdents.c @@ -39,9 +39,9 @@ # ifndef __ASSUME_GETDENTS64_SYSCALL # ifndef __GETDENTS /* The variable is shared between all *getdents* calls. */ -int __have_no_getdents64; +int __have_no_getdents64 attribute_hidden; # else -extern int __have_no_getdents64; +extern int __have_no_getdents64 attribute_hidden; # endif # define have_no_getdents64_defined 1 # endif diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c index e6720f0ca2..82495de03e 100644 --- a/sysdeps/unix/sysv/linux/ifaddrs.c +++ b/sysdeps/unix/sysv/linux/ifaddrs.c @@ -89,10 +89,11 @@ __netlink_free_handle (struct netlink_handle *h) static int __netlink_sendreq (struct netlink_handle *h, int type) { - struct + struct req { struct nlmsghdr nlh; struct rtgenmsg g; + char pad[0]; } req; struct sockaddr_nl nladdr; @@ -105,6 +106,8 @@ __netlink_sendreq (struct netlink_handle *h, int type) req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_seq = h->seq; req.g.rtgen_family = AF_UNSPEC; + if (sizeof (req) != offsetof (struct req, pad)) + memset (req.pad, '\0', sizeof (req) - offsetof (struct req, pad)); memset (&nladdr, '\0', sizeof (nladdr)); nladdr.nl_family = AF_NETLINK; diff --git a/sysdeps/unix/sysv/linux/sched_getaffinity.c b/sysdeps/unix/sysv/linux/sched_getaffinity.c index c0a6eb81b9..ab171123b0 100644 --- a/sysdeps/unix/sysv/linux/sched_getaffinity.c +++ b/sysdeps/unix/sysv/linux/sched_getaffinity.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 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 @@ -20,6 +20,7 @@ #include <sched.h> #include <string.h> #include <sysdep.h> +#include <sys/param.h> #include <sys/types.h> #include <shlib-compat.h> @@ -28,8 +29,8 @@ int __sched_getaffinity_new (pid_t pid, size_t cpusetsize, cpu_set_t *cpuset) { - int res = INLINE_SYSCALL (sched_getaffinity, 3, pid, sizeof (cpu_set_t), - cpuset); + int res = INLINE_SYSCALL (sched_getaffinity, 3, pid, + MIN (INT_MAX, cpusetsize), cpuset); if (res != -1) { /* Clean the rest of the memory the kernel didn't do. */ diff --git a/sysdeps/unix/sysv/linux/sys/inotify.h b/sysdeps/unix/sysv/linux/sys/inotify.h index c498fe8f18..0131db9d3e 100644 --- a/sysdeps/unix/sysv/linux/sys/inotify.h +++ b/sysdeps/unix/sysv/linux/sys/inotify.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2005 Free Software Foundation, Inc. +/* Copyright (C) 2005, 2006 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 @@ -54,7 +54,16 @@ struct inotify_event #define IN_Q_OVERFLOW 0x00004000 /* Event queued overflowed. */ #define IN_IGNORED 0x00008000 /* File was ignored. */ +/* Helper events. */ +#define IN_CLOSE (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* Close. */ +#define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* Moves. */ + /* Special flags. */ +#define IN_ONLYDIR 0x01000000 /* Only watch the path if it is a + directory. */ +#define IN_DONT_FOLLOW 0x02000000 /* Do not follow a sym link. */ +#define IN_MASK_ADD 0x20000000 /* Add to the mask of an already + existing watch. */ #define IN_ISDIR 0x40000000 /* Event occurred against dir. */ #define IN_ONESHOT 0x80000000 /* Only send event once. */ |