mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-03 08:11:08 +00:00
Update.
2001-12-10 Thorsten Kukuk <kukuk@suse.de> * io/ftw.c (ftw_startup): Check, if the path is search and readable. * io/Makefile (tests): Add bug-ftw3. * io/bug-ftw3.c: New file.
This commit is contained in:
parent
870a4e1253
commit
1b11359804
@ -1,5 +1,12 @@
|
||||
2001-12-10 Thorsten Kukuk <kukuk@suse.de>
|
||||
|
||||
* io/ftw.c (ftw_startup): Check, if the path is search and readable.
|
||||
|
||||
2001-12-10 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* io/Makefile (tests): Add bug-ftw3.
|
||||
* io/bug-ftw3.c: New file.
|
||||
|
||||
* sysdeps/generic/glob.c (glob): Return only pattern if nothing
|
||||
matches and GLOB_NOCHECK is set.
|
||||
* posix/globtest.sh: Correct expected result for NOCHECK test.
|
||||
|
@ -56,7 +56,7 @@ static-only-routines = stat fstat lstat mknod stat64 fstat64 lstat64
|
||||
others := pwd
|
||||
test-srcs := ftwtest
|
||||
tests := test-utime test-stat test-stat2 test-lfs tst-getcwd \
|
||||
tst-fcntl bug-ftw1 bug-ftw2
|
||||
tst-fcntl bug-ftw1 bug-ftw2 bug-ftw3
|
||||
|
||||
distribute := ftwtest-sh
|
||||
|
||||
|
46
io/bug-ftw3.c
Normal file
46
io/bug-ftw3.c
Normal file
@ -0,0 +1,46 @@
|
||||
#include <errno.h>
|
||||
#include <ftw.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int
|
||||
cb (const char *fname, const struct stat *st, int flag)
|
||||
{
|
||||
printf ("%s %d\n", fname, flag);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
char tmp[] = "/tmp/ftwXXXXXX";
|
||||
char *dname;
|
||||
int r;
|
||||
int e;
|
||||
|
||||
dname = mkdtemp (tmp);
|
||||
if (dname == NULL)
|
||||
{
|
||||
printf ("mkdtemp: %m\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
if (chmod (dname, S_IWUSR|S_IXUSR|S_IWGRP|S_IXGRP|S_IWOTH|S_IXOTH) != 0)
|
||||
{
|
||||
printf ("chmod: %m\n");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
r = ftw (dname, cb, 10);
|
||||
e = errno;
|
||||
printf ("r = %d", r);
|
||||
if (r != 0)
|
||||
printf (", errno = %d", errno);
|
||||
puts ("");
|
||||
|
||||
chmod (dname, S_IRWXU|S_IRWXG|S_IRWXO);
|
||||
rmdir (dname);
|
||||
|
||||
return r != -1 && e == EACCES;
|
||||
}
|
Loading…
Reference in New Issue
Block a user