'needs-root' in combination with 'build-needed' unpacks code and runs build as root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autopkgtest (Ubuntu) |
New
|
Medium
|
Unassigned |
Bug Description
If a DEP-8 package contains a debian/
Restrictions: needs-root build-needed
... autopkgtest will:
- unpack the source as the root user
- run the build as the root user
This is unnecessary and places a burden on the test script to handle this scenario since if a test drops root privileges:
- it find that the directory tree is not writeable
- autopkgtest may well end up running the tests as root. This happens for Upstart since it has a 'make check' rule and dh calls dh_auto_test by default. However, it is not valid to run the Upstart tests as root.
I believe the behaviour of autopkgtest should be modified to:
1) Unpack the source as the user the tests would be run as if 'needs-root' were not specified.
2) Run the build as the same non-privileged user.
Changed in autopkgtest (Ubuntu): | |
importance: | Undecided → Medium |
A simple work-around is for build-needed to set DEB_BUILD_ OPTION= nocheck
And the unit-tests need to be run as autopkgtest job.
Also the root & non-root tests should be split into separate paragraphs in the autopkgtest, if that allows specifying different constraints.