Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#608429: sbuild-createchroot: should suggest/recommend sudo

68 views
Skip to first unread message

Jakub Wilk

unread,
Dec 30, 2010, 3:40:02 PM12/30/10
to
Package: sbuild
Version: 0.60.7-1

If you don't have sudo installed, sbuild-createchroot ends with these
error messages:

| I: sudo chroot configuration linked as /etc/sbuild/chroot/sid-i386-sbuild.
| Can't exec "sudo": No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 306.
| Failed to exec: sudo: No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 307.
| Can't exec "sudo": No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 306.
| Failed to exec: sudo: No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 307.
| E: Failed to create build directory /build
| Failed to set up chroot
| E: Error creating chroot session: skipping apt update

However, sbuild doesn't recommend or suggest sudo.


-- System Information:
Debian Release: 6.0
APT prefers unstable
APT policy: (990, 'unstable'), (500, 'experimental'), (500, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sbuild depends on:
ii adduser 3.112+nmu2 add and remove users and groups
ii libsbuild-perl 0.60.7-1 Tool for building Debian binary pa
ii perl 5.10.1-16 Larry Wall's Practical Extraction
ii perl-modules 5.10.1-16 Core Perl modules

Versions of packages sbuild recommends:
ii debootstrap 1.0.26 Bootstrap a basic Debian system
ii fakeroot 1.14.5-1 Gives a fake root environment

Versions of packages sbuild suggests:
ii deborphan 1.7.28.3 program that can find unused packa
ii wget 1.12-2.1 retrieves files from the web

--
Jakub Wilk

--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Roger Leigh

unread,
Dec 30, 2010, 5:40:01 PM12/30/10
to
On Thu, Dec 30, 2010 at 09:31:12PM +0100, Jakub Wilk wrote:
> Package: sbuild
> Version: 0.60.7-1
>
> If you don't have sudo installed, sbuild-createchroot ends with these
> error messages:
>
> | I: sudo chroot configuration linked as /etc/sbuild/chroot/sid-i386-sbuild.
> | Can't exec "sudo": No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 306.
> | Failed to exec: sudo: No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 307.
> | Can't exec "sudo": No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 306.
> | Failed to exec: sudo: No such file or directory at /usr/share/perl5/Sbuild/Chroot.pm line 307.
> | E: Failed to create build directory /build
> | Failed to set up chroot
> | E: Error creating chroot session: skipping apt update
>
> However, sbuild doesn't recommend or suggest sudo.

It shouldn't be using it. sbuild-createchroot can't use schroot to
finish final setup of the chroot (run apt-get update,dist-upgrade,
create build directory and other bits.) because it might not be
installed, or the chroot name may clash. So we use chroot(8)
instead via the Sbuild::ChrootPlain module. This only uses sudo
when not root (required for running chroot(8)), but since debootstrap
requires root and hence we are already root this should never occur.

I'll double check the logic in Sbuild::ChrootPlain; I had sudo installed
during testing, so it's possible I missed something. Looking at it, I
think

push(@cmdline, $self->get_conf('SUDO'))
if ($need_chroot || $need_su);

should be

push(@cmdline, $self->get_conf('SUDO'))
if (($need_chroot || $need_su) && $user ne 'root');


Regards,
Roger

--
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.

signature.asc

Roger Leigh

unread,
Dec 31, 2010, 7:10:02 AM12/31/10
to
tags 608429 + patch
thanks

Please could you try the attached patch and let me know if it fixes the
problem for you?

I've tried it on my system, with no sudo privs, but since sudo is
still installed and it's run as root this isn't a totally fair test
(I can't remove sudo at the moment since I need it).


Thanks,

sbuild-createchroot-nosudo.patch
signature.asc

Jakub Wilk

unread,
Dec 31, 2010, 7:50:02 AM12/31/10
to
* Roger Leigh <rle...@codelibre.net>, 2010-12-31, 12:01:

>Please could you try the attached patch and let me know if it fixes the
>problem for you?

Yes, it does. Thanks. :)

--
Jakub Wilk

signature.asc

Roger Leigh

unread,
Dec 31, 2010, 9:20:01 AM12/31/10
to
tags 608429 + fixed-upstream pending
thanks

Super, thanks for checking. Now fixed in git, and it'll be in the next
upload.


Regards,

signature.asc
0 new messages