ports/78163: [PATCH] small Makefile glich and pw2userdb changes
Jose M Rodriguez
josemi at freebsd.jazztel.es
Sun Feb 27 20:30:15 UTC 2005
>Number: 78163
>Category: ports
>Synopsis: [PATCH] small Makefile glich and pw2userdb changes
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Feb 27 20:30:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Jose M Rodriguez
>Release: FreeBSD 5.4-PRERELEASE i386
>Organization:
Redes JM
>Environment:
System: FreeBSD orion.redesjm.local 5.4-PRERELEASE FreeBSD 5.4-PRERELEASE #0: Sun Feb 27 12:18:14 CET 2005 root at orion.redesjm.local:/usr/obj/usr/src/sys/ORION i386
>Description:
Add BSD master.passwd processing to pw2userdb
Correct a small glich on Makefile (at last here)
>How-To-Repeat:
>Fix:
--- patch-courier-authlib begins here ---
diff -Nru /usr/HEAD/ports/mail/courier-authlib/Makefile mail/courier-authlib/Makefile
--- /usr/HEAD/ports/mail/courier-authlib/Makefile Sun Feb 13 14:50:40 2005
+++ mail/courier-authlib/Makefile Sun Feb 27 19:38:09 2005
@@ -118,7 +118,7 @@
.include <bsd.port.pre.mk>
-++ pkg-plist Fri Feb 4 02:29:24 2005
+
RC_SCRIPTS_SUB=PREFIX=${PREFIX} RC_SUBR=${RC_SUBR}
MAN1= courierlogger.1
diff -Nru /usr/HEAD/ports/mail/courier-authlib/files/patch-userdb::pw2userdb.in mail/courier-authlib/files/patch-userdb::pw2userdb.in
--- /usr/HEAD/ports/mail/courier-authlib/files/patch-userdb::pw2userdb.in Thu Jan 1 01:00:00 1970
+++ mail/courier-authlib/files/patch-userdb::pw2userdb.in Sun Feb 27 21:12:06 2005
@@ -0,0 +1,106 @@
+--- userdb/pw2userdb.in.orig Wed Jul 19 13:55:15 2000
++++ userdb/pw2userdb.in Sun Feb 27 21:10:36 2005
+@@ -7,6 +7,8 @@
+ # Copyright 1998 - 1999 Double Precision, Inc. See COPYING for
+ # distribution information.
+
++# Adapted to BSD master.passwd
++
+ use Getopt::Long;
+
+ #
+@@ -21,43 +23,67 @@
+ ($dummy, $dummy, $fixed_uid, $fixed_gid)=getpwnam("vpopmail")
+ if $vpopuid;
+
+-$passwd="/etc/passwd" unless $passwd =~ /./;
+-$shadow="/etc/shadow" unless $shadow =~ /./;
++$passwd="/nonexistent" unless $passwd =~ /./;
++$shadow="/etc/master.passwd" unless $shadow =~ /./;
+
+ $domain="" unless $domain =~ /./;
+ $domain="\@$domain" if $domain =~ /./;
+
+-open(PASSWD, $passwd) || die "$!\n";
+-
+-while (<PASSWD>)
++if ($shadow =~ /master.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);
++ open(PASSWD, $shadow) || die "$!\n";
+
+-if ( -f $shadow && ! $noshadow)
+-{
+- open (SHADOW, $shadow) || die "$!\n";
+- while (<SHADOW>)
++ while (<PASSWD>)
+ {
++ chop if /\n$/;
+ next if /^#/;
+- ($acct,$passwd,$dummy)=split(/:/);
++ ($acct,$passwd,$uid,$gid,$class,$change,$expire,$name,$home,$shell)=split( /:/ );
++
++ ($uid,$gid)=($fixed_uid,$fixed_gid) if $vpopuid;
++ $name =~ s/\|/./g; # Just in case
++
+ $PASSWORD{$acct}=$passwd;
++ $UID{$acct}=$uid;
++ $GID{$acct}=$gid;
++ $HOME{$acct}=$home;
++ $SHELL{$acct}=$shell;
++ $GECOS{$acct}=$name;
++ }
++ close (PASSWD);
++} else {
++ 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);
+ }
+- close (SHADOW);
+ }
+
+ while ( defined ($key=each %UID))
--- patch-courier-authlib ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list