Package: debci
Version: 0.9
Severity: minor

Hi,

as mentioned in #755040, debci (or the tools below it, I don't really
know) do not protect itself against running in an environment with an
aggressive umask setting, namely 027 in my case which causes created
files to be stripped of all rights for 'other'.

[In case it makes a difference, I have set it via /etc/login.defs, so it
effects "everything" and is not set only for a few users via shell]

Files like etc/apt/apt.conf.d/01proxy are therefore properly created by
'debci setup', but any command later using the created chroot fails
(even as root), example:

>>>>
# adt-run --user debci --output-dir /tmp/output-dir apt --- schroot 
debci-unstable-amd64
adt-run [15:05:25]: version 3.4.1
adt-run [15:05:27]: testbed dpkg architecture: amd64
adt-run [15:05:27]: @@@@@@@@@@@@@@@@@@@@ apt-source apt
Selecting previously unselected package adt-satdep.
(Reading database ... 10681 files and directories currently installed.)
Preparing to unpack .../adt-run.H3KL1k/adt-satdep.deb ...
Unpacking adt-satdep (0) ...
Reading package lists...
[… downloads and installs dependencies …]
Setting up adt-satdep (0) ...
Processing triggers for libc-bin (2.19-10) ...
E: Opening configuration file /etc/apt/apt.conf.d/01proxy - ifstream::ifstream 
(13: Permission denied)
blame: apt
badpkg: rules extract failed with exit code 100
adt-run [15:05:38]: ERROR: erroneous package: rules extract failed with exit 
code 100
<<<<

The other obvious file is etc/dpkg/dpkg.cfg.d/debci which generates just
a lot of warnings though – but hasn't the intended effect of course.

P.S.: Would be nice if the apt config file would be called 01debci-proxy
or similar such as proxy is quite generic and its always good to get at
least a basic idea which package/program is responsible for a file.  If
the dpkg file would say what it does as well, all the better.

----

As it is a permission issue as well, I guess it is related, even though
I couldn't work around it with a simple call like 'umask 022': Following
the documentation of ci.debian.net to the letter for setup and
configuring my normal user (and adding the union-overlay-directory):

>>>>
$ adt-run --user debci --output-dir /tmp/output-dir2 apt --- schroot 
debci-unstable-amd64
adt-run [15:10:17]: version 3.4.1
adt-run [15:10:17]: testbed dpkg architecture: amd64
Unexpected error:
Traceback (most recent call last):
  File "/usr/share/autopkgtest/python/VirtSubproc.py", line 632, in mainloop
    command()
  File "/usr/share/autopkgtest/python/VirtSubproc.py", line 567, in command
    r = f(c, ce)
  File "/usr/share/autopkgtest/python/VirtSubproc.py", line 513, in cmd_copyup
    copyupdown(c, ce, True)
  File "/usr/share/autopkgtest/python/VirtSubproc.py", line 430, in copyupdown
    copyup_shareddir(sd[0], sd[1], dirsp, downtmp_host)
  File "/usr/share/autopkgtest/python/VirtSubproc.py", line 348, in 
copyup_shareddir
    shutil.copy(tb, host)
  File "/usr/lib/python3.4/shutil.py", line 228, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.4/shutil.py", line 107, in copyfile
    with open(src, 'rb') as fsrc:
PermissionError: [Errno 13] Permission denied: 
'/var/lib/schroot/mount/debci-unstable-amd64-254a600d-a6aa-41da-829c-e39ff75a6e4e/tmp/adt-run.z92JRi/testbed-packages'
adt-run [15:10:17]: ERROR: testbed failed: cannot send to testbed: 
['BrokenPipeError: [Errno 32] Broken pipe\n']
<<<<


The later can be 'worked around' by running adt-run as root, while as
mentioned already the first one is easily 'solved' by either fixing the
files permissions in the chroot or running 'umask 022' (or similar)
before creating the chroot, therefore I labeled the bug as minor.


Thanks for your work on CI tools for Debian & best regards

David Kalnischkies

Attachment: signature.asc
Description: Digital signature

Reply via email to