Package: autopkgtest
Version: 2.3.8
Severity: normal
Tags: patch

Hi,

I ran into an issue that took me quite some time to track down. It turns
out that adt-run sets a TMPDIR to a directory with insufficient
permissions.

From within a running test:

TMPDIR=/tmp/adt-run.WQzHYl/dsc0t-testsuite-testtmp/tmpdir

4 drwxrwxrwt  4 root root 4096 Oct 27 21:32 
/tmp/adt-run.WQzHYl/dsc0t-testsuite-testtmp/tmpdir/
4 drwx------  4 root root 4096 Oct 27 21:32 
/tmp/adt-run.WQzHYl/dsc0t-testsuite-testtmp/
4 drwxr-xr-x  6 root root 4096 Oct 27 21:32 /tmp/adt-run.WQzHYl/
4 drwxrwxrwt 10 root root 4096 Oct 27 21:31 /tmp/

The permissions of /tmp/adt-run.WQzHYl/dsc0t-testsuite-testtmp are
wrong. The test script runs some parts of the tests as a non-privileged
user that cannot access files under TMPDIR.

Setting a more liberal umask before running atd-run fixes the issue. The
attached patch also fixes the issue but I haven't checked whether other
directories are created with the correct permissions.

Thanks,

-- 
-- arthur - adej...@debian.org - http://people.debian.org/~adejong --
From ee071f976008c71b8133e02a48c7363304bd561d Mon Sep 17 00:00:00 2001
From: Arthur de Jong <art...@arthurdejong.org>
Date: Sun, 27 Oct 2013 22:45:09 +0100
Subject: [PATCH] Explicitly set permissions of testtmp directory

---
 runner/adt-run | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/runner/adt-run b/runner/adt-run
index cc77c75..826764b 100755
--- a/runner/adt-run
+++ b/runner/adt-run
@@ -1413,7 +1413,7 @@ class Test:
         testtmp = '%s%s-testtmp' % (testbed.scratch.read(True), self.what)
 
         script = 'buildtree="$1"; shift\n'
-        script += 'rm -rf -- "$@"; mkdir -- "$@"\n'
+        script += 'rm -rf -- "$@"; mkdir -- "$@"; chmod 755 "$@"\n'
 
         if 'needs-root' not in self.restriction_names and opts.user is not None:
             tfl = ['su', opts.user, '-c', tf]
-- 
1.8.4.rc3

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to