install Can't remove open logical volume "acromantula-domu1-disk"
this should be a matter of unmounting the mounted volume from /tmp.
-* Create "more random" passwords and salts
-
- Currently passwords are using the passwd function of OpenSSL which
- at the moment can only generate md5 hashes. The passwords can
- still be made quite strong though.
-
* Generic grub support
This will generate a much nicer menu.lst as a side effect, as its
--password=passphrase
Set the root password for the new guest.
+ --hash_method=algorithm
+ Override the default hashing method of sha256 and use the
+ provided algorithm. Can be : md5, sha256 or sha512
+
--passwd Ask for a root password interactively during setup.
NOTE: This overrides --genpass --password
$CONFIG{ 'genpass' } = 1;
$CONFIG{ 'genpass_len' } = 8;
$CONFIG{ 'password' } = '';
+ $CONFIG{ 'hash_method' } = 'sha256';
#
# The program to run to create a filesystem.
check => qr/^(?:[0-9a-f]{2}:){5}[0-9a-f]{2}$/i,
message => "must be a valid ethernet mac address.\n",
},
+ hashMethod => {
+ check => qr/^md5|sha256|sha512$/i,
+ message => "must be md5, sha256 or sha512.\n",
+ },
);
# Define what argument each option accepts.
extension => 'filename',
mac => 'mac',
ip => 'ipv4',
+ hash_method => 'hashMethod',
);
# If given option does not exists in optionsTypes,
"genpass-len=i", \&checkOption,
"genpass_len=i", \&checkOption,
"password=s", \&checkOption,
+ "hash_method=s",\&checkOption,
"partitions=s", \&checkOption,
"role=s", \&checkOption,
"role-args=s", \&checkOption,
{
$PASSWORD = $CONFIG { 'password' };
}
+
my $salt = generatePassword(8);
- my $hash = `echo -n $PASSWORD | openssl passwd -stdin -1 -salt $salt`;
- $hash =~ s/\s+$//;
+
+ my $hash_method;
+ if ($CONFIG{ 'hash_method' } eq 'md5')
+ {
+ $hash_method = '$1$';
+ }
+ elsif ($CONFIG{ 'hash_method' } eq 'sha256')
+ {
+ $hash_method = '$5$';
+ }
+ elsif ($CONFIG{ 'hash_method' } eq 'sha512')
+ {
+ $hash_method = '$6$';
+ }
+ else
+ {
+ die "oops... unknown hashing method, should not happen!";
+ }
+
+ my $hash = crypt($PASSWORD, $hash_method . $salt);
#
# Copy the file to ensure the original retains the correct
my $line;
while(defined($line = <TMP>))
{
- chomp $line;
$line =~ s#^root:[^:]*:#root:$hash:#;
- print SHADOW "$line\n";
+ print SHADOW $line;
}
#