Skip to content

Commit fe12f8a

Browse files
committed
Add comment to in winetricks_selfupdate and winetricks_selfupdate_rollback warning of race condition
1 parent b792287 commit fe12f8a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/winetricks

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,7 @@ winetricks_selfupdate()
14561456
w_try cp "$0" "${_W_rollback_file}"
14571457
w_try chmod -x "${_W_rollback_file}"
14581458

1459+
# Uses mv to avoid race condition in overwriting running shell script. Do not replace with cp or other non-atomic writes!
14591460
w_try mv "${_W_update_file}" "$0"
14601461
w_try chmod +x "$0"
14611462

@@ -1471,6 +1472,7 @@ winetricks_selfupdate_rollback()
14711472
_W_rollback_file="${0}.bak"
14721473

14731474
if test -f "${_W_rollback_file}"; then
1475+
# Uses mv to avoid race condition in overwriting running shell script. Do not replace with cp or other non-atomic writes!
14741476
w_try mv "${_W_rollback_file}" "$0"
14751477
w_try chmod +x "$0"
14761478
w_warn "Rollback finished! The current version is $($0 -V)."

0 commit comments

Comments
 (0)