X-Git-Url: http://git.sven.stormbind.net/?a=blobdiff_plain;f=debian%2Fpatches%2Ffix-unexpected-removal-on-dir-move-r337.patch;fp=debian%2Fpatches%2Ffix-unexpected-removal-on-dir-move-r337.patch;h=376fb8240002c3a856ea03e4e6a254ebabc6748c;hb=a74a95ae5b5a6e063356838136067e049b30acc1;hp=0000000000000000000000000000000000000000;hpb=51e00c5a787581f657f54b9c0e65796dda3ba34f;p=sven%2Ffuse-exfat.git 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 index 0000000..376fb82 --- /dev/null +++ b/debian/patches/fix-unexpected-removal-on-dir-move-r337.patch @@ -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 */