From: Peter Palfrader Date: Sun, 14 Sep 2008 21:42:48 +0000 (+0200) Subject: Allow setting of userpassword X-Git-Tag: release-0.3.33~59 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap-cgi.git;a=commitdiff_plain;h=2639ca03902bc809d5e024926a3eab910eb5f18a Allow setting of userpassword --- diff --git a/debian/changelog b/debian/changelog index 4329264..be4c49e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +userdir-ldap-cgi (0.3.15) unstable; urgency=low + + * Allow setting of userpassword. + + -- Peter Palfrader Sun, 14 Sep 2008 23:42:20 +0200 + userdir-ldap-cgi (0.3.14) unstable; urgency=low * Hide hosts on website whose status starts with unlisted. diff --git a/debian/control b/debian/control index 146eb1c..5034e25 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Uploaders: Ryan Murray , Joey Schulze Package: userdir-ldap-cgi Architecture: all -Depends: userdir-ldap, perl5, libnet-ldap-perl, libcrypt-blowfish-perl, gnupg (>= 1.0.3), libdate-manip-perl, liburi-perl, libio-socket-ssl-perl +Depends: userdir-ldap, perl5, libnet-ldap-perl, libcrypt-blowfish-perl, gnupg (>= 1.0.3), libdate-manip-perl, liburi-perl, libio-socket-ssl-perl, libuuid-perl, libdigest-hmac-perl Replaces: userdir-ldap Description: CGI programs for the db.debian.org These programs are run on http://db.debian.org/ to simplify the diff --git a/update.cgi b/update.cgi index 676d2d7..de3932a 100755 --- a/update.cgi +++ b/update.cgi @@ -8,7 +8,10 @@ use lib '.'; use strict vars; #use Apache::Registry; use CGI; +use UUID; +use Digest::HMAC_SHA1 qw(hmac_sha1_hex); use Util; +use English; use URI::Escape; use Net::LDAP qw(:all); @@ -29,6 +32,11 @@ if ($proto eq "http" || !($id && $password)) { my $ldap; +open (F, "<$config{passdir}/key-hmac-$UID") || &Util::HTMLError($!); +my $hmac_key = ; +close(F); +chomp($hmac_key); + sub DieHandler { $ldap->unbind if (defined($ldap)); } @@ -58,7 +66,11 @@ my $entries = $mesg->as_struct; if ($mesg->count != 1) { # complain and quit } - + +$mesg = $ldap->search(base => $config{hostbasedn}, filter => 'host=*'); +$mesg->code && &Util::HTMLError($mesg->error); +my $host_entries = $mesg->as_struct; + my @dns = keys(%$entries); my $entry = $entries->{$dns[0]}; @@ -105,6 +117,38 @@ if (!($query->param('doupdate'))) { . '>male