VERSION=5.0
PACKAGE=libpve-access-control
-PKGREL=2
+PKGREL=3
DESTDIR=
PREFIX=/usr
my $cmd = ['usermod'];
- my $epw = PVE::Auth::Plugin::encrypt_pw($password);
+ my $epw = PVE::Tools::encrypt_pw($password);
push @$cmd, '-p', $epw, $username;
use strict;
use warnings;
+use PVE::Tools;
use PVE::Auth::Plugin;
use PVE::Cluster qw(cfs_register_file cfs_read_file cfs_write_file cfs_lock_file);
lock_shadow_config(sub {
my $shadow_cfg = cfs_read_file($shadowconfigfile);
- my $epw = PVE::Auth::Plugin::encrypt_pw($password);
+ my $epw = PVE::Tools::encrypt_pw($password);
$shadow_cfg->{users}->{$username}->{shadow} = $epw;
cfs_write_file($shadowconfigfile, $shadow_cfg);
});
return $res;
}
-my $salt_starter = time();
-
-sub encrypt_pw {
- my ($pw) = @_;
-
- $salt_starter++;
- my $salt = substr(Digest::SHA::sha1_base64(time() + $salt_starter + $$), 0, 8);
-
- # crypt does not want '+' in salt (see 'man crypt')
- $salt =~ s/\+/X/g;
-
- return crypt(encode("utf8", $pw), "\$5\$$salt\$");
-}
-
my $defaultData = {
propertyList => {
type => { description => "Realm type." },
+libpve-access-control (5.0-3) unstable; urgency=medium
+
+ * use new PVE::OTP class from pve-common
+
+ * use new PVE::Tools::encrypt_pw from pve-common
+
+ -- Proxmox Support Team <support@proxmox.com> Thu, 30 Mar 2017 17:45:55 +0200
+
libpve-access-control (5.0-2) unstable; urgency=medium
* encrypt_pw: avoid '+' for crypt salt