mirror of
https://github.com/Mailu/Mailu.git
synced 2024-12-12 10:45:38 +02:00
Merge #2791
2791: LD_PRELOAD may not be in ENV r=nextgens a=nextgens ## What type of PR? bug-fix ## What does this PR do? In front, config.py can be called several times. LD_PRELOAD may have already been removed from ENV ### Related issue(s) - close #2789 - #2541 ## Prerequisites Before we can consider review and merge, please make sure the following list is done and checked. If an entry in not applicable, you can check it or remove it from the list. - [ ] In case of feature or enhancement: documentation updated accordingly - [x] Unless it's docs or a minor change: add [changelog](https://mailu.io/master/contributors/workflow.html#changelog) entry file. Co-authored-by: Florent Daigniere <nextgens@freenetproject.org>
This commit is contained in:
commit
1f9cd7db99
@ -68,6 +68,9 @@ def _is_compatible_with_hardened_malloc():
|
||||
# See #2764, we need vmovdqu
|
||||
if line.startswith('flags') and ' avx ' not in line:
|
||||
return False
|
||||
# See #2541
|
||||
if line.startswith('Features') and ' lrcpc ' not in line:
|
||||
return False
|
||||
return True
|
||||
|
||||
def set_env(required_secrets=[], log_filters=[], log_file=None):
|
||||
@ -76,7 +79,8 @@ def set_env(required_secrets=[], log_filters=[], log_file=None):
|
||||
sys.stderr = LogFilter(sys.stderr, log_filters, log_file)
|
||||
log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", 'WARNING'))
|
||||
|
||||
if not _is_compatible_with_hardened_malloc():
|
||||
if 'LD_PRELOAD' in os.environ and not _is_compatible_with_hardened_malloc():
|
||||
log.warning('Disabling hardened-malloc on this CPU')
|
||||
del os.environ['LD_PRELOAD']
|
||||
|
||||
""" This will set all the environment variables and retains only the secrets we need """
|
||||
|
1
towncrier/newsfragments/2789.bugfix
Normal file
1
towncrier/newsfragments/2789.bugfix
Normal file
@ -0,0 +1 @@
|
||||
In front, config.py can be called several times. LD_PRELOAD may have already been removed from ENV
|
Loading…
Reference in New Issue
Block a user