#!@perlbin@
java.lang.NullPointerException # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at
java.lang.NullPointerException # http://www.apache.org/licenses/LICENSE-2.0
java.lang.NullPointerException # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
#for more functionality see the HTTPD::UserAdmin module: # http://www.perl.com/CPAN/modules/by-module/HTTPD/HTTPD-Tools-x.xx.tar.gz
java.lang.NullPointerException # usage: dbmmanage <DBMfile> <command> <user> <password> <groups> <comment>
package dbmmanage; # -ldb -lndbm -lgdbm -lsdbm
BEGIN { @AnyDBM_File::ISA = qw(DB_File NDBM_File GDBM_File SDBM_File) }
use strict;
use Fcntl;
use AnyDBM_File ();
sub usage {
my $cmds = join "|", sort keys %dbmc::;
die <<SYNTAX;
Usage: dbmmanage [enc] dbname command [username [pw [group[,group] [comment]]]]
where enc is -d for crypt hashing (default except on Win32, Netware)
-m for MD5 hashing (default on Win32, Netware)
-s for SHA1 hashing
-p for plaintext
command is one of: $cmds
pw of . for update command retains the old password
pw of - (or blank) for update command prompts for the password
groups or comment of . (or blank) for update command retains old values
groups or comment of - for update command clears the existing value
groups or comment of - for add and adduser commands is the empty value
SYNTAX
}
sub need_sha1_hash { if (!eval ('require "Digest/SHA1.pm";')) {
print STDERR <<SHAERR;
dbmmanage SHA1 passwords require the interface or the module Digest::SHA1
available from CPAN:
Please install Digest::SHA1 andtry again, or use a different hashing option:
SHAERR
usage();
}
}
sub need_md5_hash { if (!eval ('require "Crypt/PasswdMD5.pm";')) {
print STDERR <<MD5ERR;
dbmmanage MD5 passwords require the module Crypt::PasswdMD5 available from CPAN
Please install Crypt::PasswdMD5 andtry again, or use a different hashing option:
MD5ERR
usage();
}
}
# if your osname is in $newstyle_salt, then use new style salt (starts with '_'and contains # four bytes of iteration count and four bytes of salt). Otherwise, just use # the traditional two-byte salt. # see the man page on your system to decide if you have a newer crypt() lib. # I believe that 4.4BSD derived systems do (at least BSD/OS 2.0 does). # The new style crypt() allows up to 20 characters of the password to be # significant rather than only 8.
java.lang.NullPointerException
my $newstyle_salt_platforms = join '|', qw{bsdos}; #others?
my $newstyle_salt = $^O =~ /(?:$newstyle_salt_platforms)/;
# Some platforms just can't crypt() for Apache
java.lang.NullPointerException
my $crypt_not_supported_platforms = join '|', qw{MSWin32 NetWare}; #others?
my $crypt_not_supported = $^O =~ /(?:$crypt_not_supported_platforms)/;
my $hash_method = "crypt";
if ($crypt_not_supported) {
$hash_method = "md5";
}
# Some platforms won't jump through our favorite hoops
java.lang.NullPointerException
my $not_unix_platforms = join '|', qw{MSWin32 NetWare}; #others?
my $not_unix = $^O =~ /(?:$not_unix_platforms)/;
if ($crypt_not_supported) {
$hash_method = "md5";
}
if (@ARGV[0] eq "-d") {
shift @ARGV; if ($crypt_not_supported) {
print STDERR "Warning: Apache/$^O does not support crypt()ed passwords!\n\n";
}
$hash_method = "crypt";
}
if (@ARGV[0] eq "-p") {
shift @ARGV; if (!$crypt_not_supported) {
print STDERR "Warning: Apache/$^O does not support plaintext passwords!\n\n";
}
$hash_method = "plain";
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.