[buildd-tools-devel] Bug#608429: Bug#608429: Bug#608429: sbuild-createchroot: should suggest/recommend sudo
Roger Leigh
rleigh at codelibre.net
Fri Dec 31 12:01:18 UTC 2010
tags 608429 + patch
thanks
On Thu, Dec 30, 2010 at 10:30:42PM +0000, Roger Leigh wrote:
> 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');
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,
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbuild-createchroot-nosudo.patch
Type: text/x-diff
Size: 556 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20101231/3ddee40c/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20101231/3ddee40c/attachment-0001.pgp>
More information about the Buildd-tools-devel
mailing list