[flac-dev] Permit running tests as root

brianw brianw at audiobanshee.com
Tue Sep 27 23:19:03 UTC 2022


I think it's a really bad idea to run anything as root, unless absolutely necessary. Isn't this why sudo has become standard? It seems that modern systems do not even have a root account, and expect users to execute most commands with reduced privileges.

Skipping a valid test because someone is running as root, when there is no good reason to run as root, is an even worse idea.

Tests should always be complete.

If the user is using a non-recommended scenario for testing, then the user should be instructed to change the conditions and run the full tests again. The most common situation should be that someone used sudo for the tests, inadvertently, and they could just repeat the same command without sudo to complete the tests.

Brian

p.s. For security reasons, I always build and test as a normal user without wheel group access. I even run the "make install" process once as a non-root account to verify the list of files that will be written into protected directories. Only after I'm convinced that things will be installed in the correct locations do I use sudo to install with elevated privileges.


On Sep 27, 2022, at 1:38 PM, Christian Weisgerber <naddy at mips.inka.de> wrote:
> Some people build software and run the regression tests as root.
> (Possibly in some restricted environment.)
> 
> <packager hat>I've been asked to make sure this works.</>
> 
> Unfortunately, the FLAC tests currently error out in two places if
> run as root:
> 
> ===> test_libFLAC
> ++++++ testing level 1 interface
> simple iterator on read-only file
> generating FLAC file for test
>        testing 'metadata.flac'... 0... 1... 2... content... PASSED
> is writable = 1
> ERROR: iterator claims file is writable when tester thinks it should not be; are you running as root?
> 
> ===> test_libFLAC++
> ++++++ testing level 1 interface
> simple iterator on read-only file
> generating FLAC file for test
>          testing 'metadata.flac'... 0... 1... 2... content... PASSED
> is writable = 1
> ERROR: iterator claims file is writable when tester thinks it should not be; are you running as root?
> 
> 
> Can we skip that test when root?



More information about the flac-dev mailing list