]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Updated to fedora-glibc-20060519T1550 cvs/fedora-glibc-2_4_90-8
authorJakub Jelinek <jakub@redhat.com>
Fri, 19 May 2006 16:04:10 +0000 (16:04 +0000)
committerJakub Jelinek <jakub@redhat.com>
Fri, 19 May 2006 16:04:10 +0000 (16:04 +0000)
57 files changed:
ChangeLog
fedora/branch.mk
fedora/glibc.spec.in
iconv/gconv_builtin.h
iconv/gconv_conf.c
iconv/gconv_int.h
include/arpa/nameser.h
include/rpc/auth.h
include/rpc/key_prot.h
include/rpc/pmap_prot.h
include/rpc/pmap_rmt.h
include/rpc/xdr.h
include/rpcsvc/nis_callback.h [new file with mode: 0644]
include/rpcsvc/yp.h
include/rpcsvc/ypupd.h
intl/dcigettext.c
locale/findlocale.c
locale/loadlocale.c
locale/localeinfo.h
locale/newlocale.c
locale/programs/ld-time.c
locale/setlocale.c
math/complex.h
misc/getusershell.c
nis/nis_call.c
nis/nis_callback.c
nis/nis_error.c
nis/nis_error.h [new file with mode: 0644]
nis/nis_xdr.c
nis/nis_xdr.h
nis/nss_compat/compat-grp.c
nis/nss_compat/compat-initgroups.c
nis/nss_compat/compat-pwd.c
nis/nss_compat/compat-spwd.c
nis/yp_xdr.c
nis/ypupdate_xdr.c
nptl/ChangeLog
nptl/pthread_key_create.c
nptl/sem_open.c
nptl/semaphoreP.h
nptl/sysdeps/unix/sysv/linux/fork.h
nptl/sysdeps/unix/sysv/linux/pthread_attr_setaffinity.c
nptl/sysdeps/unix/sysv/linux/pthread_setaffinity.c
nscd/nscd_getai.c
nscd/nscd_getgr_r.c
nscd/nscd_gethst_r.c
nscd/nscd_initgroups.c
posix/gai.conf
resolv/res_debug.c
stdlib/fmtmsg.c
stdlib/longlong.h
sunrpc/key_call.c
sysdeps/posix/getaddrinfo.c
sysdeps/unix/sysv/linux/getdents.c
sysdeps/unix/sysv/linux/ifaddrs.c
sysdeps/unix/sysv/linux/sched_getaffinity.c
sysdeps/unix/sysv/linux/sys/inotify.h

index 92259aa5b475931882b0c0a4a25af69b64f16c4d..944e6bcd6e583aa5b7d678723a329150e415b4d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 3f536bb857c225c81eaeaea0e0d45bd81ca2f61c..cec9684bc579e6df00c18cefa2770ddc74d11cad 100644 (file)
@@ -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
index bbdbce12845bf0b47e4e7775e32705602a2b6071..761bb5b7997390c611016a17214579a3193b1d84 100644 (file)
@@ -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)
index bd34c256dc8257100891116b2e46eeb502f07ae4..ef9ab8d7cf12952752fb786a2da25b6fc50a5b15 100644 (file)
@@ -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/")
index ad5a7ee1051a3dc9d7519591a648ee649406b545..22ffa4f41c7583002856723320daa52c162330e8 100644 (file)
@@ -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);
index ace2bae1c6e40e4f14e427e8104e38c17226e1e8..8d9cdaefc263c7284a89c3917d13db277167e6f7 100644 (file)
@@ -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,
index 449f5b452e2ab0b249e99a1e67fe973e2380dea3..efbe95660243cf3b537a3bc61f40427677686e84 100644 (file)
@@ -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
index a5e290b898b869cbc2e6cf9b44fac493169c6e42..bc433b59309cb054ffcd78cda098b4c82611e31b 100644 (file)
@@ -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,
index ee30c65d3b00c0628efd5342ace41e6dd0f50166..2da5de7f70f2e1b14687a7e2efed99f688a940ca 100644 (file)
@@ -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;
index e50d5e0c79434bc6d50fe80df61577d21eb5a108..902faba019a9b8216eac621edd9b73014b3da684 100644 (file)
@@ -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;
index f8e586c27e570a1af5672c27fa41134a42188578..63e41cab28187b2496aca7e86a16dab58a982ac0 100644 (file)
@@ -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;
index ab43f83dcb08d8852754eade4d1bbf7982234e46..e10d53e3b10b57161e23e04a3a1f5986c9d2c838 100644 (file)
@@ -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 (file)
index 0000000..dfa9cd3
--- /dev/null
@@ -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
index cc4e00fd0b7e8762d3bc6d1cfe10306932c4e5fd..04a973eae77d98e5ab84906290e2660082d172fb 100644 (file)
@@ -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
index 68116e629f2b9d0d4aeecf8a0768d1c8d76dfd28..76019715124c11fb2b7d22fdcf18c089669f25f9 100644 (file)
@@ -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
index f294dedf2fa0a0f01b4be7852bbea8253480e421..b56196ccbe47f80feefe5e0331faaa3628c78611 100644 (file)
@@ -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
index 04b197d266c032366a2ee2affccea33df961ebc9..ea24170df516c69c747845ce5d34795e82da590e 100644 (file)
@@ -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;
index 2a5935087c11e903d9c16e59c79ec5ef5fb91441..467dff157a4ec6f0e97bceefda0274553539a891 100644 (file)
@@ -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);
index 3b0ed4f30b0380b2c8db28057b2efe79e0d3ee47..4f746a298d1b3587b60aaadd77712acf3bdfd708 100644 (file)
@@ -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;
index b3d4b464b1fc5874778d348b4446740c4cc7549e..0c31ba48aebb491afa299b1962256d85b278d079 100644 (file)
@@ -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)
index 78aff7fee6142bdfce43d66735d14b9407a66018..4f1dcb0ce73e2f42b7c312d19abbf964f7fafcc4 100644 (file)
@@ -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"";
        }
     }
 
index 50bf8e772f7be7468437b664d36589b26dbee075..c1b8c3faeceef8cc772a05c77f8cb2e4d7e1ff93 100644 (file)
@@ -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)
index 229bb7dca6fed24573a24e1a2c1297d9d082fc0f..751aaf763f58ae851a609194f8e30242b2ec0668 100644 (file)
@@ -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_
index f41c6fa5f03080755ef13dc60ae39d2cda6db841..255b579b1ad83987477a919e79fe6a90c09e621d 100644 (file)
@@ -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;
index 32d29ae99f7ebec8ea129617e1e01ebdb4872296..753ef7799720de72441073ff44fd175d57e856d6 100644 (file)
@@ -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
index 7d1b9f8e53d6091e3ef271b569cb350fb482ec42..6582315c7085b35cbedca6b9ef68625be1339d83 100644 (file)
@@ -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;
index 7db885ef9398bfe584755a5ae94de66a426fa6f2..d92ad036049a29ecbc923410f27e7c4a5ae2ade7 100644 (file)
@@ -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.
 
 #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 (file)
index 0000000..add1316
--- /dev/null
@@ -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."))
index 1ef08c78901e668361a74bdb997fd326a0e61db5..3d4f7268c0c09eb09e0c76fd8c26b40e98937045 100644 (file)
@@ -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)
index 2f1a179e0a7ecf8ea646df1805b5049b8d82950a..791a964d2fa19e9d92ffdba5d38a21a0949cd6f3 100644 (file)
@@ -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.
 
 
 #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
index d51eb6d0f235f2f5907eb2651cc78d85eb47c985..093876fd74694cd83f6a02eb3fef4a0a3554c80f 100644 (file)
@@ -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;
 }
index 9574ea7c0bee7a3662dc960f348f4065628b0d96..70403a0785edf711108a8c6e1a3b0141db1140e9 100644 (file)
@@ -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);
index 43ccb270714b1c3bb3ea79a2a8f1481815e58af8..1031714529fb7206ed162ae6601b3ceaf39ae901 100644 (file)
@@ -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;
 }
index 120e3bd38d47e6607f7bafb181365fe7f61c9b38..5c820a5f65431542d5c95edad5108d89a4a5f14c 100644 (file)
@@ -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;
 }
index 0ee80126e8a52a04aed36831e48bfb94e0023a8f..b87ee06151c33a134e711b19e7dd156289a676b1 100644 (file)
@@ -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)
index 4789e47c3e93d8d439036477871cc7bd33da9e87..0f5469fa23648242986206a6285aec406320bbfb 100644 (file)
@@ -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)
index 80eb4ad9f3210198f7720c33fea02632eacc3871..04a4cfad4ec9089eaf5ce6d3981db94808d17724 100644 (file)
@@ -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.
index cf35bc8776f73bb316f15bd20aebe589c5e41a4d..5fc8846243698329a1c07cc25513053d5c2b9686 100644 (file)
@@ -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.
 
 
 #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)
index a4b2f5b3ac6fdf0931cb5f36b9de4c17ef0681bc..66bcb13aec4339377d60544caf7b95d1b7f1f2b7 100644 (file)
@@ -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.  */
index d14ea92c74ad54f5dddcb6f73b9ef1c76a14dac8..754609a1a82fbbe8a2096df7032bdfdaeeae5ffa 100644 (file)
@@ -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.  */
index d093ccc907cf346852c50819390a1b4510a8c707..6458977b997f3371b6dd03c4cc7311090c20fae7 100644 (file)
@@ -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.  */
index ca84f1c9bd3654d4ad469fa673dfca92e7207f81..355e695ec29b349388568f398cba376c36cba18d 100644 (file)
@@ -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);
 
 
index 5b24c694a97a7928ab859b74c6c6e7d503956293..3776e26e4b5db1f116171d7acdff598f3bdf3847 100644 (file)
@@ -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
index 4e3dfad1ea4a14e06d9864f9a12b2b5658f18bcc..b59c31ea26d3fa0b67878727acfe4f919eaafb56 100644 (file)
@@ -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
index dae1c0da54e61f120fd5ab7d879c2dc8af14c20f..922b906c19095d985196525355c4024fb32d4db6 100644 (file)
@@ -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.  */
index 9fa10e27400006f6a3744f79c09d5d291bbbb65c..516977bcc4997b25aff54a7b320a31d7c38699a1 100644 (file)
@@ -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.  */
index cf5af6edc1bb55d7a3ca71607a16dbe81182e418..3d82275d7e06f86c6720f6ca89748bd2d14b4aaf 100644 (file)
@@ -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
index 5f063f5c3c89778e13dca16934bb3c1668e2e4a8..0e334ac2c5044b1bf5b416adeef28db633cbfcbd 100644 (file)
 #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
index 9b308b189a6d4fb26a557362080e1942589e018e..d9f1607df65820ade0cd9fc868f79c93877b3e1a 100644 (file)
@@ -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);
index e0f4061cee8ed6744d8417e3095dee1ce76e2978..2a4d16a461a586123e3144c60b83dd0519af2fa9 100644 (file)
@@ -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[] =
index 4e1931d8234f3a64ab764c6e01e0db0c35c52dc4..ca6285a19b1a1b84d2cd470e9a8488e4b5dc4e91 100644 (file)
@@ -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.
 
index 63293aefa59061c5ab315a2b500c7b487ccb0b49..611c37256c179adce4b1d30a70c66db7d6d35b24 100644 (file)
@@ -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;
     }
index a78c670bfbd9804143f1be71bb16b827a01dfb74..a35b8662d598caa5fcf9266a9a44ea4478b537ff 100644 (file)
@@ -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 } } },
index 963b40d91da5aee3fb36bc2ef0add0b9a1b280e9..836cbf39227f7007924b50f9ad35365acb4eee91 100644 (file)
@@ -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
index e6720f0ca230c3b70de60cd9e4a40f4e891e2c32..82495de03e7c84115f22430519273a3e72f840da 100644 (file)
@@ -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;
index c0a6eb81b9b855b5ec58679b449ea257dfb597ff..ab171123b0c8dfe9db2c5d9c7989e69a72490779 100644 (file)
@@ -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.  */
index c498fe8f18de5f0f7baf8c4a1158f3b547180b66..0131db9d3ed41a87abf9b7a8e4382b1bf5a1aecc 100644 (file)
@@ -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.  */