Merge branch 'master' of git+ssh://db.debian.org/git/userdir-ldap-cgi
authorMartin Zobel-Helas <zobel@debian.org>
Wed, 13 Jun 2012 20:45:51 +0000 (22:45 +0200)
committerMartin Zobel-Helas <zobel@debian.org>
Wed, 13 Jun 2012 20:45:51 +0000 (22:45 +0200)
* 'master' of git+ssh://db.debian.org/git/userdir-ldap-cgi:
  And a changelog entry for Nick's change
  Use the changes@ address consistently in preference to change@
  Try a different CreateCryptSalt approach

Conflicts:
debian/changelog

Util.pm
debian/changelog
html/forward.wml
update.cgi

diff --git a/Util.pm b/Util.pm
index 2b230ab..27060d7 100644 (file)
--- a/Util.pm
+++ b/Util.pm
@@ -33,27 +33,26 @@ sub CreateKey {
 }
 
 sub CreateCryptSalt {
+  # CreateCryptSalt(type = 0, skip_header = 0)
   # this can create either a DES type salt or a MD5 salt
-  # 0 for DES, 1 for MD5 salt and 2 for apache MD5 salt
-  my $type = shift;
+  # 0 for DES, 1 for MD5 salt
+  # if skip_header is 0, does not add $1$ for md5 salts.
+  my $md5 = shift; # do we want a MD5 salt?
+  my $no_crypttype_header = shift;
   my $validstr = './0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
   my @valid = split(//,$validstr);
   my ($in, $out);
-  
-  my $cryptsaltlen = 2;
-  if (($type == 1)||($type == 2)) {
-    $cryptsaltlen = 8;
-  }
-  
+
+  my $cryptsaltlen = ($md5 ? 8 : 2);
+
   open (F, "</dev/urandom") || die &HTMLError("No /dev/urandom found!");
   foreach (1..$cryptsaltlen) {
     read(F, $in, 1);
     $out .= $valid[ord($in) % ($#valid + 1)];
   }
   close F;
-  my $md5 = $out;
-  if ($type == 1) { $md5 = "\$1\$$out\$"; }
-  return $md5
+  if ($md5 == 1 && !$no_crypttype_header) { $out = "\$1\$$out\$"; }
+  return $out
 }
 
 sub Encrypt { 
index 224b677..842f5df 100644 (file)
@@ -1,8 +1,12 @@
 userdir-ldap-cgi (0.3.37) UNRELEASED; urgency=low
 
+  [ Martin Zobel-Helas ]
   * use libjs-jquery-tablesorter to sort machines.cgi
 
- -- Martin Zobel-Helas <zobel@debian.org>  Fri, 09 Mar 2012 10:03:46 +0100
+  [ Nick Mathewson ]
+  * Use the changes@ address consistently in preference to change@.
+
+ -- Peter Palfrader <weasel@debian.org>  Sun, 10 Jun 2012 22:03:14 +0200
 
 userdir-ldap-cgi (0.3.36) unstable; urgency=low
 
index b0bc436..a2b6375 100644 (file)
@@ -29,7 +29,7 @@ not create a forward file then that machine will spool the mail to
 <p>
 The email forwarding can be easily reconfigured using GnuPG:
 <pre>
-echo "emailforward: foo@bar.com" | gpg --clearsign | mail change@db.debian.org
+echo "emailforward: foo@bar.com" | gpg --clearsign | mail changes@db.debian.org
 </pre>
 or by visiting <a href="https://db.debian.org/login.html">db.debian.org</a>
 
index 02d3a5b..f1f82f9 100755 (executable)
@@ -249,7 +249,7 @@ if (!($query->param('doupdate'))) {
     }
 
     # create a md5 crypted password
-    $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateCryptSalt(2));
+    $newwebpassword = apache_md5_crypt($query->param('newwebpass'), &Util::CreateCryptSalt(1, 1));
     
     &Util::LDAPUpdate($ldap, $editdn, 'webPassword', $newwebpassword);
   }