1998-07-28 Ulrich Drepper <drepper@cygnus.com>
- * math/libm-test.c (tgamma_test): Remove redundant tests.
+ * resolv/nss_dns/dns-host.c (getanswer_r): Lower the priority of
+ warnings when DNSSEC related records are received.
+ * resolv/gethnamaddr.c (getanswer): Likewise.
+ Patch by Brian Wellington <bwelling@anomaly.munge.com>.
-1998-07-28 16:20 Ulrich Drepper <drepper@cygnus.com>
+ * signal/signal.h: Add prototype for sysv_signal.
+
+ * math/libm-test.c (tgamma_test): Remove redundant tests.
* sysdeps/generic/glob.c: Correct problems with */foo and GLOB_NOCHECK
where foo does not exist in any of the subdirectories.
* posix/globtest.sh: Add test for this bug.
+ * posix/glob.h: Add GLOB_TILDE_CHECK.
+ * sysdeps/generic/glob.c: Implement GLOB_TILDE_CHECK.
+ * posix/globtest.c: Add option T to enable GLOB_TILDE_CHECK.
+ * posix/globtest.sh: Re-enable test with ~ and non-existing user name.
+
1998-07-28 Mark Kettenis <kettenis@phys.uva.nl>
* io/sys/statfs.h: Fix typos.
/* Definitions for getting information about a filesystem.
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
extern int __REDIRECT (fstatfs, __P ((int __fildes, struct statfs *__buf)),
fstatfs64);
# else
-# define statfs statfs64
+# define fstatfs fstatfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
__P ((__const char *__file, struct statvfs *__buf)),
statvfs64);
# else
-# define statfs statfs64
+# define statvfs statvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
extern int __REDIRECT (fstatvfs, __P ((int __fildes, struct statvfs *__buf)),
fstatvfs64);
# else
-# define statfs statfs64
+# define fstatvfs fstatvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
glob ("~homer/bin/*", GLOB_TILDE, NULL, &result)
@end smallexample
-This functionality is equivalent to what is available in C-shells.
+If the user name is not valid or the home directory cannot be determined
+for some reason the pattern is left untouched and itself used as the
+result. I.e., if in the last example @code{home} is not available the
+tilde expansion yields to @code{"~homer/bin/*"} and @code{glob} is not
+looking for a directory named @code{~homer}.
+
+This functionality is equivalent to what is available in C-shells if the
+@code{nonomatch} flag is set.
+
+@comment glob.h
+@comment GNU
+@item GLOB_TILDE_CHECK
+If this flag is used @code{glob} behaves like as if @code{GLOB_TILDE} is
+given. The only difference is that if the user name is not available or
+the home directory cannot be determined for other reasons this leads to
+an error. @code{glob} will return @code{GLOB_NOMATCH} instead of using
+the pattern itself as the name.
+
+This funcationality is equivalent to what is available in C-shells if
+@code{nonomatch} flag is not set.
@comment glob.h
@comment GNU
# define GLOB_NOMAGIC (1 << 11)/* If no magic chars, return the pattern. */
# define GLOB_TILDE (1 << 12)/* Expand ~user and ~ to home directories. */
# define GLOB_ONLYDIR (1 << 13)/* Match only directories. */
+# define GLOB_TILDE_CHECK (1 << 14)/* Like GLOB_TILDE but return an error
+ if the user name is not available. */
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
GLOB_PERIOD|GLOB_ALTDIRFUNC|GLOB_BRACE| \
- GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR)
+ GLOB_NOMAGIC|GLOB_TILDE|GLOB_ONLYDIR|GLOB_TILDE_CHECK)
#else
# define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND| \
glob_t g;
int quotes = 1;
- while ((i = getopt (argc, argv, "bcdegmopqst")) != -1)
+ while ((i = getopt (argc, argv, "bcdegmopqstT")) != -1)
switch(i)
{
case 'b':
case 't':
glob_flags |= GLOB_TILDE;
break;
+ case 'T':
+ glob_flags |= GLOB_TILDE_CHECK;
+ break;
default:
exit (-1);
}
cmp $testout2 $testout || result=1
# Tilde expansion shouldn't match a file
-#${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
-#${common_objpfx}posix/globtest -t "$testdir" "~file4" |
-#sort > $testout
-#cat <<"EOF" | cmp - $testout || result=1
-#GLOB_NOMATCH
-#EOF
+${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
+${common_objpfx}posix/globtest -T "$testdir" "~file4" |
+sort > $testout
+cat <<"EOF" | cmp - $testout || result=1
+GLOB_NOMATCH
+EOF
# Matching \** should only find *file6
${elf_objpfx}${rtld_installed_name} --library-path ${library_path} \
buflen -= n;
continue;
}
+ if ((type == T_SIG) || (type == T_KEY) || (type == T_NXT)) {
+ /* We don't support DNSSEC yet. For now, ignore
+ * the record and send a low priority message
+ * to syslog.
+ */
+ syslog(LOG_DEBUG|LOG_AUTH,
+ "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
+ qname, p_class(C_IN), p_type(qtype),
+ p_type(type));
+ cp += n;
+ continue;
+ }
if (type != qtype) {
syslog(LOG_NOTICE|LOG_AUTH,
"gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
linebuflen -= n;
continue;
}
+ if (type == T_SIG || type == T_KEY || type == T_NXT)
+ {
+ /* We don't support DNSSEC yet. For now, ignore the record
+ and send a low priority message to syslog. */
+ syslog (LOG_DEBUG | LOG_AUTH,
+ "gethostby*.getanswer: asked for \"%s %s %s\", got type \"%s\"",
+ qname, p_class (C_IN), p_type(qtype), p_type (type));
+ cp += n;
+ continue;
+ }
if (type != qtype)
{
syslog (LOG_NOTICE | LOG_AUTH,
requested. */
extern __sighandler_t __sysv_signal __P ((int __sig,
__sighandler_t __handler));
+#ifdef __USE_GNU
+extern __sighandler_t sysv_signal __P ((int __sig, __sighandler_t __handler));
+#endif
/* Set the handler for the signal SIG to HANDLER, returning the old
handler, or SIG_ERR on error.
{
/* This can mean two things: a simple name or "~name". The later
case is nothing but a notation for a directory. */
- if ((flags & GLOB_TILDE) && pattern[0] == '~')
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && pattern[0] == '~')
{
dirname = (char *) pattern;
dirlen = strlen (pattern);
oldcount = pglob->gl_pathc;
#ifndef VMS
- if ((flags & GLOB_TILDE) && dirname[0] == '~')
+ if ((flags & (GLOB_TILDE|GLOB_TILDE_CHECK)) && dirname[0] == '~')
{
if (dirname[1] == '\0' || dirname[1] == '/')
{
}
}
if (home_dir == NULL || home_dir[0] == '\0')
- home_dir = (char *) "~"; /* No luck. */
+ if (flags & GLOB_TILDE_CHECK)
+ return GLOB_NOMATCH;
+ else
+ home_dir = (char *) "~"; /* No luck. */
# endif /* WINDOWS32 */
# endif
/* Now construct the full directory. */
# endif
dirname = newp;
}
+ else
+ if (flags & GLOB_TILDE_CHECK)
+ /* We have to regard it as an error if we cannot find the
+ home directory. */
+ return GLOB_NOMATCH;
}
# endif /* Not Amiga && not WINDOWS32. */
}