[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: debian-test run as which user?



Julian Gilbey <J.D.Gilbey@qmw.ac.uk> writes:

> I just ran into a problem with debian-test.
> 
> I have set up devscripts on my machine to make debpkg (a dpkg wrapper)
> setuid root.  So I run the new debit script, which happily installs
> the package, but then the debian-test fails, because it is prefaced by
> su -c nobody.

I agree that that is a mistake.

I don't see why there is any need to assume that tests scripts are of a
significantly greater security risk than the installation scripts, and
some packages will only be able to be tested when run as root, while
others will only be testable when run as non-root.

It looks like I need to come up with a way of letting the tests
declare as whom they wish to run.

> What I would prefer would be for the tests to make no assumption as to
> whether they are being run as root or as nobody or as any other user.
> If they need to be run as root, they should use the line:
> 
> testroot || { echo "These tests must be run as root!">&2; exit 1; }

We need to differentiate between this sort of failure and an actual
test failing.

If people have examples of ``must be user X'' tests, please send me
them, and I'll see if I can add some support functions to simplify
writing such things.  Something like:

  TEST_UID=root runtest "My Root Test" test_root

or

  as_user root runtest "My Root Test" test_root

or

  runtest_as root "My Root Test" test_root

Any preferences, or other suggestions ?

Cheers, Phil.


Reply to: