another update from the hurd guys
authorBdale Garbee <bdale@gag.com>
Tue, 1 Nov 2011 12:56:37 +0000 (06:56 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 1 Nov 2011 12:56:37 +0000 (06:56 -0600)
debian/changelog
debian/patches/fix_FTBFS4Hurd.diff

index 36b47f4d89429f95de7008451d39345692e8280e..0e001ac2ee63d8147efdb703ce6380ec90b1f146 100644 (file)
@@ -1,3 +1,9 @@
+pax (1:20090728-4) unstable; urgency=low
+
+  * updated patch to fix hurd FTBFS, closes: #645346
+
+ -- Bdale Garbee <bdale@gag.com>  Tue, 01 Nov 2011 06:55:59 -0600
+
 pax (1:20090728-3) unstable; urgency=low
 
   * switch to use of dh
index 68bcbd545960b4eeb5ee0802c39b64ac0dd0acc7..1be9590732117dade95446615215a156ff219de2 100644 (file)
@@ -1,6 +1,6 @@
 diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
 --- pax-20090728/file_subs.c   2009-07-28 17:38:28.000000000 +0000
-+++ pax-20090728.modified/file_subs.c  2011-10-15 12:56:46.000000000 +0000
++++ pax-20090728.modified/file_subs.c  2011-10-31 17:39:17.000000000 +0000
 @@ -351,7 +351,7 @@
        int pass = 0;
        mode_t file_mode;
@@ -23,11 +23,26 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
 +                                      }
                                        len = readlink(nm, target,
 -                                          sizeof target - 1);
-+                                          sb.st_size);
++                                          sb.st_size + 1);
                                        if (len == -1) {
                                                syswarn(0, errno,
                                                   "cannot follow symlink %s in chain for %s",
-@@ -411,6 +418,7 @@
+@@ -383,6 +390,14 @@
+                                               res = -1;
+                                               goto badlink;
+                                       }
++                                      if (len > sb.st_size) {
++                                              syswarn(0, errno,
++                                                 "symlink %s increased in size between lstat() and readlink() for %s",
++                                                  nm, arcn->name);
++
++                                              res = -1;
++                                              goto badlink;
++                                      }
+                                       target[len] = '\0';
+                                       nm = target;
+                               }
+@@ -411,6 +426,7 @@
                        paxwarn(0,
                            "%s skipped. Sockets cannot be copied or extracted",
                            nm);
@@ -35,7 +50,7 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
                        return(-1);
                case PAX_SLK:
                        res = symlink(arcn->ln_name, nm);
-@@ -425,6 +433,7 @@
+@@ -425,6 +441,7 @@
                         */
                        paxwarn(0, "%s has an unknown file type, skipping",
                                nm);
@@ -43,7 +58,7 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
                        return(-1);
                }
  
-@@ -440,14 +449,17 @@
+@@ -440,14 +457,17 @@
                 * we failed to make the node
                 */
                oerrno = errno;
@@ -62,7 +77,7 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
                        return(-1);
                }
        }
-@@ -465,8 +477,10 @@
+@@ -465,8 +485,10 @@
        /*
         * symlinks are done now.
         */
@@ -74,7 +89,7 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
  
        /*
         * IMPORTANT SECURITY NOTE:
-@@ -517,6 +531,7 @@
+@@ -517,6 +539,7 @@
  
        if (patime || pmtime)
                set_ftime(nm, arcn->sb.st_mtime, arcn->sb.st_atime, 0);
@@ -84,12 +99,12 @@ diff -ur pax-20090728/file_subs.c pax-20090728.modified/file_subs.c
  
 diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
 --- pax-20090728/tables.c      2009-07-28 17:38:28.000000000 +0000
-+++ pax-20090728.modified/tables.c     2011-10-15 13:39:29.000000000 +0000
++++ pax-20090728.modified/tables.c     2011-10-31 17:17:26.000000000 +0000
 @@ -55,6 +55,7 @@
  #include "pax.h"
  #include "tables.h"
  #include "extern.h"
-+#include "features.h"
++#include <unistd.h>
  
  /*
   * Routines for controlling the contents of all the different databases pax
@@ -97,7 +112,7 @@ diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
  add_dir(char *name, struct stat *psb, int frc_mode)
  {
        DIRDATA *dblk;
-+#if (_POSIX_C_SOURCE - 0) >= 200809L
++#if (_POSIX_VERSION >= 200809L)
 +      char *rp = NULL;
 +#else
        char realname[MAXPATHLEN], *rp;
@@ -107,7 +122,7 @@ diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
                return;
  
        if (havechd && *name != '/') {
-+#if (_POSIX_C_SOURCE - 0) >= 200809L
++#if (_POSIX_VERSION >= 200809L)
 +              if ((rp = realpath(name, NULL)) == NULL) {
 +#else
                if ((rp = realpath(name, realname)) == NULL) {
@@ -119,7 +134,7 @@ diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
                if (dblk == NULL) {
                        paxwarn(1, "Unable to store mode and times for created"
                            " directory: %s", name);
-+#if (_POSIX_C_SOURCE - 0) >= 200809L
++#if (_POSIX_VERSION >= 200809L)
 +                      free(rp);
 +#endif
                        return;
@@ -129,7 +144,7 @@ diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
        if ((dblk->name = strdup(name)) == NULL) {
                paxwarn(1, "Unable to store mode and times for created"
                    " directory: %s", name);
-+#if (_POSIX_C_SOURCE - 0) >= 200809L
++#if (_POSIX_VERSION >= 200809L)
 +              free(rp);
 +#endif
                return;
@@ -139,7 +154,7 @@ diff -ur pax-20090728/tables.c pax-20090728.modified/tables.c
        dblk->atime = psb->st_atime;
        dblk->frc_mode = frc_mode;
        ++dircnt;
-+#if (_POSIX_C_SOURCE - 0) >= 200809L
++#if (_POSIX_VERSION >= 200809L)
 +      free(rp);
 +#endif
  }