mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
dynamicdns: Allow reading status as non-root
Recently dynamic DNS module was fixed to use root ownership and limited permissions for configuration and status files to avoid other users reading dynmaic DNS account details. This caused a regression when Plinth is being run as non-root user. This patch runs the commands to read the current configuration as root user.
This commit is contained in:
parent
e28f3963c7
commit
5c75eb9649
@ -10,6 +10,7 @@ All notable changes to this project will be documented in this file.
|
||||
- Upstream patch from Debian bug #837206 to fix DB and log file
|
||||
permissions. Also switch to new setup command.
|
||||
- Include module static files in build, required for Debian package build.
|
||||
- dynamicdns: Allow reading status as non-root.
|
||||
|
||||
### Changed
|
||||
- repro: Use firewalld provided SIP services.
|
||||
|
||||
@ -215,12 +215,12 @@ def configure(request):
|
||||
|
||||
def statuspage(request):
|
||||
"""Serve the status page."""
|
||||
check_nat = actions.run('dynamicdns', ['get-nat'])
|
||||
last_update = actions.run('dynamicdns', ['get-last-success'])
|
||||
check_nat = _run(['get-nat'])
|
||||
last_update = _run(['get-last-success'])
|
||||
|
||||
no_nat = check_nat.strip() == 'no'
|
||||
nat_unchecked = check_nat.strip() == 'unknown'
|
||||
timer = actions.run('dynamicdns', ['get-timer'])
|
||||
timer = _run(['get-timer'])
|
||||
|
||||
if no_nat:
|
||||
logger.info('Not behind a NAT')
|
||||
@ -241,7 +241,7 @@ def get_status():
|
||||
"""Return the current status."""
|
||||
# TODO: use key/value instead of hard coded value list
|
||||
status = {}
|
||||
output = actions.run('dynamicdns', ['status'])
|
||||
output = _run(['status'])
|
||||
details = output.split()
|
||||
status['enabled'] = (output.split()[0] == 'enabled')
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user