* 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>.
	* signal/signal.h: Add prototype for sysv_signal.

	* math/libm-test.c (tgamma_test): Remove redundant tests.
	* 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.
This commit is contained in:
Ulrich Drepper 1998-07-28 20:47:08 +00:00
parent e852e88944
commit 1bc21e7a70
11 changed files with 85 additions and 18 deletions

View File

@ -1,8 +1,13 @@
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.
@ -10,6 +15,11 @@
* 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.

View File

@ -1,5 +1,5 @@
/* 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
@ -53,7 +53,7 @@ extern int fstatfs __P ((int __fildes, struct statfs *__buf));
extern int __REDIRECT (fstatfs, __P ((int __fildes, struct statfs *__buf)),
fstatfs64);
# else
# define statfs statfs64
# define fstatfs fstatfs64
# endif
#endif
#ifdef __USE_LARGEFILE64

View File

@ -37,7 +37,7 @@ extern int __REDIRECT (statvfs,
__P ((__const char *__file, struct statvfs *__buf)),
statvfs64);
# else
# define statfs statfs64
# define statvfs statvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64
@ -54,7 +54,7 @@ extern int fstatvfs __P ((int __fildes, struct statvfs *__buf));
extern int __REDIRECT (fstatvfs, __P ((int __fildes, struct statvfs *__buf)),
fstatvfs64);
# else
# define statfs statfs64
# define fstatvfs fstatvfs64
# endif
#endif
#ifdef __USE_LARGEFILE64

View File

@ -466,7 +466,26 @@ user name after the tilde character. So the contents of user
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

View File

@ -61,10 +61,12 @@ extern "C" {
# 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| \

View File

@ -29,7 +29,7 @@ main (int argc, char *argv[])
glob_t g;
int quotes = 1;
while ((i = getopt (argc, argv, "bcdegmopqst")) != -1)
while ((i = getopt (argc, argv, "bcdegmopqstT")) != -1)
switch(i)
{
case 'b':
@ -66,6 +66,9 @@ main (int argc, char *argv[])
case 't':
glob_flags |= GLOB_TILDE;
break;
case 'T':
glob_flags |= GLOB_TILDE_CHECK;
break;
default:
exit (-1);
}

View File

@ -215,12 +215,12 @@ eval echo ~$USER > $testout2
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} \

View File

@ -333,6 +333,18 @@ getanswer(answer, anslen, qname, qtype)
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\"",

View File

@ -456,6 +456,16 @@ getanswer_r (const querybuf *answer, int anslen, const char *qname, int qtype,
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,

View File

@ -58,6 +58,9 @@ typedef void (*__sighandler_t) __PMT ((int));
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.

View File

@ -493,7 +493,7 @@ glob (pattern, flags, errfunc, pglob)
{
/* 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);
@ -553,7 +553,7 @@ glob (pattern, flags, errfunc, pglob)
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] == '/')
{
@ -608,7 +608,10 @@ glob (pattern, flags, errfunc, pglob)
}
}
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. */
@ -685,6 +688,11 @@ glob (pattern, flags, errfunc, pglob)
# 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. */
}