Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: permission denied when modifying temporary hosts file #577

Open
iromli opened this issue Aug 14, 2023 · 0 comments
Open

fix: permission denied when modifying temporary hosts file #577

iromli opened this issue Aug 14, 2023 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@iromli
Copy link
Contributor

iromli commented Aug 14, 2023

The updatelbip.py script unable to modify /etc/hosts.back due to permission issue.

See the following lines:

def backup(hosts):
timenow = time.strftime("%c")
timestamp = "Backup occurred %s \n" % timenow
logger.info("Backing up hosts file to /etc/hosts.back ...")
with open('/etc/hosts.back', 'a+') as f:
f.write(timestamp)
for line in hosts:
f.write(line)

The location of this file should be moved elsewhere to directory where entrypoint has sufficient access, i.e. /etc/certs.

@iromli iromli added the bug Something isn't working label Aug 14, 2023
@iromli iromli unassigned moabu Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants