anatol / booster

Fast and secure initramfs generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Potentially remove sudo dependency?

thomasfsteeples opened this issue · comments

Many of the scripts embedded in the test suite (such as TestBlkInfoLVM and TestBlkInfoMdraid in init and the generator scripts in the integration tests) use sudo to raise privileges in order to perform certain filesystem manipulations. However, some systems are sudo-less, like machines with a single root account, or those who use doas instead.

It's also tricky running the test suite for those of us with sudo persistence turned off. I either have to run go test -v and enter my password multiple times as the tests progress, or run sudo go test -v, and get a failure because my root account isn't allowed to use sudo. Given this, would it be appropriate to introduce checks in all the scripts for the EUID, proceeding if it's 0, and aborting otherwise, removing the sudo calls, and calling go test with sudo instead? With this having been said, I do also appreciate that having your whole test suite needing to be run as root may be undesirable.

@anatol, if you feel like this might be an appropriate change to the codebase, I'm happy to do the work and submit a pull request, but just thought I'd check your thoughts first. What do you think?

I use only sudo. But having support for other options is very welcome.