]> git.sven.stormbind.net Git - sven/fuse-exfat.git/commitdiff
Add debian/patches/fix-unexpected-removal-on-dir-move-r337.patch Fixes unexpected...
authorSven Hoexter <sven@stormbind.net>
Fri, 25 Jan 2013 21:17:55 +0000 (22:17 +0100)
committerSven Hoexter <sven@stormbind.net>
Fri, 25 Jan 2013 21:41:18 +0000 (22:41 +0100)
debian/changelog
debian/patches/fix-unexpected-removal-on-dir-move-r337.patch [new file with mode: 0644]

index 09027d93a892d2681a83229743123ba194ea5f7e..817b6ebad3b589c7ce988e9b024cfa05b6103e50 100644 (file)
@@ -3,6 +3,8 @@ fuse-exfat (1.0.0-2) UNRELEASED; urgency=low
   * Build depend on quilt, use dh --with quilt.
   * Add debian/patches/fix-fuse-read-write-return-r336.patch
     Fixes "Operation not permitted" error reporting on empty files.
+  * Add debian/patches/fix-unexpected-removal-on-dir-move-r337.patch
+    Fixes unexpected removal of a directory if you move it into itself.
 
  -- Sven Hoexter <hoexter@debian.org>  Fri, 25 Jan 2013 21:53:16 +0100
 
diff --git a/debian/patches/fix-unexpected-removal-on-dir-move-r337.patch b/debian/patches/fix-unexpected-removal-on-dir-move-r337.patch
new file mode 100644 (file)
index 0000000..376fb82
--- /dev/null
@@ -0,0 +1,32 @@
+Fixed unexpected removal of a directory if it is moved into itself: return
+EINVAL in this situation. It also happens when trying to change directory name
+case.
+Picked from upstream svn r337.
+Index: libexfat/node.c
+===================================================================
+--- libexfat/node.c.orig       2013-01-25 22:09:06.197124362 +0100
++++ libexfat/node.c    2013-01-25 22:11:41.273118704 +0100
+@@ -905,6 +905,23 @@
+               exfat_put_node(ef, node);
+               return rc;
+       }
++
++      /* check that target is not a subdirectory of the source */
++      if (node->flags & EXFAT_ATTRIB_DIR)
++      {
++              struct exfat_node* p;
++
++              for (p = dir; p; p = p->parent)
++                      if (node == p)
++                      {
++                              if (existing != NULL)
++                                      exfat_put_node(ef, existing);
++                              exfat_put_node(ef, dir);
++                              exfat_put_node(ef, node);
++                              return -EINVAL;
++                      }
++      }
++
+       if (existing != NULL)
+       {
+               /* remove target if it's not the same node as source */