Greetings, Chris:

> This is because whilst adduser respects --quiet for its own message, it
> does not silence the call out to gpasswd:

I think that adduser should mimic the behavior of deluser here to avoid
being unnecessarily noisy.

The "deluser" utility does the following...

440    #systemcall("usermod","-G", join(",",@groups), $user );
441    my $gpasswd = &which('gpasswd');
442    &systemcall($gpasswd,'-M', join(',',@members), $group);
443    &invalidate_nscd();
444    s_print (gtx("Done.\n"));

The "-M" option to gpasswd accepts a new list of users to belong to a
group and has the benefit of being silent.  Thus, invoking...

  deluser --quiet foo bar

... behaves as expected and is not noisy.

The deluser utility builds a list, and removes the user from the list
which it then passes to the "-M" option.  The adduser utility simply has
to do the opposite and add the user to the existing list of users in the
specified group.

Then, everyone is happy. :)

-- 
Jason Franklin

Reply via email to