~ubuntu-branches/ubuntu/feisty/apache2/feisty

« back to all changes in this revision

Viewing changes to support/SHA1/htpasswd-sha1.pl

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Barth
  • Date: 2006-12-09 21:05:45 UTC
  • mfrom: (0.6.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20061209210545-h70s0xaqc2v8vqr2
Tags: 2.2.3-3.2
* Non-maintainer upload.
* 043_ajp_connection_reuse: Patch from upstream Bugzilla, fixing a critical
  issue with regard to connection reuse in mod_proxy_ajp.
  Closes: #396265

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl -w
 
2
use strict;
 
3
#
 
4
# Utility which takes a username and password
 
5
# on the command line and generates a username
 
6
# sha1-encrytped password on the stdout.
 
7
 
8
# Typical useage:
 
9
#       ./htpasswd-sha1.pl dirkx MySecret >> sha1-passwd
 
10
#
 
11
# This is public domain code.  Do whatever you want with it.
 
12
# It was originally included in Clinton Wong's Apache 1.3.6 SHA1/ldif
 
13
# patch distribution as sample code for generating entries for
 
14
# Apache password files using SHA1.
 
15
 
 
16
use MIME::Base64;  # http://www.cpan.org/modules/by-module/MIME/
 
17
use Digest::SHA1;  # http://www.cpan.org/modules/by-module/MD5/
 
18
 
 
19
if ($#ARGV!=1) { die "Usage $0: user password\n" }
 
20
 
 
21
print $ARGV[0], ':{SHA}', encode_base64( Digest::SHA1::sha1($ARGV[1]) );
 
22