Skip to content

Cannot write file: outputFile without sudo - with working solution #185

@lightyjoe

Description

@lightyjoe

hblock version 3.5.1

Describe the bug:
Cannot write file: outputFile without sudo being installed on a linux distro.

Steps to reproduce:
Run hblock on a linux distro without sudo being installed.
run0 hblock doesn't work!

Expected behavior:
To write the outputfile /etc/hosts, which does need sudo, doas or run0 on linux.

Environment:
Secureblue based on Fedora Kinoite 42, sudo removed by secureblue for security reasons on purpose, admin tasks are done with run0

Working solution for run0 (would be similar to doas, but I didn't test it):
Add after line 779:

elif exists run0 && exists tee; then
		printOutputFile | run0 tee -- "${outputFile:?}" >/dev/null

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions