source: trunk/debathena/config/nsswitch-config/debian/adduser.debathena @ 22769

Revision 22769, 893 bytes checked in by tabbott, 17 years ago (diff)
The last checkin broke 'adduser <user> <group>' where <group> is a local group and <user> is a nonlocal user. *debathena/config/nsswitch-config/debian/adduser.debathena: Check which mode adduser is running in by parsing its arguments, and don't set NSS_NONLOCAL_IGNORE in the 2-argument adduser mode.
Line 
1#!/usr/bin/perl
2use Getopt::Long;
3
4my $nop;
5my @names;
6my @save_names=@names;
7my @SAVE_ARGV=@ARGV;
8# Parse adduser options
9GetOptions ("quiet|q" => \$nop,
10            "force-badname" => \$nop,
11            "help|h" => \$nop,
12            "version|v" => \$nop,
13            "system" => \$nop,
14            "group" => \$nop,
15            "ingroup=s" => \$nop,
16            "home=s" => \$nop,
17            "gecos=s" => \$nop,
18            "shell=s" => \$nop,
19            "disabled-password" => \$nop,
20            "disabled-login" => \$nop,
21            "uid=i" => \$nop,
22            "firstuid=i" => \$nop,
23            "lastuid=i" => \$nop,
24            "gid=i" => \$nop,
25            "conf=s" => \$nop,
26            "no-create-home" => \$nop,
27            "add_extra_groups" => \$nop,
28            "debug" => \$nop);
29
30while (defined(my $arg = shift(@ARGV))) {
31  push (@names, $arg);
32}
33
34if (@names != 2) {
35    $ENV{'NSS_NONLOCAL_IGNORE'} = 'ignore';
36}
37
38@ARGV=@SAVE_ARGV;
39@names=@save_names;
40do '/usr/sbin/adduser.debathena-orig';
Note: See TracBrowser for help on using the repository browser.