Debian Bug report logs - #1032046
sbuild: unshare mode uses wrong user for "Check disk space" commands when $build_user is set

version graph

Package: sbuild; Maintainer for sbuild is sbuild maintainers <sbuild@packages.debian.org>; Source for sbuild is src:sbuild (PTS, buildd, popcon).

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Sun, 26 Feb 2023 23:27:01 UTC

Severity: normal

Found in version sbuild/0.85.0

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, vagrant@reproducible-builds.org, sbuild maintainers <sbuild@packages.debian.org>:
Bug#1032046; Package sbuild. (Sun, 26 Feb 2023 23:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to vagrant@reproducible-builds.org, sbuild maintainers <sbuild@packages.debian.org>. (Sun, 26 Feb 2023 23:27:03 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: sbuild: unshare mode uses wrong user for "Check disk space" commands when $build_user is set
Date: Sun, 26 Feb 2023 15:24:13 -0800
Package: sbuild
Version: 0.85.0
Severity: normal
X-Debbugs-Cc: vagrant@reproducible-builds.org

Using the following sbuild.conf:

  $chroot_mode = 'unshare';
  $build_user = 'user7777';

Results in this error:

  Check disk space
  ----------------

  runuser: user vagrant does not exist or the user entry does not contain all the required fields
  E: read_command failed to execute du
  Use of uninitialized value $current_usage in scalar chomp at /usr/share/perl5/Sbuild/Build.pm line 2271.
  E: du exited with non-zero exit status 256
  runuser: user vagrant does not exist or the user entry does not contain all the required fields
  E: read_command failed to execute du
  E: Cannot determine space needed for /<<PKGBUILDDIR>> (du failed)

If I add the following to sbuild.conf:

  $external_commands = {
    "chroot-setup-commands" => [
       ['useradd', '--uid', '1000', '--user-group', '--shell', '/bin/bash', '--groups', 'sbuild', 'vagrant' ],
  ]};

Then it works for me, and actually builds as the user specified with
$build_user.

Seems like it should also use $build_user for the check disk space
command as well!

live well,
  vagrant

-- System Information:
Debian Release: bookworm/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental'), (1, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-5-amd64 (SMP w/8 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages sbuild depends on:
ii  adduser         3.131
ii  libsbuild-perl  0.85.0
ii  perl            5.36.0-7

Versions of packages sbuild recommends:
pn  autopkgtest  <none>
pn  debootstrap  <none>
pn  schroot      <none>
ii  uidmap       1:4.13+dfsg1-1

Versions of packages sbuild suggests:
pn  deborphan  <none>
ii  e2fsprogs  1.46.6-1
ii  kmod       30+20221128-1
ii  wget       1.21.3-1+b2

-- no debconf information



Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 09:23:39 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.