• Bug#1104553: sbuild: support --no-enable-network on the schroot backend

    From Helmut Grohne@21:1/5 to All on Fri May 2 00:00:01 2025
    Package: sbuild
    Tags: moreinfo patch
    X-Debbugs-Cc: myon@debian.org

    Hi,

    I noticed that sbuild --mode=schroot does not support --no-enable
    network. As it happens, unschroot[1] supports --isolate-network and all
    that's missing here is passing that flag. Of course, that's not the
    default schroot implementation and schroot may end up using a different
    flag name. Still, I'm posting the patch that makes it work practically
    for future reference.

    Helmut

    [1] https://git.subdivi.de/~helmut/python-linuxnamespaces.git/tree/examples/unschroot.py

    --- a/usr/share/perl5/Sbuild/ChrootSchroot.pm
    +++ b/usr/share/perl5/Sbuild/ChrootSchroot.pm
    @@ -107,12 +107,14 @@
    my $self = shift;
    my $dir = shift;
    my $user = shift;
    + my $disable_network = shift // 0;

    return ($self->get_conf('SCHROOT'),
    '-d', $dir,
    '-c', $self->get('Session ID'),
    '--run-session',
    @{$self->get_conf('SCHROOT_OPTIONS')},
    + $disable_network ? ('--isolate-network') : (),
    '-u', "$user", '-p', '--');
    }

    @@ -134,7 +136,11 @@

    my $disable_network = 0;
    if (defined($options->{'ENABLE_NETWORK'}) && $options->{'ENABLE_NETWORK'} == 0) {
    - print STDERR "Disabling the network for this command was requested but the schroot backend doesn't support this feature yet: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=802849\n" if $self->get_conf('DEBUG');
    + if ($self->get_conf('SCHROOT') =~ /unschroot/) {
    + $disable_network = 1;
    + } else {
    + print STDERR "Disabling the network for this command was requested but th
  • From Johannes Schauer Marin Rodrigues@21:1/5 to All on Fri May 2 07:50:01 2025
    Hi,

    Quoting Helmut Grohne (2025-05-01 23:45:53)
    I noticed that sbuild --mode=schroot does not support --no-enable
    network. As it happens, unschroot[1] supports --isolate-network and all that's missing here is passing that flag. Of course, that's not the
    default schroot implementation and schroot may end up using a different
    flag name. Still, I'm posting the patch that makes it work practically
    for future reference.

    thanks, this now has a MR:

    https://salsa.debian.org/debian/sbuild/-/merge_requests/186

    Thanks!

    cheers, josch
    --==============57378806847122754=MIME-Version: 1.0
    Content-Transfer-Encoding: 7bit
    Content-Description: signature
    Content-Type: application/pgp-signature; name="signature.asc"; charset="us-ascii"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmgUWxQACgkQ8sulx4+9 g+HgRhAAiCn2IMqVP1UbSxn56hgTQWpGUYy79Tx97SyTQK6WwEJs1wbqdh1skifG 3R1Tj1cLUAh/oR9nHH6YCDOHJEYMKhJxS8q+Rd+bUj33bpVRsxgvZmreaASTaCKI pEl8X/yj2BQ3T7w42BmYq1f2JquWcIOf8JEyAvrOdjekgcVV2YIFrsAvr02DRAtJ ZXlDOUM/MC6Qlb41egX9sIdGXeDmnc/VEVEhqC9G04HxPZ0Hf2PnRL0Uyl2evfDE tZQpkjTE7N/EtyIcmiMZtkDi+nKX9T9n9fEaq8Rv/3FaLPldvyj97UmlN5qLNEwm 2cM/DyEORoPGovmR1r/b09IXaEC+nfr+ttaWUStLGuJrxnqoWdENjzRXk6LYIWL3 mAmua71gms6A28Ou9fMZ3fAOkRTNTaoS/hxTl8TayAjKySclO9NOMpNK79PzY/oC OaPTqauHThgs1D+qyyajuQjr+vqx/EthslMoNR6i2tKuUT+3vLjh1nzn+5Be150f 60d/MWvY+cjkgUmHw/9s5TXSugr6d/kPBL4dYmI6jJshsyESiIhd9IqV5Oiilrix 3vW6WNJZBnHY2j2tAebdKUQS0l6Dp07kiEb9DSBr87taqK7EXJUClqdsD1jqTUdR 38C3UGWqk9VIuJGPE5e+Hh8y57TtrQ64Q/svQPuWKibzvdQewcM=
    =xrWp
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)