diff options
Diffstat (limited to 'userdb/pw2userdb.in')
| -rw-r--r-- | userdb/pw2userdb.in | 70 | 
1 files changed, 0 insertions, 70 deletions
| diff --git a/userdb/pw2userdb.in b/userdb/pw2userdb.in deleted file mode 100644 index b036d9d..0000000 --- a/userdb/pw2userdb.in +++ /dev/null @@ -1,70 +0,0 @@ -#! @PERL@ -# -#  Convert /etc/passwd and /etc/shadow to userdb format. -# -# -# Copyright 1998 - 1999 Double Precision, Inc.  See COPYING for -# distribution information. - -use Getopt::Long; - -# -#  Some undocumented options here (for vchkpw2userdb) -# - -die "Invalid options.\n" unless -	GetOptions("passwd=s" => \$passwd, "shadow=s" => \$shadow, -		"noshadow" => \$noshadow, "nouid" => \$nouid, -		"domain=s" => \$domain, "vpopuid" => \$vpopuid ); - -($dummy, $dummy, $fixed_uid, $fixed_gid)=getpwnam("vpopmail") -	if $vpopuid; - -$passwd="/etc/passwd" unless $passwd =~ /./; -$shadow="/etc/shadow" unless $shadow =~ /./; - -$domain="" unless $domain =~ /./; -$domain="\@$domain" if $domain =~ /./; - -open(PASSWD, $passwd) || die "$!\n"; - -while (<PASSWD>) -{ -	chop if /\n$/; -	next if /^#/; -	($acct,$passwd,$uid,$gid,$name,$home,$shell)=split( /:/ ); - -	($uid,$gid)=($fixed_uid,$fixed_gid) if $vpopuid; - -	$PASSWORD{$acct}=$passwd if $passwd ne "x"; -	$UID{$acct}=$uid; -	$GID{$acct}=$gid; -	$HOME{$acct}=$home; -	$SHELL{$acct}=$shell; - -	$name =~ s/\|/./g;	# Just in case -	$GECOS{$acct}=$name; -} -close (PASSWD); - -if ( -f $shadow && ! $noshadow) -{ -	open (SHADOW, $shadow) || die "$!\n"; -	while (<SHADOW>) -	{ -		next if /^#/; -		($acct,$passwd,$dummy)=split(/:/); -		$PASSWORD{$acct}=$passwd; -	} -	close (SHADOW); -} - -while ( defined ($key=each %UID)) -{ -	print "$key$domain\tuid=$UID{$key}|gid=$GID{$key}|home=$HOME{$key}" . -		( $SHELL{$key} =~ /./ ? "|shell=$SHELL{$key}":"") . -		( $PASSWORD{$key} =~ /./ ? "|systempw=$PASSWORD{$key}":"") . -		( $GECOS{$key} =~ /./ ? "|gecos=$GECOS{$key}":"") . -		"\n"; -	print "$UID{$key}=\t$key\n" unless $nouid; -} | 
