diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2015-10-21 11:54:42 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2015-10-21 11:54:42 -0700 |
commit | 0193c0d3e1633676d73477d3fb2c2be319e9da1b (patch) | |
tree | faa44d359ea22c2b5a0e57232fbfce942efd4316 | |
parent | a8c416fa7b8a15e97436422a7d8064473d156cf3 (diff) |
Narrow window during which uicache race can occur.v1.1.26
-rwxr-xr-x | Library/move.sh | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Library/move.sh b/Library/move.sh index 54750cd..1e9dbb2 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -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_() { |