From 2656fd548d3ef726a659e6d5b3bc82b02c86bff2 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Mon, 27 Jun 2011 03:23:24 -0700 Subject: Add support for unionfs stash check. --- MobileCydia.mm | 15 +++++++++++++-- 1 file 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"); -- cgit v1.2.3