mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Linux installer: Also fix the execute bits in the umask if the user runs the installer with a umask that prevents files from being world executable.
Merge branch 'master' of https://github.com/jgoguen/calibre
This commit is contained in:
commit
efa7e9e0b1
@ -694,9 +694,12 @@ def check_umask():
|
||||
mask = os.umask(18) # 18 = 022
|
||||
os.umask(mask)
|
||||
forbid_user_read = mask & stat.S_IRUSR
|
||||
forbid_user_exec = mask & stat.S_IXUSR
|
||||
forbid_group_read = mask & stat.S_IRGRP
|
||||
forbid_group_exec = mask & stat.S_IXGRP
|
||||
forbid_other_read = mask & stat.S_IROTH
|
||||
if forbid_user_read or forbid_group_read or forbid_other_read:
|
||||
forbid_other_exec = mask & stat.S_IXOTH
|
||||
if forbid_user_read or forbid_user_exec or forbid_group_read or forbid_group_exec or forbid_other_read or forbid_other_exec:
|
||||
prints(
|
||||
'WARNING: Your current umask disallows reading of files by some users,'
|
||||
' this can cause system breakage when running the installer because'
|
||||
@ -709,7 +712,7 @@ def check_umask():
|
||||
break
|
||||
prints('Response', q, 'not understood')
|
||||
if q == 'f':
|
||||
mask = mask & ~stat.S_IRUSR & ~stat.S_IRGRP & ~stat.S_IROTH
|
||||
mask = mask & ~stat.S_IRUSR & ~stat.S_IXUSR & ~stat.S_IRGRP & ~stat.S_IXGRP & ~stat.S_IROTH & ~stat.S_IXOTH
|
||||
os.umask(mask)
|
||||
prints('umask changed to: {:03o}'.format(mask))
|
||||
elif q == 'i':
|
||||
|
@ -743,9 +743,12 @@ def check_umask():
|
||||
mask = os.umask(18) # 18 = 022
|
||||
os.umask(mask)
|
||||
forbid_user_read = mask & stat.S_IRUSR
|
||||
forbid_user_exec = mask & stat.S_IXUSR
|
||||
forbid_group_read = mask & stat.S_IRGRP
|
||||
forbid_group_exec = mask & stat.S_IXGRP
|
||||
forbid_other_read = mask & stat.S_IROTH
|
||||
if forbid_user_read or forbid_group_read or forbid_other_read:
|
||||
forbid_other_exec = mask & stat.S_IXOTH
|
||||
if forbid_user_read or forbid_user_exec or forbid_group_read or forbid_group_exec or forbid_other_read or forbid_other_exec:
|
||||
prints(
|
||||
'WARNING: Your current umask disallows reading of files by some users,'
|
||||
' this can cause system breakage when running the installer because'
|
||||
@ -758,7 +761,7 @@ def check_umask():
|
||||
break
|
||||
prints('Response', q, 'not understood')
|
||||
if q == 'f':
|
||||
mask = mask & ~stat.S_IRUSR & ~stat.S_IRGRP & ~stat.S_IROTH
|
||||
mask = mask & ~stat.S_IRUSR & ~stat.S_IXUSR & ~stat.S_IRGRP & ~stat.S_IXGRP & ~stat.S_IROTH & ~stat.S_IXOTH
|
||||
os.umask(mask)
|
||||
prints('umask changed to: {:03o}'.format(mask))
|
||||
elif q == 'i':
|
||||
|
Loading…
x
Reference in New Issue
Block a user