Bug#597239: user-setup: Should add user to sudo group instead of modifying sudoers
Hello,
On Sat, Sep 18, 2010 at 3:55 AM, Christian PERRIER <bubulle@debian.org> 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
fi
...
This avoids the checking against dpkg.
--
Otavio Salvador O.S. Systems
E-mail: otavio@ossystems.com.br http://www.ossystems.com.br
Mobile: +55 53 9981-7854 http://projetos.ossystems.com.br
Reply to: