'click install' within an adt-virt-schroot fails with "Sandbox failure: 'click install' not permitted to write-open '/dev/pts/8'"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
autopkgtest (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This used to work and I don't know when this starting failing. If I try to run the click-apparmor autopkgtests (tried both vivid and wily) on a vivid host, then I get:
adt-run [13:51:51]: test test_aa-clickhook: [------
Successfully built package in './com.
WARNING:
ERROR:root:['dpkg', '--force-not-root', '--force-bad-path', '--force-
Sandbox failure: 'click install' not permitted to write-open '/dev/pts/8'
dpkg: error processing archive /tmp/adttmp.
subprocess dpkg-deb --control returned error exit status 1
Errors were encountered while processing:
/tmp/adttmp.
Traceback (most recent call last):
File "/usr/bin/click", line 86, in <module>
sys.
File "/usr/bin/click", line 82, in main
return mod.run(args)
File "/usr/lib/
quiet=not options.verbose)
File "/usr/lib/
path, user=user, all_users=
File "/usr/lib/
**kwargs)
File "/usr/lib/
raise CalledProcessEr
subprocess.
adt-run [13:51:52]: test test_aa-clickhook: -------
test_aa-clickhook FAIL non-zero exit status 1
This tests attempts to install a click within the schroot (note that debian/
click install --user=`getent passwd | sort -t: -nk3 | awk -F: '{if ($3 >= 500) { print $1; exit } }'` /path/to/click
The above error messages comes from clickpreload.c in the click package which is preloaded to reject any writes (except to /dev/tty) outside of the click install directory. For some reason, dpkg is trying to write to /dev/pts/* (stderr) when run under autopkgtest.
If I run the click install command manually (after making the aforementioned changes test_aa-clickhook does) in the schroot, it works fine.
Furthermore, if I run the tests manually, they also pass:
$ schroot -c autopkgtest-
$ apt-get install click-apparmor
...
$ apt-get source click-apparmor
...
$ cd click-apparmor-
$ rm -rf /tmp/adt ; mkdir /tmp/adt ; ADTTMP=/tmp/adt sh ./debian/
...
PASS (all tests)
$
But, if I run the tests via adt, they do not:
$ apt-get source click-apparmor=
...
$ cd click-apparmor-
$ adt-run -B --unbuilt-tree ./ --log-file /tmp/adt.out --- adt-virt-schroot autopkgtest-
...
adt-run [16:08:44]: test test_aa-clickhook: preparing
...
Sandbox failure: 'click install' not permitted to write-open '/dev/pts/28'
...
** AUTOPKGTESTS FAILED
If I modify preload/
$ adt-run -B /tmp/click/*.deb --unbuilt-tree ./ --log-file /tmp/adt.out --- adt-virt-schroot autopkgtest-
...
Sandbox debug: 'click install' write-open to '/dev/pts/28'
Selecting previously unselected package com.example.
(Reading database ... 0 files and directories currently installed.)
Preparing to unpack .../com.
Unpacking com.example.
dpkg: error processing archive /tmp/adttmp.
corrupted filesystem tarfile - corrupted package archive
Errors were encountered while processing:
/tmp/adttmp.
However, if I adjust the test_aa-clickhook autopkgtest to copy that package aside so I can try it manually, it is not malformed at all and installs fine in the schroot (after making the aforementioned changes to click.py and apparmor_parser) and my vivid host:
$ sudo click install --user=$USER --allow-
WARNING:
$ click list --user=$USER
com.example.
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: autopkgtest 3.13
ProcVersionSign
Uname: Linux 4.1.0-1-generic x86_64
NonfreeKernelMo
ApportVersion: 2.17.2-0ubuntu1.2
Architecture: amd64
CurrentDesktop: Unity
Date: Thu Aug 13 14:12:56 2015
InstallationDate: Installed on 2015-06-13 (60 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422)
PackageArchitec
SourcePackage: autopkgtest
UpgradeStatus: No upgrade log present (probably fresh install)
description: | updated |
description: | updated |
description: | updated |
description: | updated |
tags: | added: patch |
FYI, this bug doesn't seem to affect autopkgtest. ubuntu. com: autopkgtest. ubuntu. com/data/ packages/ wily/amd64/ c/click- apparmor/ 20150814_ 152038@ .log
http://