glibc/hesiod/hesiod.c

476 lines
11 KiB
C
Raw Normal View History

Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
/* Copyright (c) 1996 by Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
* ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
* CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* Copyright 1996 by the Massachusetts Institute of Technology.
*
* Permission to use, copy, modify, and distribute this
* software and its documentation for any purpose and without
* fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting
* documentation, and that the name of M.I.T. not be used in
* advertising or publicity pertaining to distribution of the
* software without specific, written prior permission.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is"
* without express or implied warranty.
*/
/* This file is part of the hesiod library. It implements the core
* portion of the hesiod resolver.
*
* This file is loosely based on an interim version of hesiod.c from
* the BIND IRS library, which was in turn based on an earlier version
* of this file. Extensive changes have been made on each step of the
* path.
*
* This implementation is not truly thread-safe at the moment because
* it uses res_send() and accesses _res.
*/
static const char rcsid[] = "$Id$";
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <errno.h>
#include <netdb.h>
#include <resolv.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "hesiod.h"
#include "hesiod_p.h"
/* A few operating systems don't define these. */
#ifndef C_HS
#define C_HS 4
#endif
#ifndef T_TXT
#define T_TXT 16
#endif
static int read_config_file(struct hesiod_p *ctx, const char *filename);
static char **get_txt_records(struct hesiod_p *ctx, int class,
const char *name);
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
#ifdef _LIBC
# define cistrcmp(s1, s2) strcasecmp (s1, s2)
#else
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
static int cistrcmp(const char *s1, const char *s2);
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
#endif
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
/* This function is called to initialize a hesiod_p. */
int hesiod_init(void **context)
{
struct hesiod_p *ctx;
const char *p, *configname;
ctx = malloc(sizeof(struct hesiod_p));
if (ctx)
{
*context = ctx;
configname = __secure_getenv("HESIOD_CONFIG");
if (!configname)
configname = SYSCONFDIR "/hesiod.conf";
if (read_config_file(ctx, configname) >= 0)
{
/* The default rhs can be overridden by an environment variable. */
Update. 1997-09-21 03:19 Ulrich Drepper <drepper@cygnus.com> * libio/libio.h: More libstdc++ cleanups. Define _IO_USE_DTOA if _G_HAVE_PRINTF_FP is not defined. * libio/strops.c: Undo patch of 1997-07-08 02:18. Must find a different solution for the problem. * misc/search.h [__USE_GNU]: Define comparison_fn_t. * stdlib/stdlib.h: Define comparison_fn_t only if __COMPAR_FN_T is not defined. Fix typo. Pretty print inline functions. * sysdeps/i386/i486/string.h (__stpcpy_small): Increment __cp not cp. Patch by HJ Lu <hjl@gnu.ai.mit.edu>. 1997-09-20 16:45 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c (hesiod_init): Use __secure_getenv to get HES_DOMAIN environment variable. Suggested by Mark Kettenis <kettenis@phys.uva.nl>. * hesiod/README.hesiod: A bit of information about Hesiod and how to use it. Written by Mark Kettenis <kettenis@phys.uva.nl>. 1997-09-20 05:15 Ulrich Drepper <drepper@cygnus.com> * manual/maint.texi: Update requirement list. * io/ftw.h: Don't use parameter names from global namespace in prototypes. * stdlib/strtol.c: If used outside glibc handle broken systems which have character classification functions which are not 8-bit clean gracefully. Patch by Bruno Haible <haible@ilog.fr>. 1997-09-19 21:42 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: ssize_t is a long long int. 1997-09-19 15:12 H.J. Lu <hjl@gnu.ai.mit.edu> * posix/Makefile (test-srcs): New, set to globtest. 1997-09-20 00:24 Ulrich Drepper <drepper@cygnus.com> * manual/filesys.texi: Document ftw, nftw and needed data types. 1997-09-19 12:53 H.J. Lu <hjl@gnu.ai.mit.edu> * sysdeps/i386/i486/bits/string.h: Fix typo. 1997-09-19 14:11 Ulrich Drepper <drepper@cygnus.com> * io/ftwtest.c (cb): Print level. * io/ftwtest-sh: Updated for ftwtest.c change. * string/argz.h (__argz_next): Cast NULL to char * to satisfy C++ compilers. Reported by Mirko Streckenbach <mirko@ramz.ing.tu-bs.de>. * catgets/catgets.c (catopen): Correctly allocate string of nlspath. Reported by Charles C. Fu <ccwf@klab.caltech.edu>. 1997-09-18 13:30 Klaus Espenlaub <kespenla@student.informatik.uni-ulm.de> * sysdeps/i386/init-first.c: Call __getopt_clean_environment with additional argument. * sysdeps/mach/hurd/i386/init-first.c: Likewise. * sysdeps/mach/hurd/mips/init-first.c: Likewise. * sysdeps/stub/init-first.c: Likewise. 1997-09-18 03:16 Ulrich Drepper <drepper@cygnus.com> * manual/search.texi: Document lsearch, lfind, the hsearch and tsearch functions. 1997-09-18 00:04 Ulrich Drepper <drepper@cygnus.com> * misc/hsearch_r.c (hsearch_r): Only return error for ENTER action if the table is full and we *really* have to enter a new entry. 1997-09-17 19:44 Ulrich Drepper <drepper@cygnus.com> * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Get rid of hack for handling flush opcode. Patch by Richard Henderson <rth@cygnus.com>.
1997-09-21 03:47:02 +02:00
p = __secure_getenv("HES_DOMAIN");
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
if (p)
{
if (ctx->rhs)
free(ctx->rhs);
ctx->rhs = malloc(strlen(p) + 2);
if (ctx->rhs)
{
*ctx->rhs = '.';
strcpy(ctx->rhs + 1, (*p == '.') ? p + 1 : p);
return 0;
}
else
__set_errno (ENOMEM);
}
else
return 0;
}
}
else
__set_errno (ENOMEM);
if (ctx->lhs)
free(ctx->lhs);
if (ctx->rhs)
free(ctx->rhs);
if (ctx)
free(ctx);
return -1;
}
/* This function deallocates the hesiod_p. */
void hesiod_end(void *context)
{
struct hesiod_p *ctx = (struct hesiod_p *) context;
free(ctx->rhs);
if (ctx->lhs)
free(ctx->lhs);
free(ctx);
}
/* This function takes a hesiod (name, type) and returns a DNS
* name which is to be resolved.
*/
char *hesiod_to_bind(void *context, const char *name, const char *type)
{
struct hesiod_p *ctx = (struct hesiod_p *) context;
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
char bindname[MAXDNAME], *p, *endp, *ret, **rhs_list = NULL;
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
const char *rhs;
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
size_t len;
endp = stpcpy(bindname, name);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
/* Find the right right hand side to use, possibly truncating bindname. */
p = strchr(bindname, '@');
if (p)
{
*p++ = 0;
if (strchr(p, '.'))
rhs = name + (p - bindname);
else
{
rhs_list = hesiod_resolve(context, p, "rhs-extension");
if (rhs_list)
rhs = *rhs_list;
else
{
__set_errno (ENOENT);
return NULL;
}
}
} else
rhs = ctx->rhs;
/* See if we have enough room. */
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
len = (endp - bindname) + 1 + strlen(type);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
if (ctx->lhs)
len += strlen(ctx->lhs) + ((ctx->lhs[0] != '.') ? 1 : 0);
len += strlen(rhs) + ((rhs[0] != '.') ? 1 : 0);
if (len > sizeof(bindname) - 1)
{
if (rhs_list)
hesiod_free_list(context, rhs_list);
__set_errno (EMSGSIZE);
return NULL;
}
/* Put together the rest of the domain. */
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
endp = __stpcpy (__stpcpy (endp, "."), type);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
if (ctx->lhs)
{
if (ctx->lhs[0] != '.')
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
endp = __stpcpy (endp, ".");
endp = __stpcpy (endp, ctx->lhs);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
}
if (rhs[0] != '.')
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
endp = __stpcpy (endp, ".");
endp = __stpcpy (endp, rhs);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
/* rhs_list is no longer needed, since we're done with rhs. */
if (rhs_list)
hesiod_free_list(context, rhs_list);
/* Make a copy of the result and return it to the caller. */
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
ret = malloc((endp - bindname) + 1);
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
if (!ret)
{
__set_errno (ENOMEM);
return NULL;
}
strcpy(ret, bindname);
return ret;
}
/* This is the core function. Given a hesiod name and type, it
* returns an array of strings returned by the resolver.
*/
char **hesiod_resolve(void *context, const char *name, const char *type)
{
struct hesiod_p *ctx = (struct hesiod_p *) context;
char *bindname, **retvec;
bindname = hesiod_to_bind(context, name, type);
if (!bindname)
return NULL;
retvec = get_txt_records(ctx, ctx->classes[0], bindname);
if (retvec == NULL && errno == ENOENT && ctx->classes[1])
retvec = get_txt_records(ctx, ctx->classes[1], bindname);
free(bindname);
return retvec;
}
void hesiod_free_list(void *context, char **list)
{
char **p;
for (p = list; *p; p++)
free(*p);
free(list);
}
/* This function parses the /etc/hesiod.conf file. Returns 0 on success,
* -1 on failure. On failure, it might leave values in ctx->lhs or
* ctx->rhs which need to be freed by the caller. */
static int read_config_file(struct hesiod_p *ctx, const char *filename)
{
char *key, *data, *p, **which;
char buf[MAXDNAME + 7];
int n;
FILE *fp;
/* Set default query classes. */
ctx->classes[0] = C_IN;
ctx->classes[1] = C_HS;
/* Try to open the configuration file. */
fp = fopen(filename, "r");
if (!fp)
{
/* Use compiled in default domain names. */
ctx->lhs = malloc(strlen(DEF_LHS) + 1);
ctx->rhs = malloc(strlen(DEF_RHS) + 1);
if (ctx->lhs && ctx->rhs)
{
strcpy(ctx->lhs, DEF_LHS);
strcpy(ctx->rhs, DEF_RHS);
return 0;
}
else
{
__set_errno (ENOMEM);
return -1;
}
}
ctx->lhs = NULL;
ctx->rhs = NULL;
while (fgets(buf, sizeof(buf), fp) != NULL)
{
p = buf;
if (*p == '#' || *p == '\n' || *p == '\r')
continue;
while(*p == ' ' || *p == '\t')
p++;
key = p;
while(*p != ' ' && *p != '\t' && *p != '=')
p++;
*p++ = 0;
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
while(isspace(*p) || *p == '=')
p++;
data = p;
while(!isspace(*p))
p++;
*p = 0;
if (cistrcmp(key, "lhs") == 0 || cistrcmp(key, "rhs") == 0)
{
which = (strcmp(key, "lhs") == 0) ? &ctx->lhs : &ctx->rhs;
*which = malloc(strlen(data) + 1);
if (!*which)
{
__set_errno (ENOMEM);
return -1;
}
strcpy(*which, data);
}
else if (cistrcmp(key, "classes") == 0)
{
n = 0;
while (*data && n < 2)
{
p = data;
while (*p && *p != ',')
p++;
if (*p)
*p++ = 0;
if (cistrcmp(data, "IN") == 0)
ctx->classes[n++] = C_IN;
else if (cistrcmp(data, "HS") == 0)
ctx->classes[n++] = C_HS;
data = p;
}
while (n < 2)
ctx->classes[n++] = 0;
}
}
fclose(fp);
if (!ctx->rhs || ctx->classes[0] == 0 || ctx->classes[0] == ctx->classes[1])
{
__set_errno (ENOEXEC);
return -1;
}
return 0;
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
}
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
/* Given a DNS class and a DNS name, do a lookup for TXT records, and
* return a list of them.
*/
static char **get_txt_records(struct hesiod_p *ctx, int qclass,
const char *name)
{
HEADER *hp;
unsigned char qbuf[PACKETSZ], abuf[MAX_HESRESP], *p, *eom, *eor;
char *dst, **list;
int ancount, qdcount, i, j, n, skip, type, class, len;
/* Make sure the resolver is initialized. */
if ((_res.options & RES_INIT) == 0 && res_init() == -1)
return NULL;
/* Construct the query. */
n = res_mkquery(QUERY, name, qclass, T_TXT, NULL, 0,
NULL, qbuf, PACKETSZ);
if (n < 0)
return NULL;
/* Send the query. */
n = res_send(qbuf, n, abuf, MAX_HESRESP);
if (n < 0)
{
__set_errno (ECONNREFUSED);
return NULL;
}
/* Parse the header of the result. */
hp = (HEADER *) abuf;
ancount = ntohs(hp->ancount);
qdcount = ntohs(hp->qdcount);
p = abuf + sizeof(HEADER);
eom = abuf + n;
/* Skip questions, trying to get to the answer section which follows. */
for (i = 0; i < qdcount; i++)
{
skip = dn_skipname(p, eom);
if (skip < 0 || p + skip + QFIXEDSZ > eom)
{
__set_errno (EMSGSIZE);
return NULL;
}
p += skip + QFIXEDSZ;
}
/* Allocate space for the text record answers. */
list = malloc((ancount + 1) * sizeof(char *));
if (!list)
{
__set_errno (ENOMEM);
return NULL;
}
/* Parse the answers. */
j = 0;
for (i = 0; i < ancount; i++)
{
/* Parse the header of this answer. */
skip = dn_skipname(p, eom);
if (skip < 0 || p + skip + 10 > eom)
break;
type = p[skip + 0] << 8 | p[skip + 1];
class = p[skip + 2] << 8 | p[skip + 3];
len = p[skip + 8] << 8 | p[skip + 9];
p += skip + 10;
if (p + len > eom)
{
__set_errno (EMSGSIZE);
break;
}
/* Skip entries of the wrong class and type. */
if (class != qclass || type != T_TXT)
{
p += len;
continue;
}
/* Allocate space for this answer. */
list[j] = malloc(len);
if (!list[j])
{
__set_errno (ENOMEM);
break;
}
dst = list[j++];
/* Copy answer data into the allocated area. */
eor = p + len;
while (p < eor)
{
n = (unsigned char) *p++;
if (p + n > eor)
{
__set_errno (EMSGSIZE);
break;
}
memcpy(dst, p, n);
p += n;
dst += n;
}
if (p < eor)
{
__set_errno (EMSGSIZE);
break;
}
*dst = 0;
}
/* If we didn't terminate the loop normally, something went wrong. */
if (i < ancount)
{
for (i = 0; i < j; i++)
free(list[i]);
free(list);
return NULL;
}
if (j == 0)
{
__set_errno (ENOENT);
free(list);
return NULL;
}
list[j] = NULL;
return list;
}
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
#ifndef _LIBC
Update. 1997-09-16 02:14 Ulrich Drepper <drepper@cygnus.com> Implementation of Hesiod NSS module by Mark Kettenis. * hesiod/Makefile: New file. * hesiod/hesiod.c: New file. * hesiod/hesiod.h: New file. * hesiod/hesiod_p.h: New file. * hesiod/libnss_hesiod.map: New file. * hesiod/nss_hesiod/hesiod-grp.c: New file. * hesiod/nss_hesiod/hesiod-pwd.c: New file. * hesiod/nss_hesiod/hesiod-service.c: New file. * sysdeps/unix/inet/Subdirs: Add hesiod. * shlib-versions: Add version number for libnss_hesiod. * libio/iolibio.h: Remove definition of _IO_* macros. * libio/fileops.c: Define close, fstat, lseek, read, and write as macros to use __ protected versions. Use those functions instead of _IO_* functions. * libio/iopopen.c: Define _IO_close to close. * manual/math.texi: Explain the use of the optimizing inline functions. Describe rand_r function and tell about SysV RNGs in introduction. * resolv/res_send.c (res_send): Use socklen_t type for `fromlen' variable. * string/Makefile (tests): Add noinl-tester. * string/noinl-tester.c: New file. * string/tester.c: Add more stpcpy tests for constant arguments for all short lengths. * string/string.h: Always declare __bzero. Describe __NO_STRING_INLINES. Always include <bits/string.h>. * string/bits/string2.h: Add warning about direct use. Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/i386/bits/string.h: Don't define anything is __NO_STRING_INLINES is defined. * sysdeps/i386/i486/bits/string.h: Change __strcpy_small and __stpcpy_small implementation to use macros and provide alternative for platforms which cannot do unaligned stores. * sysdeps/alpha/bzero.S: Define bzero as weak alias of __bzero. * sysdeps/generic/bzero.c: Likewise. * sysdeps/i386/bzero.c: Likewise. * sysdeps/i386/i586/bzero.S: Likewise. * sysdeps/vax/bzero.s: Likewise. * sysdeps/generic/bits/select.h: Don't use ugly casts to access array. * sysdeps/i386/bits/select.h: Likewise. * sysdeps/i386/fpu/bits/mathinline.c (__finite): Relax register constraints a bit. Don't define and test for _BITS_MATHINLINE_H. Emit warning if used directly and not through math.h. * sysdeps/i386/i486/atomicity.h: Change return type of compare_and_swap to char to get better code. Fix typo. * sysdeps/stub/atomicity.h: Fix typo. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/stpcpy.c: #undef stpcpy and __stpcpy. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h: Add prototypes to avoid warning. 1997-09-14 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * string/bits/string2.h (strsep): Fix handling of empty REJECT. (__strsep_1c): Handle NULL and empty string. (__strsep_g): Likewise. 1997-09-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * catgets/Makefile (extra-objs): Set this instead of generated. * md5-crypt/Makefile (extra-objs): Add all object file variants of onlymd5-entry. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/generic/sysd-stdio.c (__stdio_read): Fix typo in last change. 1997-09-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de> * sysdeps/m68k/m68020/atomicity.h: New file. 1997-09-15 05:11 Ulrich Drepper <drepper@cygnus.com> * posix/Makefile (distribute): Add globtest.c and globtest.sh. Compile and run globtest if not cross-compiling. * posix/globtest.c: New file. * posix/globtest.sh: New file. * posix/glob.c: Pretty print preprocessor stuff. (glob_in_dir): If PATTERN is not really a pattern still check whether it is a real file in the current directory and return error if not. Reported by Eugene Mamchits <eugin@ips.ras.ru>. * libio/fileops.c (_IO_file_sync): Acquire lock before doing the work. * libio/ioseekoff.c (_IO_seekoff): Likewise. * libio/ioseekpos.c (_IO_seekpos): Likewise. 1997-09-13 18:06 Ulrich Drepper <drepper@cygnus.com> * configure.in: Prevent configuration for unsupported platforms. 1997-09-13 04:07 Ulrich Drepper <drepper@cygnus.com> * elf/rtld.c (dl_main): Make sure we always have a file argument by testing for < 2 arguments after recognizing the options. 1997-09-12 11:47 Fila Kolodny <fila@ibi.com> * string/bits/string2.h (__strsep_1c): Cast out const from __retval. (__strsep_g): Likewise.
1997-09-16 02:42:43 +02:00
static int cistrcmp(const char *s1, const char *s2)
{
while (*s1 && tolower(*s1) == tolower(*s2))
{
s1++;
s2++;
}
return tolower(*s1) - tolower(*s2);
}
Update. 1997-09-16 23:48 Ulrich Drepper <drepper@cygnus.com> * libio/fileops.c: Define __set_errno if necessary. * libio/libioP.h: Don't use __BEGIN_DECLS/__END_DECLS, expand macros. 1997-09-16 22:03 Ulrich Drepper <drepper@cygnus.com> * string/Makefile (headers): Instead bits/string2.h. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 13:31 David S. Miller <davem@tanya.rutgers.edu> * sysdeps/unix/sysv/linux/sparc/sparc64/bits/statfs.h: New file. 1997-09-16 17:42 Ulrich Drepper <drepper@cygnus.com> * sysdeps/generic/bits/select.h (__FD_ZERO): Declare __arr variable as of type __fdset *. * sysdeps/i386/bits/select.h: Likewise. Reported by David S. Miller <davem@jenolan.rutgers.edu>. 1997-09-16 04:32 Ulrich Drepper <drepper@cygnus.com> * hesiod/hesiod.c: Don't use and define cistrcmp. We have strcasecmp. (hesiod_init): Use of HES_DOMAIN need not be protected by __secure_getenv. (hesiod_to_bind): Avoid using strcat and extra strlen calls, use stpcpy. * string/Makefile (noinl-tester-ENV): New variable to make strerror test pass. (CFLAGS-noinl-tester): Make sure we test the correct functions. * sysdeps/stub/atomicity.h: Fix typo. Zack Weinberg <zack@rabi.phys.columbia.edu> told me this twice. * manual/string.texi: Document strnlen and mempcpy. Tell a bit more about the locale dependence of strcasecmp and strncasecmp. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Remove ptrace. * sysdeps/unix/sysv/linux/sys/ptrace.h (ptrace): Change return value type to long int. * sysdeps/unix/sysv/linux/ptrace.c: Likewise. Adopt local variable types. * sysdeps/unix/sysv/linux/sparc/sparc64/longjmp.S: Fix typo. Patches by David S. Miller <davem@jenolan.rutgers.edu>.
1997-09-16 23:51:15 +02:00
#endif