From: Jay Freeman (saurik) Date: Mon, 27 Jun 2011 10:23:24 +0000 (-0700) Subject: Add support for unionfs stash check. X-Git-Tag: v1.1.2^0 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/2656fd548d3ef726a659e6d5b3bc82b02c86bff2 Add support for unionfs stash check. --- diff --git a/MobileCydia.mm b/MobileCydia.mm index 3e468753..625e34d9 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");