Commit d7b2a209 authored by Leigh Stoller's avatar Leigh Stoller

Minor tweak to allow a "*" (star) password entry to be specified in

the xml file.
parent 273b35d6
#!/usr/bin/perl -wT
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
# Copyright (c) 2000-2008 University of Utah and the Flux Group.
# All rights reserved.
#
use English;
......@@ -274,23 +274,29 @@ UserError("Email address already in use; please pick another!")
# Check the password.
#
my $pswd = $xmlparse->{'attribute'}->{'password'}->{'value'};
my $checkpass_args = escapeshellarg($pswd);
$checkpass_args .= " " .
(exists($newuser_args{'uid'}) ? $newuser_args{'uid'} : "ignored");
$checkpass_args .= escapeshellarg($newuser_args{'usr_name'} . ":" .
$newuser_args{'usr_email'});
# Admins can "star" the password entry.
if ($this_user->IsAdmin() && $pswd eq "*") {
$newuser_args{'usr_pswd'} = "*";
}
else {
my $checkpass_args = escapeshellarg($pswd);
$checkpass_args .= " " .
(exists($newuser_args{'uid'}) ? $newuser_args{'uid'} : "ignored");
$checkpass_args .= escapeshellarg($newuser_args{'usr_name'} . ":" .
$newuser_args{'usr_email'});
my $pwokay = `$checkpass $checkpass_args`;
if ($?) {
chomp($pwokay);
my $pwokay = `$checkpass $checkpass_args`;
if ($?) {
chomp($pwokay);
if (! ($pwokay =~ /^ok$/)) {
UserError("$pwokay");
if (! ($pwokay =~ /^ok$/)) {
UserError("$pwokay");
}
fatal("Checkpass failed with $?");
}
fatal("Checkpass failed with $?");
$newuser_args{'usr_pswd'} = crypt($pswd, "\$1\$" . substr(time(), 0, 8));
}
$newuser_args{'usr_pswd'} = crypt($pswd, "\$1\$" . substr(time(), 0, 8));
#
# Do a check on the pubkey if supplied. The safest thing to do is generate
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment