dbmmanage revision 09fe0b69d3d1e8c8041c9ce99ee77b8b44b5e3b1
1N/A# ==================================================================== 1N/A# Copyright (c) 1995-1999 The Apache Group. All rights reserved. 1N/A# Redistribution and use in source and binary forms, with or without 1N/A# modification, are permitted provided that the following conditions 1N/A# 1. Redistributions of source code must retain the above copyright 1N/A# notice, this list of conditions and the following disclaimer. 1N/A# 2. Redistributions in binary form must reproduce the above copyright 1N/A# notice, this list of conditions and the following disclaimer in 1N/A# the documentation and/or other materials provided with the 1N/A# 3. All advertising materials mentioning features or use of this 1N/A# software must display the following acknowledgment: 1N/A# "This product includes software developed by the Apache Group 1N/A# 4. The names "Apache Server" and "Apache Group" must not be used to 1N/A# endorse or promote products derived from this software without 1N/A# prior written permission. For written permission, please contact 1N/A# 5. Products derived from this software may not be called "Apache" 1N/A# nor may "Apache" appear in their names without prior written 1N/A# permission of the Apache Group. 1N/A# 6. Redistributions of any form whatsoever must retain the following 1N/A# "This product includes software developed by the Apache Group 1N/A# THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY 1N/A# EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1N/A# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 1N/A# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR 1N/A# ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1N/A# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 1N/A# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 1N/A# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 1N/A# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 1N/A# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 1N/A# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 1N/A# OF THE POSSIBILITY OF SUCH DAMAGE. 1N/A# ==================================================================== 1N/A# This software consists of voluntary contributions made by many 1N/A# individuals on behalf of the Apache Group and was originally based 1N/A# on public domain software written at the National Center for 1N/A# Supercomputing Applications, University of Illinois, Urbana-Champaign. 1N/A# For more information on the Apache Group and the Apache HTTP server 1N/A#for more functionality see the HTTPD::UserAdmin module: 1N/A# usage: dbmmanage <DBMfile> <command> <key> <value> 1N/A# if your osname is in $newstyle_salt, then use new style salt (starts with '_' and contains 1N/A# four bytes of iteration count and four bytes of salt). Otherwise, just use 1N/A# the traditional two-byte salt. 1N/A# see the man page on your system to decide if you have a newer crypt() lib. 1N/A# I believe that 4.4BSD derived systems do (at least BSD/OS 2.0 does). 1N/A# The new style crypt() allows up to 20 characters of the password to be 1N/A# significant rather than only 8. 1N/A# remove extension if any die "Can't use empty password!\n" unless $crypted_pwd; die "They don't match, sorry.\n" unless getpass("Re-type new password:") eq $value; $crypted_pwd = crypt $value, caller->salt; die "Sorry, user `$key' doesn't exist!\n" unless $DB{$key}; delete $DB{$key}, print "`$key' deleted\n";