~ubuntu-branches/ubuntu/natty/eglibc/natty-security

« back to all changes in this revision

Viewing changes to debian/patches/kfreebsd/local-ftw.diff

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno
  • Date: 2009-05-05 09:54:14 UTC
  • Revision ID: james.westby@ubuntu.com-20090505095414-6ubwvpmg53otnzqf
Tags: 2.9-11
* Switch to Embedded GLIBC (EGLIBC), sources taken from the 2.9
  branch.
  - Update all/submitted-readme-version.diff.
  - Update any/local-bashisms.diff.
  - Update any/cvs-bz9697-posix-regcomp.diff.
  - Update any/cvs-binutils_2.20.diff.
  - Drop any/local-makeconfig.diff.
  - Drop any/submitted-getcwd-sys_param_h.diff (merged in eglibc).
  - Add any/submitted-cross-zic.diff to fix biarch builds.
  - Add any/submitted-nss-nsswitch.diff to fix linuxthreads builds.
  - Add any/submitted-install-map-files.diff to fix GNU/Hurd builds.
  - More tests of flavour/biarch builds are run, update the expected
    testsuite results accordingly.
  - Rename glibc-source package into eglibc-source.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
disable usage of unimplemented *at functions
 
3
revert to previous behaviour, inspired by
 
4
        http://sourceware.org/ml/glibc-cvs/2006-q1/msg00636.html
 
5
        http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/io/ftw.c.diff?cvsroot=glibc&r1=1.50&r2=1.51
 
6
 
 
7
        http://sourceware.org/cgi-bin/cvsweb.cgi/libc/posix/glob.c.diff?cvsroot=glibc&r1=1.77&r2=1.78
 
8
 
 
9
---
 
10
 io/ftw.c     |    6 ++++++
 
11
 posix/glob.c |   31 +++----------------------------
 
12
 2 files changed, 9 insertions(+), 28 deletions(-)
 
13
 
 
14
--- a/io/ftw.c
 
15
+++ b/io/ftw.c
 
16
@@ -338,6 +338,7 @@
 
17
     {
 
18
       assert (data->dirstreams[data->actdir] == NULL);
 
19
 
 
20
+#if 0
 
21
       if (dfdp != NULL && *dfdp != -1)
 
22
        {
 
23
          int fd = openat64_not_cancel_3 (*dfdp, data->dirbuf + data->ftw.base,
 
24
@@ -347,6 +348,7 @@
 
25
            close_not_cancel_no_status (fd);
 
26
        }
 
27
       else
 
28
+#endif      
 
29
        {
 
30
          const char *name;
 
31
 
 
32
@@ -410,10 +412,12 @@
 
33
   *((char *) __mempcpy (data->dirbuf + data->ftw.base, name, namlen)) = '\0';
 
34
 
 
35
   int statres;
 
36
+#if 0  
 
37
   if (dir->streamfd != -1)
 
38
     statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
 
39
                        (data->flags & FTW_PHYS) ? AT_SYMLINK_NOFOLLOW : 0);
 
40
   else
 
41
+#endif  
 
42
     {
 
43
       if ((data->flags & FTW_CHDIR) == 0)
 
44
        name = data->dirbuf;
 
45
@@ -433,10 +437,12 @@
 
46
        flag = FTW_SLN;
 
47
       else
 
48
        {
 
49
+#if 0  
 
50
          if (dir->streamfd != -1)
 
51
            statres = FXSTATAT (_STAT_VER, dir->streamfd, name, &st,
 
52
                                AT_SYMLINK_NOFOLLOW);
 
53
          else
 
54
+#endif   
 
55
            statres = LXSTAT (_STAT_VER, name, &st);
 
56
          if (statres == 0 && S_ISLNK (st.st_mode))
 
57
            flag = FTW_SLN;
 
58
--- a/posix/glob.c
 
59
+++ b/posix/glob.c
 
60
@@ -1222,42 +1222,21 @@
 
61
    allocated with alloca to be recycled.  */
 
62
 #if !defined _LIBC || !defined GLOB_ONLY_P
 
63
 static int
 
64
-__attribute_noinline__
 
65
-link_exists2_p (const char *dir, size_t dirlen, const char *fname,
 
66
-              glob_t *pglob
 
67
-# ifndef _LIBC
 
68
-               , int flags
 
69
-# endif
 
70
-               )
 
71
+link_exists_p (const char *dir, size_t dirlen, const char *fname,
 
72
+              glob_t *pglob, int flags)
 
73
 {
 
74
   size_t fnamelen = strlen (fname);
 
75
   char *fullname = (char *) __alloca (dirlen + 1 + fnamelen + 1);
 
76
   struct stat st;
 
77
-# ifndef _LIBC
 
78
   struct_stat64 st64;
 
79
-# endif
 
80
 
 
81
   mempcpy (mempcpy (mempcpy (fullname, dir, dirlen), "/", 1),
 
82
           fname, fnamelen + 1);
 
83
 
 
84
-# ifdef _LIBC
 
85
-  return (*pglob->gl_stat) (fullname, &st) == 0;
 
86
-# else
 
87
   return ((__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
 
88
           ? (*pglob->gl_stat) (fullname, &st)
 
89
           : __stat64 (fullname, &st64)) == 0);
 
90
-# endif
 
91
 }
 
92
-# ifdef _LIBC
 
93
-#  define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
 
94
-  (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)                             \
 
95
-   ? link_exists2_p (dirname, dirnamelen, fname, pglob)                              \
 
96
-   : ({ struct stat64 st64;                                                  \
 
97
-       __fxstatat64 (_STAT_VER, dfd, fname, &st64, 0) == 0; }))
 
98
-# else
 
99
-#  define link_exists_p(dfd, dirname, dirnamelen, fname, pglob, flags) \
 
100
-  link_exists2_p (dirname, dirnamelen, fname, pglob, flags)
 
101
-# endif
 
102
 #endif
 
103
 
 
104
 
 
105
@@ -1332,10 +1311,6 @@
 
106
        }
 
107
       else
 
108
        {
 
109
-#ifdef _LIBC
 
110
-         int dfd = (__builtin_expect (flags & GLOB_ALTDIRFUNC, 0)
 
111
-                    ? -1 : dirfd ((DIR *) stream));
 
112
-#endif
 
113
          int fnm_flags = ((!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0)
 
114
                           | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)
 
115
 #if defined _AMIGA || defined VMS
 
116
@@ -1394,7 +1369,7 @@
 
117
                  /* If the file we found is a symlink we have to
 
118
                     make sure the target file exists.  */
 
119
                  if (!DIRENT_MIGHT_BE_SYMLINK (d)
 
120
-                     || link_exists_p (dfd, directory, dirlen, name, pglob,
 
121
+                     || link_exists_p (directory, dirlen, name, pglob,
 
122
                                        flags))
 
123
                    {
 
124
                      if (cur == names->count)