[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#682393: unblock: bindfs/1.10.3-2



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Hello, please unblock package bindfs which fixes a grave bug #681647.
Diff attached.


unblock bindfs/1.10.3-2

-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-2-686-pae (SMP w/2 CPU cores)
Locale: LANG=fi_FI.UTF-8, LC_CTYPE=fi_FI.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..5dde0bf
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,58 @@
+This package uses quilt to manage all modifications to the upstream
+source.  Changes are stored in the source package as diffs in
+debian/patches and applied during the build.
+
+To configure quilt to use debian/patches instead of patches, you want
+either to export QUILT_PATCHES=debian/patches in your environment
+or use this snippet in your ~/.quiltrc:
+
+    for where in ./ ../ ../../ ../../../ ../../../../ ../../../../../; do
+        if [ -e ${where}debian/rules -a -d ${where}debian/patches ]; then
+                export QUILT_PATCHES=debian/patches
+                break
+        fi
+    done
+
+To get the fully patched source after unpacking the source package, cd to
+the root level of the source package and run:
+
+    quilt push -a
+
+The last patch listed in debian/patches/series will become the current
+patch.
+
+To add a new set of changes, first run quilt push -a, and then run:
+
+    quilt new <patch>
+
+where <patch> is a descriptive name for the patch, used as the filename in
+debian/patches.  Then, for every file that will be modified by this patch,
+run:
+
+    quilt add <file>
+
+before editing those files.  You must tell quilt with quilt add what files
+will be part of the patch before making changes or quilt will not work
+properly.  After editing the files, run:
+
+    quilt refresh
+
+to save the results as a patch.
+
+Alternately, if you already have an external patch and you just want to
+add it to the build system, run quilt push -a and then:
+
+    quilt import -P <patch> /path/to/patch
+    quilt push -a
+
+(add -p 0 to quilt import if needed). <patch> as above is the filename to
+use in debian/patches.  The last quilt push -a will apply the patch to
+make sure it works properly.
+
+To remove an existing patch from the list of patches that will be applied,
+run:
+
+    quilt delete <patch>
+
+You may need to run quilt pop -a to unapply patches first before running
+this command.
diff --git a/debian/changelog b/debian/changelog
index 34c18fe..d0ea609 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,20 @@
+bindfs (1.10.3-2) unstable; urgency=medium
+
+  * debian/control:
+    - Build-depend on quilt.
+  * debian/rules:
+    - Use 'dh --with quilt'.
+  * debian/patches:
+    - New patch '010-readdir-pathconf-fix.patch'.
+    - New patch '020-usermap-memory-fix.patch'.
+    - Two patches above fix serious memory errors. Thanks to
+      Marcelo E. Magallon for the report and upstream for providing directed
+      patches. (Closes: #681647)
+  * debian/README.source:
+    - Added with standard quilt intructions.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Sun, 15 Jul 2012 13:30:45 +0300
+
 bindfs (1.10.3-1) unstable; urgency=low
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index f9e64fb..c53e07e 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,8 @@ Source: bindfs
 Section: utils
 Priority: optional
 Maintainer: Eugene V. Lyubimkin <jackyf@debian.org>
-Build-Depends: debhelper (>= 7.0.50), autotools-dev, libfuse-dev, pkg-config
+Build-Depends: debhelper (>= 7.0.50), autotools-dev, libfuse-dev, pkg-config,
+  quilt (>= 0.46-7)
 Standards-Version: 3.9.3
 Homepage: http://code.google.com/p/bindfs/
 
diff --git a/debian/patches/010-readdir-pathconf-fix.patch b/debian/patches/010-readdir-pathconf-fix.patch
new file mode 100644
index 0000000..28639ac
--- /dev/null
+++ b/debian/patches/010-readdir-pathconf-fix.patch
@@ -0,0 +1,29 @@
+--- bindfs-1.10.3/src/bindfs.c	2012-05-18 16:45:33.000000000 +0300
++++ bindfs-new/src/bindfs.c	2012-07-15 12:12:39.748468808 +0300
+@@ -54,6 +54,7 @@
+ #include <assert.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <limits.h>
+ #ifdef HAVE_SETXATTR
+ #include <sys/xattr.h>
+ #endif
+@@ -399,9 +400,16 @@
+     struct dirent *de;
+     struct stat st;
+     int result = 0;
+-    (void) path;
++    long pc_ret;
+     
+-    de_buf = malloc(offsetof(struct dirent, d_name) + pathconf(path, _PC_NAME_MAX) + 1);
++    path = process_path(path);
++    
++    pc_ret = pathconf(path, _PC_NAME_MAX);
++    if (pc_ret < 0) {
++        DPRINTF("pathconf failed: %d", errno);
++        pc_ret = NAME_MAX;
++    }
++    de_buf = malloc(offsetof(struct dirent, d_name) + pc_ret + 1);
+     
+     seekdir(dp, offset);
+     while (1) {
diff --git a/debian/patches/020-usermap-memory-fix.patch b/debian/patches/020-usermap-memory-fix.patch
new file mode 100644
index 0000000..77c8a45
--- /dev/null
+++ b/debian/patches/020-usermap-memory-fix.patch
@@ -0,0 +1,28 @@
+--- bindfs-1.10.3/src/usermap.c	2012-05-18 16:45:33.000000000 +0300
++++ bindfs-1.10.4/src/usermap.c	2012-06-18 08:57:55.000000000 +0300
+@@ -44,7 +44,11 @@
+         return usermap_status_ok;
+     }
+     if (map->user_size == map->user_capacity) {
+-        map->user_capacity *= 2;
++        if (map->user_capacity == 0) {
++            map->user_capacity = 8;
++        } else {
++            map->user_capacity *= 2;
++        }
+         map->user_from = (uid_t*)realloc(map->user_from, map->user_capacity * sizeof(uid_t));
+         map->user_to = (uid_t*)realloc(map->user_to, map->user_capacity * sizeof(uid_t));
+     }
+@@ -65,7 +69,11 @@
+         return usermap_status_ok;
+     }
+     if (map->group_size == map->group_capacity) {
+-        map->group_capacity *= 2;
++        if (map->group_capacity == 0) {
++            map->group_capacity = 8;
++        } else {
++            map->group_capacity *= 2;
++        }
+         map->group_from = (gid_t*)realloc(map->group_from, map->group_capacity * sizeof(gid_t));
+         map->group_to = (gid_t*)realloc(map->group_to, map->group_capacity * sizeof(gid_t));
+     }
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..0255bdb
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+020-usermap-memory-fix.patch
+010-readdir-pathconf-fix.patch
diff --git a/debian/rules b/debian/rules
index 2c4d59b..7d11398 100755
--- a/debian/rules
+++ b/debian/rules
@@ -2,7 +2,7 @@
 # -*- makefile -*-
 
 %:
-	dh $@
+	dh --with quilt $@
 
 override_dh_auto_configure:
 	[ -r config.sub.orig ] || \

Reply to: