--- bindfs-1.10.3.orig/debian/dirs
+++ bindfs-1.10.3/debian/dirs
@@ -0,0 +1 @@
+usr/bin
--- bindfs-1.10.3.orig/debian/copyright
+++ bindfs-1.10.3/debian/copyright
@@ -0,0 +1,65 @@
+This package was debianized by Eugene V. Lyubimkin <jackyf.devel@gmail.com> on
+Wed, 25 Jun 2008 00:36:27 +0300.
+
+It was downloaded from http://code.google.com/p/bindfs/downloads/list
+
+Upstream Author: 
+
+    Martin Pärtel <martin.partel@gmail.com>
+
+
+src/bindfs.c, src/debug.h, src/misc.c, src/misc.h, src/permchain.c,
+src/permchain.h, src/userinfo.c, src/userinfo.h, tests/test_bindfs.rb:
+    Copyright (C) 2006-2012 Martin Pärtel <martin.partel@gmail.com> 
+    Copyright (C) 2001-2006 Miklos Szeredi <miklos@szeredi.hu> (src/bindfs.c only)
+
+    License:
+
+	This package is free software; you can redistribute it and/or modify it
+	under the terms of the GNU General Public License version 2 as published by
+	the Free Software Foundation; 
+ 
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+On Debian systems, the complete text of the GNU General
+Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
+
+aclocal.m4, config.guess, config.sub, configure, depcomp, libtool, ltmain.sh,
+missing, src/Makefile.in, tests/Makefile.in:
+	Copyright (C) 1992-2008 Free Software Foundation, Inc.
+	Copyright (C) Scott James Remnant <scott@netsplit.com> (aclocal.m4 only)
+
+	License:
+
+	This package is free software; you can redistribute it and/or modify it
+	under the terms of the GNU General Public License as published by the Free
+	Software Foundation, either version 2 or any later version; 
+ 
+    This package is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+ 
+    You should have received a copy of the GNU General Public License
+    along with this package; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+
+install-sh:
+	Copyright (C) 1994 X Consortium
+
+	License: public domain.
+
+
+On Debian systems, the complete text of the GNU General
+Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'.
+
+The Debian packaging is Copyright (C) 2008-2010, Eugene V. Lyubimkin
+<jackyf@debian.org> and is licensed under the GPLv3, see above.
+
--- bindfs-1.10.3.orig/debian/changelog
+++ bindfs-1.10.3/debian/changelog
@@ -0,0 +1,177 @@
+bindfs (1.10.3-2.4.201403142012) ucs4-0-0-0; urgency=low
+
+  * UCS auto build. No patches were applied to the original source package
+
+ -- Univention builddaemon <buildd@univention.de>  Fri, 14 Mar 2014 20:12:43 +0100
+
+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.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Mon, 21 May 2012 16:40:41 +0300
+
+bindfs (1.10.2-1) unstable; urgency=low
+
+  * New upstream release.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Sat, 07 Apr 2012 10:47:53 +0300
+
+bindfs (1.10-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/control:
+    - Bumped Standards-Version to 3.9.3, no changes needed.
+  * debian/copyright:
+    - Updated upstream copyright years.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Thu, 22 Mar 2012 20:44:18 +0200
+
+bindfs (1.9-3) unstable; urgency=low
+
+  * debian/rules:
+    - Rewrote using debhelper v7 to make them simpler.
+  * debian/control:
+    - Bumped debhelper dependency to use debhelper v7 short style and
+      overrides.
+    - Bumped Standards-Version to 3.9.2, no changes needed.
+    - Depend on fuse4bsd on kFreeBSD arches. Thanks to Martin Pärtel and
+      Robert Millan for the analysis. (Closes: #634456)
+  * debian/compat:
+    - Bumped to 7.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Fri, 22 Jul 2011 21:17:08 +0300
+
+bindfs (1.9-2) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Sat, 19 Feb 2011 09:33:59 +0200
+
+bindfs (1.9-1) experimental; urgency=low
+
+  * New upstream release.
+  * debian/copyright:
+    - Updated packaging copyright and e-mail.
+  * debian/control:
+    - Added '.' to the end of the long description.
+    - Bumped Standards-Version to 3.9.1, no changes needed.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Sat, 13 Nov 2010 12:12:01 +0200
+
+bindfs (1.8.4-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/copyright:
+    - Updated copyright years.
+  * debian/control:
+    - Bump Standards-Version to 3.8.4, no changes needed.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Sat, 20 Feb 2010 16:43:13 +0200
+
+bindfs (1.8.3-2) unstable; urgency=low
+
+  * debian/control:
+    - Depend on fuse-utils.
+    - Updated my mail address.
+    - Bumped Standards-Version to 3.8.3, no changes needed.
+
+ -- Eugene V. Lyubimkin <jackyf@debian.org>  Fri, 30 Oct 2009 11:46:48 +0200
+
+bindfs (1.8.3-1) unstable; urgency=low
+
+  * New upstream release, some changes:
+    - 1.8.3:
+      - Added --ctime-from-mtime option.
+      - Added --chmod-allow-x option.
+    - 1.8.1:
+      - Made xattr-rw the default instead of xattr-ro,
+  * debian/control:
+    - Bumped 'Standards-Version' to 3.8.1, no changes needed.
+  * debian/rules:
+    - Removed some cruft.
+    - Made handling of config.{sub,guess} more robust (thanks to Roger Leigh).
+  * debian/copyright:
+    - Clarified that the Debian packaging is under GPLv3 license.
+    - Renewed upstream copyright according to changes in sources.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Thu, 02 Apr 2009 21:23:17 +0300
+
+bindfs (1.8-1) unstable; urgency=low
+
+  * New upstream bugfix release.
+  * debian/patches:
+    - No patches remains, deleted.
+  * debian/control:
+    - Removed build-dependency on quilt.
+  * debian/rules:
+    - Removed quilt stuff.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Sun, 17 Aug 2008 16:53:21 +0300
+
+bindfs (1.7-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/patches:
+    - Removed 100-changelog-dates.patch, merged upstream.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Tue, 08 Jul 2008 00:24:18 +0300
+
+bindfs (1.6.2-1) unstable; urgency=low
+
+  * New upstream release.
+  * debian/rules:
+    - Suppressed useless warnings from dh_shlibdeps.
+  * debian/changelog:
+    - Fixed misspellings.
+  * debian/patches:
+    - Removed 850-all-dashes-and-copyrights.patch, merged upstream.
+    - Removed 800-bindfs_add_man_page_equals.patch, merged upstream.
+    - Added new 100-changelog-dates.patch, pulled from upstream.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Fri, 27 Jun 2008 21:55:55 +0300
+
+bindfs (1.6.1-3) unstable; urgency=low
+
+  * debian/copyright:
+    - Fixed typo: 'bindfs.h' -> 'bindfs.c'
+    - Added one missing file to copyright.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Wed, 25 Jun 2008 22:33:31 +0300
+
+bindfs (1.6.1-2) unstable; urgency=low
+
+  * debian/copyright:
+    - Fixed erroneously swapped copyrights.
+  * debian/control:
+    - Enhanced long description as suggested by author.
+    - Added 'Homepage' field.
+  * debian/patches:
+    - Removed 810-substitute_hyphens_to_minuses_in_man_page.patch, merged
+      upstream.
+    - Added new 850-all-dashes-and-copyrights.patch, pulled from upstream.
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Wed, 25 Jun 2008 20:51:55 +0300
+
+bindfs (1.6.1-1) unstable; urgency=low
+
+  * Initial release (Closes: #481610).
+
+ -- Eugene V. Lyubimkin <jackyf.devel@gmail.com>  Wed, 25 Jun 2008 00:36:27 +0300
+
--- bindfs-1.10.3.orig/debian/compat
+++ bindfs-1.10.3/debian/compat
@@ -0,0 +1 @@
+7
--- bindfs-1.10.3.orig/debian/rules
+++ bindfs-1.10.3/debian/rules
@@ -0,0 +1,32 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+%:
+	dh --with quilt $@
+
+override_dh_auto_configure:
+	[ -r config.sub.orig ] || \
+		cp -f config.sub config.sub.orig
+	[ -r config.guess.orig ] || \
+		cp -f config.guess config.guess.orig
+	
+	[ ! -r /usr/share/misc/config.sub ] || \
+		cp -f /usr/share/misc/config.sub config.sub
+	[ ! -r /usr/share/misc/config.guess ] || \
+		cp -f /usr/share/misc/config.guess config.guess
+
+	dh_auto_configure
+
+
+override_dh_clean:
+	([ -f Makefile ] && $(MAKE) distclean) || true
+	[ ! -r config.guess.orig ] || \
+		mv -f config.guess.orig config.guess || :
+	[ ! -r config.sub.orig ] || \
+		mv -f config.sub.orig config.sub || :
+	
+	dh_clean 
+
+override_dh_auto_test:
+	# tests depend on Ruby, I (jackyf) don't want it in the Build-Depends
+	
--- bindfs-1.10.3.orig/debian/README.source
+++ bindfs-1.10.3/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.
--- bindfs-1.10.3.orig/debian/control
+++ bindfs-1.10.3/debian/control
@@ -0,0 +1,27 @@
+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,
+  quilt (>= 0.46-7)
+Standards-Version: 3.9.3
+Homepage: http://code.google.com/p/bindfs/
+
+Package: bindfs
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}, fuse [linux-any] | fuse4bsd [kfreebsd-any]
+Description: mirrors or overlays a local directory with altered permissions
+ bindfs is a FUSE filesystem for mirroring a directory to another
+ directory, similarly to mount --bind. The permissions of the mirrored
+ directory can be altered in various ways.
+ .
+ Some things bindfs can be used for:
+  - Making a directory read-only.
+  - Making all executables non-executable.
+  - Sharing a directory with a list of users (or groups).
+  - Modifying permission bits using rules with chmod-like syntax.
+  - Changing the permissions with which files are created.
+ .
+ Non-root users can use almost all features, but most interesting 
+ use-cases need user_allow_other to be defined in /etc/fuse.conf.
+
--- bindfs-1.10.3.orig/debian/docs
+++ bindfs-1.10.3/debian/docs
@@ -0,0 +1,2 @@
+README
+TODO
--- bindfs-1.10.3.orig/debian/watch
+++ bindfs-1.10.3/debian/watch
@@ -0,0 +1,4 @@
+version=3
+
+http://code.google.com/p/bindfs/downloads/list .*/bindfs-(.+)\.tar\.gz
+
--- bindfs-1.10.3.orig/debian/patches/020-usermap-memory-fix.patch
+++ bindfs-1.10.3/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));
+     }
--- bindfs-1.10.3.orig/debian/patches/010-readdir-pathconf-fix.patch
+++ bindfs-1.10.3/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) {
--- bindfs-1.10.3.orig/debian/patches/series
+++ bindfs-1.10.3/debian/patches/series
@@ -0,0 +1,2 @@
+020-usermap-memory-fix.patch
+010-readdir-pathconf-fix.patch
