Bug#597239: user-setup: Should add user to sudo group instead of modifying sudoers
On Sat, Sep 18, 2010 at 3:55 AM, Christian PERRIER <email@example.com> wrote:
> Here's a proposed patch. Maybe a little bit overdesigned as I
> tentatively check the version of the sudo package that's installed on
> the system before adding the created user to the sudo group, falling
> back to old behaviour if sudo has a lower version.
This is important so we keep support for installing Lenny if someone
wants to. This can be dropped after Squeeze release.
> This is untested. I'm not 100% sure that "my" test is correct, so
> comments welcomed.
I haven't test it yet but it looks right for me.
Another possibility would be:
if ! $log $chroot $ROOT adduser "$USER" sudo >/dev/null 2>&1; then
echo "$USER ALL=(ALL) ALL" >> $ROOT/etc/sudoers
This avoids the checking against dpkg.
Otavio Salvador O.S. Systems
E-mail: firstname.lastname@example.org http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br