diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2011-06-27 03:23:24 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2011-06-27 03:35:30 -0700 |
commit | 2656fd548d3ef726a659e6d5b3bc82b02c86bff2 (patch) | |
tree | ce5e7909cfe85ab6822c9a55e1b9de07716f2498 | |
parent | 96ed699dbb7d7c81c7cc8f245d561d1b91cb96df (diff) |
Add support for unionfs stash check.v1.1.2
-rw-r--r-- | MobileCydia.mm | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm index 3e46875..625e34d 100644 --- a/MobileCydia.mm +++ b/MobileCydia.mm @@ -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"); |