Bug#648148: autopkgtest: Support running as user
- Subject: Bug#648148: autopkgtest: Support running as user
- From: jwilk@debian.org (Jakub Wilk)
- Date: Wed, 25 Apr 2012 20:02:38 +0200
- Message-id: <[🔎] 20120425180238.GA5469@jwilk.net>
- In-reply-to: <20111109075015.GF2964@piware.de>
- References: <20111109075015.GF2964@piware.de>
* Martin Pitt <martin.pitt at ubuntu.com>, 2011-11-09, 08:50:
>- if 'needs-root' not in t.restriction_names and opts.user is not None:
>+ if 'needs-root' not in t.restriction_names and opts.user:
> tfl = ['su',opts.user,'-c',tf]
> tmpdir = '%s%s-tmpdir' % (testbed.scratch.read(True), t.what)
> script = 'rm -rf -- "$1"; mkdir -- "$1"'
After applying this hunk, TMPDIR variable is no longer exposed to test
scripts, even when adt-run is run as root.
(Setting TMPDIR was a mistake in the first place IMHO. This variable in
POSIX has completely different semantics. Running a scripts that relied
on the feature outside adt-run might lead to security holes.)
--
Jakub Wilk
Reply to: