]> git.pld-linux.org Git - packages/poldek.git/commitdiff
Ignore paths longer than 255 characters (lp#1288989). Release 7 auto/th/poldek-0.30.0-7
authorMarcin Banasiak <marcin.banasiak@gmail.com>
Thu, 13 Mar 2014 22:42:42 +0000 (23:42 +0100)
committerMarcin Banasiak <marcin.banasiak@gmail.com>
Thu, 13 Mar 2014 22:42:42 +0000 (23:42 +0100)
poldek-ignore-too-long-paths.patch [new file with mode: 0644]
poldek.spec

diff --git a/poldek-ignore-too-long-paths.patch b/poldek-ignore-too-long-paths.patch
new file mode 100644 (file)
index 0000000..9c25d54
--- /dev/null
@@ -0,0 +1,63 @@
+commit 31658355f3937b67f265e45f70eccfe7af668a70
+Author: Marcin Banasiak <marcin.banasiak@gmail.com>
+Date:   Sun Mar 9 22:16:00 2014 +0100
+
+    Ignore paths longer than 255 characters (lp#1288989)
+    
+    Index format used by poldek prevents us from storing paths longer than
+    255 characters. Changing this behaviour would break backward
+    compatibility, so simply ignore them.
+
+diff --git a/pkgdir/pkgdir_dirindex.c b/pkgdir/pkgdir_dirindex.c
+index abfd05c..3437ee7 100644
+--- a/pkgdir/pkgdir_dirindex.c
++++ b/pkgdir/pkgdir_dirindex.c
+@@ -136,6 +136,9 @@ void add_to_path_index(tn_hash *path_index, const char *path, uint32_t package_n
+     unsigned khash = 0;
+     tn_array *keys;
+     
++    if (strlen(path) > 255)
++      return;
++    
+     if ((keys = n_hash_get_ex(path_index, path, &klen, &khash)) == NULL) {
+         keys = n_array_new(16, free, (tn_fn_cmp)strcmp);
+         n_hash_insert_ex(path_index, path, klen, khash, keys);
+diff --git a/pm/rpm/rpm_pkg_ld.c b/pm/rpm/rpm_pkg_ld.c
+index 5ae167a..3983693 100644
+--- a/pm/rpm/rpm_pkg_ld.c
++++ b/pm/rpm/rpm_pkg_ld.c
+@@ -259,8 +259,9 @@ static int valid_fname(const char *fname, mode_t mode, const char *pkgname)
+ #endif     
+     if (strlen(fname) > 255) {
+-        logn(LOGERR, _("%s: %s \"%s\" longer than 255 bytes"),
+-            pkgname, S_ISDIR(mode) ? _("dirname") : _("filename"), fname);
++      if (poldek_VERBOSE > 1)
++          logn(LOGWARN, _("%s: skipped %s \"%s\" longer than 255 bytes"),
++              pkgname, S_ISDIR(mode) ? _("dirname") : _("filename"), fname);
+         return 0;
+     }
+     
+@@ -335,8 +336,11 @@ int pm_rpm_ldhdr_fl(tn_alloc *na, tn_tuple **fl,
+         struct pkgfl_ent *flent;
+         fentdirs_items[i] = 0;
+-        if (!valid_fname(dirs[i], 0, pkgname))
+-            nerr++;
++        if (!valid_fname(dirs[i], 0, pkgname)) {
++          skipdirs[i] = NULL;
++          fentdirs[i] = NULL;
++            continue;
++        }
+         if (which != PKGFL_ALL) {
+             int is_depdir;
+@@ -374,7 +378,7 @@ int pm_rpm_ldhdr_fl(tn_alloc *na, tn_tuple **fl,
+         int len;
+         if (!valid_fname(names[i], modes ? modes[i] : 0, pkgname))
+-            nerr++;
++            continue;
+         
+         msg(5, "  %d: %s %s/%s \n", i, skipdirs[j] ? "add " : "skip",
+             dirs[j], names[i]);
index 952dd67120969c59c6e189400c80d4230db97b8d..8817c09c04b57049537cd8514b359ec5048fc3bb 100644 (file)
@@ -22,7 +22,7 @@
 %endif
 %define                ver_rpm         5.4.10
 
-%define                rel     6
+%define                rel     7
 Summary:       RPM packages management helper tool
 Summary(hu.UTF-8):     RPM csomagkezelést segítő eszköz
 Summary(pl.UTF-8):     Pomocnicze narzędzie do zarządzania pakietami RPM
@@ -50,6 +50,7 @@ Patch0:               %{name}-size-type.patch
 Patch1:                %{name}-Os-fail-workaround.patch
 Patch2:                %{name}-config.patch
 Patch3:                at-char-completion.patch
+Patch4:                %{name}-ignore-too-long-paths.patch
 URL:           http://poldek.pld-linux.org/
 BuildRequires: %{db_pkg}-devel >= %{ver_db}-%{ver_db_rel}
 BuildRequires: autoconf
@@ -218,6 +219,7 @@ Moduły języka Python dla poldka.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %{__rm} m4/libtool.m4 m4/lt*.m4
 
This page took 0.030781 seconds and 4 git commands to generate.