From owner-freebsd-cvsweb@FreeBSD.ORG  Thu Mar  9 20:43:23 2006
Return-Path: <owner-freebsd-cvsweb@FreeBSD.ORG>
X-Original-To: freebsd-cvsweb@freebsd.org
Delivered-To: freebsd-cvsweb@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4E68A16A420
	for <freebsd-cvsweb@freebsd.org>; Thu,  9 Mar 2006 20:43:23 +0000 (GMT)
	(envelope-from David_Patterson@symantec.com)
Received: from gold.veritas.com (gold.veritas.com [143.127.12.110])
	by mx1.FreeBSD.org (Postfix) with ESMTP id C409D43D45
	for <freebsd-cvsweb@freebsd.org>; Thu,  9 Mar 2006 20:43:22 +0000 (GMT)
	(envelope-from David_Patterson@symantec.com)
Received: from sxchcon1-int.veritas.com (HELO
	SVLXCHCON1.enterprise.veritas.com) ([10.137.18.171])
	by gold.veritas.com with ESMTP; 09 Mar 2006 12:43:21 -0800
X-IronPort-AV: i="4.02,179,1139212800"; 
	d="scan'208,217"; a="56932744:sNHT65046860"
Received: from SVLXCHCLN8.enterprise.veritas.com ([10.137.18.186]) by
	SVLXCHCON1.enterprise.veritas.com with Microsoft
	SMTPSVC(6.0.3790.211); Thu, 9 Mar 2006 12:43:21 -0800
X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0
Content-class: urn:content-classes:message
MIME-Version: 1.0
Date: Thu, 9 Mar 2006 12:43:20 -0800
Message-ID: <EFA54216D7DEA346AD353400368A0EDC028BA125@SVLXCHCLN8.enterprise.veritas.com>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: are there any hooks into LDAP for cvsweb?
Thread-Index: AcZDuho82IMdfGfQRJW1Qm4ne0o8Mw==
From: "David Patterson" <David_Patterson@symantec.com>
To: <freebsd-cvsweb@freebsd.org>
X-OriginalArrivalTime: 09 Mar 2006 20:43:21.0765 (UTC)
	FILETIME=[1AB47550:01C643BA]
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: David Patterson <David_Patterson@symantec.com>
Subject: are there any hooks into LDAP for cvsweb?
X-BeenThere: freebsd-cvsweb@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS Web maintenance mailing list <freebsd-cvsweb.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-cvsweb>, 
	<mailto:freebsd-cvsweb-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-cvsweb>
List-Post: <mailto:freebsd-cvsweb@freebsd.org>
List-Help: <mailto:freebsd-cvsweb-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-cvsweb>,
	<mailto:freebsd-cvsweb-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Mar 2006 20:43:23 -0000

I got CVSWeb working fine -but- we are about to deploy LDAP and I would
really like to tie authentication into LDAP.  I tried using apache's
mod_authz_ldap  which works ... and then accesses cvsw eb.cgi ... but
that in turn fails...

=20

Ideas? =20

=20

Dave Patterson=20

Principal Systems Administrator, CFIO

Symantec Corporation

=20


From owner-freebsd-cvsweb@FreeBSD.ORG  Thu Mar  9 21:43:14 2006
Return-Path: <owner-freebsd-cvsweb@FreeBSD.ORG>
X-Original-To: freebsd-cvsweb@freebsd.org
Delivered-To: freebsd-cvsweb@freebsd.org
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 3CF8F16A422
	for <freebsd-cvsweb@freebsd.org>; Thu,  9 Mar 2006 21:43:14 +0000 (GMT)
	(envelope-from jpnairn@gmail.com)
Received: from uproxy.gmail.com (uproxy.gmail.com [66.249.92.200])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 8C3BC43D4C
	for <freebsd-cvsweb@freebsd.org>; Thu,  9 Mar 2006 21:43:13 +0000 (GMT)
	(envelope-from jpnairn@gmail.com)
Received: by uproxy.gmail.com with SMTP id u2so281283uge
	for <freebsd-cvsweb@freebsd.org>; Thu, 09 Mar 2006 13:43:12 -0800 (PST)
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com;
	h=received:message-id:date:from:to:subject:mime-version:content-type;
	b=MdpjpETpCfmz+VdwKRKtiaHk/rxYm+QYT44VdNNmuhz0WgZhS8kKWK9/khTqHdzz9HNQVhmZDae6varGYhDJweBl5b/Y/CgSEDNwtDFAgrrOEXcxw2QkcBCiI7vfPRnDSH+yykyuOwj4I9K14cxrUn6zhGoW70suQ6sYLgd+Zzg=
Received: by 10.66.184.5 with SMTP id h5mr1473373ugf;
	Thu, 09 Mar 2006 13:43:11 -0800 (PST)
Received: by 10.67.27.9 with HTTP; Thu, 9 Mar 2006 13:43:11 -0800 (PST)
Message-ID: <3bccd73d0603091343m77a368a3jdf0ddc9e8ba44517@mail.gmail.com>
Date: Thu, 9 Mar 2006 14:43:11 -0700
From: "Jerry Nairn" <jpnairn@gmail.com>
To: freebsd-cvsweb@freebsd.org
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Subject: full names and mail links in log view
X-BeenThere: freebsd-cvsweb@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: CVS Web maintenance mailing list <freebsd-cvsweb.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-cvsweb>, 
	<mailto:freebsd-cvsweb-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-cvsweb>
List-Post: <mailto:freebsd-cvsweb@freebsd.org>
List-Help: <mailto:freebsd-cvsweb-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-cvsweb>,
	<mailto:freebsd-cvsweb-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Thu, 09 Mar 2006 21:43:14 -0000

I have modified our copy of cvsweb to replace cvs user name with the full
name and a mailto link in change log pages using the CVSROOT/users file use=
d
by cvs watch and the CVSROOT notify file. This is not in patch format
because I've made several other changes to our copy of cvsweb, and the
location of the functions is irrelevant. There is really only one changed
line.

<   print ' by <i>', htmlquote($author{$_}), "</i><br />\n";
---
>   print ' by <i>', userinfo($author{$_}), "</i><br />\n";

I added the hash %knownusers to the use vars statement, and this function
call in the View Files section:

##### get list of users #####
%knownusers =3D getuserinfo("${cvsroot}/users");

Then these functions are added at the end of the file:

#
# Read a cvsusers file to get full names and email addresses of
# authors we expect to see in the file logs.
#
sub getuserinfo
{
  my $userfile =3D shift;
  my %expansions;

  open (MAPFILE, "<$userfile") or die ("Unable to open $userfile ($!)");

  while (<MAPFILE>) {
    next if /^\s*#/;  # Skip comment lines.
    next if not /:/;  # Skip lines without colons.
    my ($username, $expansion) =3D split ':';
    chomp $expansion;
    $expansion =3D~ s/^'(.*)'$/$1/;
    $expansion =3D~ s/^"(.*)"$/$1/;

    # If it looks like the expansion has a real name already, then
    # we toss the username we got from CVS log.  Otherwise, keep
    # it to use in combination with the email address.
    if ($expansion =3D~ /^\s*<{0,1}\S+@.*/) {
      # Also, add angle brackets if none present
      if (! ($expansion =3D~ /<\S+@\S+>/)) {
        $expansions{$username} =3D "$username <$expansion>";
      }
      else {
        $expansions{$username} =3D "$username $expansion";
      }
    }
    else {
      $expansions{$username} =3D $expansion;
    }
  }
  close (MAPFILE);
  return %expansions;
}

#
# Given an author's name, see if we have info about the user from
# the cvsusers file.
# If so, use it to give full name and mailto link if possible.
#
sub userinfo
{
  my $username =3D shift;
  my $lcusername =3D lc($username);
  if ( exists $knownusers{$lcusername} ) {
    $knownusers{$lcusername} =3D~ /^(.*)\s{0,1}(<.*>)$/;
    my ($fullname, $mailaddress) =3D ($1, $2);
    return &link($fullname,
"mailto:'".$knownusers{$lcusername}."'<'".$knownusers{$lcusername}."'>
");
  } else {
    return $username;
  }
}

If you use this, you may want to make the regular expression for parsing th=
e
users file more robust. I just know it works with what I have in our file.
You may also want to turn this on or off via the config file, and have it
not die when there is no users file.

Jerry Nairn
Microchip Technology