]> git.sven.stormbind.net Git - sven/exfat-utils.git/commitdiff
Merge tag 'upstream/1.0.1'
authorSven Hoexter <sven@stormbind.net>
Tue, 5 Feb 2013 20:11:51 +0000 (21:11 +0100)
committerSven Hoexter <sven@stormbind.net>
Tue, 5 Feb 2013 20:11:51 +0000 (21:11 +0100)
Upstream version 1.0.1

ChangeLog
libexfat/io.c
libexfat/node.c
libexfat/version.h

index e24b2d60b651699b3ba001f13752445c4518cfe1..adbf727af2bd2fbaa3ff6123758e842a8d98950e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1.0.1 (2013-02-02)
+
+* Fixed unexpected removal of a directory if it is moved into itself.
+* Fixed "Operation not permitted" error on reading an empty file.
+
 1.0.0 (2013-01-19)
 
 * Fixed crash when renaming a file within a single directory and a new name
index 1a555b969b8df04455afcfebd37122ad8c2d7d6f..4413aaa52ce5b5256a5706a011e652368c0bfc6d 100644 (file)
@@ -341,7 +341,7 @@ ssize_t exfat_generic_pread(const struct exfat* ef, struct exfat_node* node,
        }
        if (!ef->ro && !ef->noatime)
                exfat_update_atime(node);
-       return size - remainder;
+       return MIN(size, node->size - offset) - remainder;
 }
 
 ssize_t exfat_generic_pwrite(struct exfat* ef, struct exfat_node* node,
index cce1de7c0c93eeed5b96887e3f848bf5e369be4a..bc342b780d59292b905ba43a755350bbaf45d82d 100644 (file)
@@ -905,6 +905,23 @@ int exfat_rename(struct exfat* ef, const char* old_path, const char* new_path)
                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 */
index b795e91592fabdc10d942b502865025f697e48e9..debd1853b991d143ea09f7b3382343278b20f55a 100644 (file)
@@ -23,6 +23,6 @@
 
 #define EXFAT_VERSION_MAJOR 1
 #define EXFAT_VERSION_MINOR 0
-#define EXFAT_VERSION_PATCH 0
+#define EXFAT_VERSION_PATCH 1
 
 #endif /* ifndef VERSION_H_INCLUDED */