[buildd-tools-devel] Bug#833390: Bug#833390: sbuild: cannot set *_root_args so as to not try to run the command as root

Johannes Schauer josch at debian.org
Thu Aug 4 07:06:52 UTC 2016


Hi Sean,

Quoting Sean Whitton (2016-08-03 21:11:57)
> It should be possible to instruct sbuild not to run autopkgtest or
> piuparts as root.  If using a schroot backend for autopkgtest, root is
> not required, and hopefully this will soon be true for piuparts too
> (#708663).
> 
> At present, the only way to stop sbuild from prepending sudo to the
> autopkgtest command is something like this:
> 
>     $autopkgtest_root_args = ["env"];
> 
> That's because setting
> 
>     $autopkgtest_root_args = [];
> 
> implies
> 
>     $autopkgtest_root_args = ["sudo", "--"];
> 
> There should be a better, documented way to not run the commands as
> root.

How about the following changes (using autopkgtest as an example):

    --autopkgtest-root-arg=options
           Add an argument that is used to launch autopkgtest as root.
           Without  this  option,  the  default is to use "sudo --" to
           launch autopkgtest. If an empty string  is  supplied,  then
           autopkgtest is launched without any prefixed command.  This
           option can be specified multiple times.  This command  line
           option  appends  to the AUTOPKGTEST_ROOT_ARGS configuration
           variable. See sbuild.conf(5) for more information.

    --autopkgtest-root-args=options
           Add arguments that are used to launch autopkgtest as  root.
           Without  this  option,  the  default is to use "sudo --" to
           launch autopkgtest. If an empty string  is  supplied,  then
           autopkgtest  is launched without any prefixed command.  The
           argument will be split by whitespaces. To pass options con‐
           taining  whitespaces use the option --autopkgtest-root-arg.
           This  command   line   option   appends   to   the   AUTOP‐
           KGTEST_ROOT_ARGS configuration variable. See sbuild.conf(5)
           for more information.

And:

    AUTOPKGTEST_ROOT_ARGS
           ARRAY:STRING  type.   Preceding  arguments to launch autop‐
           kgtest as root. With the default value  (the  empty  array)
           "sudo --" will be used as a prefix. If the first element in
           the array is the empty string, no prefixing will  be  done.
           If  the  value  is  a  scalar,  it will be prefixed by that
           string. If the scalar is an empty string, no prefixing will
           be done.

           Related sbuild(1) command line options:

           --autopkgtest-root-arg
           --autopkgtest-root-args

           Example:

           # prefix with "sudo --":
           $autopkgtest_root_args = [];
           $autopkgtest_root_args = ['sudo', '--'];
           # prefix with "env":
           $autopkgtest_root_args = ['env'];
           $autopkgtest_root_args = 'env';
           # prefix with nothing:
           $autopkgtest_root_args = '';
           $autopkgtest_root_args = [''];
           $autopkgtest_root_args = ['', 'whatever'];

           Default:

           $autopkgtest_root_args = [];


What do you think?

Thanks!

cheers, josch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20160804/034b8081/attachment.sig>


More information about the Buildd-tools-devel mailing list