]> git.saurik.com Git - cydia.git/commitdiff
Add support for unionfs stash check. v1.1.2
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jun 2011 10:23:24 +0000 (03:23 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 27 Jun 2011 10:35:30 +0000 (03:35 -0700)
MobileCydia.mm

index 3e4687538900941eb1856137eff4fd8e3e7346bf..625e34d938f4620dbfaa49cbe5a625552e8abcd7 100644 (file)
@@ -10197,9 +10197,20 @@ _trace();
         return;
     }
 
+    struct stat root;
+    int error(stat("/", &root));
+    _assert(error != -1);
+
     #define Stash_(path) do { \
-        if (readlink((path), NULL, 0) == -1 && errno == EINVAL) \
-            goto stash; \
+        struct stat folder; \
+        int error(lstat((path), &folder)); \
+        if (error != -1 && ( \
+            folder.st_dev == root.st_dev && \
+            S_ISDIR(folder.st_mode) \
+        ) || error == -1 && ( \
+            errno == ENOENT || \
+            errno == ENOTDIR \
+        )) goto stash; \
     } while (false)
 
     Stash_("/Applications");