]> git.saurik.com Git - cydia.git/commitdiff
Narrow window during which uicache race can occur. v1.1.26
authorJay Freeman (saurik) <saurik@saurik.com>
Wed, 21 Oct 2015 18:54:42 +0000 (11:54 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Wed, 21 Oct 2015 18:54:42 +0000 (11:54 -0700)
Library/move.sh

index 54750cd43634b84c674811768745ad32c6fb350e..1e9dbb22cf88ce8f9ca61fadf9a14b691b10644b 100755 (executable)
@@ -39,6 +39,8 @@ function mv_() {
         exit 1
     }
 
+    echo -n "${src}" >"${tmp}.lnk"
+
     if [[ -e ${src} ]]; then
         chmod --reference="${src}" "${dst}"
         chown --reference="${src}" "${dst}"
@@ -48,14 +50,14 @@ function mv_() {
             exit 1
         }
 
-        rm -rf $v "${src}"
+        mv $v "${src}" "${src}.moved"
+        ln -s "${dst}" "${src}"
+        rm -rf $v "${src}.moved"
     else
         chmod 775 "${dst}"
         chown root.admin "${dst}"
+        ln -s "${dst}" "${src}"
     fi
-
-    ln -s "${dst}" "${src}"
-    echo -n "${src}" >"${tmp}.lnk"
 }
 
 function shift_() {