[update] Copy bitmask from old binary
Improves a6125983ab
Authored by: Lesmiscore
This commit is contained in:
parent
ef6342bd07
commit
6440c45ff3
1 changed files with 2 additions and 1 deletions
|
@ -230,6 +230,7 @@ class Updater:
|
||||||
return self._report_permission_error(new_filename)
|
return self._report_permission_error(new_filename)
|
||||||
|
|
||||||
if old_filename:
|
if old_filename:
|
||||||
|
mask = os.stat(self.filename).st_mode
|
||||||
try:
|
try:
|
||||||
os.rename(self.filename, old_filename)
|
os.rename(self.filename, old_filename)
|
||||||
except OSError:
|
except OSError:
|
||||||
|
@ -251,7 +252,7 @@ class Updater:
|
||||||
self._report_error('Unable to remove the old version')
|
self._report_error('Unable to remove the old version')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
os.chmod(self.filename, 0o777)
|
os.chmod(self.filename, mask)
|
||||||
except OSError:
|
except OSError:
|
||||||
return self._report_error(
|
return self._report_error(
|
||||||
f'Unable to set permissions. Run: sudo chmod a+rx {compat_shlex_quote(self.filename)}')
|
f'Unable to set permissions. Run: sudo chmod a+rx {compat_shlex_quote(self.filename)}')
|
||||||
|
|
Loading…
Reference in a new issue