summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-13 13:04:17 +0100
committerDaniil Baturin <daniil@baturin.org>2015-08-16 08:23:09 +0200
commit88f56586caf3488d9849bd658a68409e59559f3e (patch)
treeb501c57da9d12626259fac40ea7d39f2d1a7ab5a /lib
parentbf4115a924fc44dd70b4cfb744eda2b775ce044d (diff)
downloadvyatta-cfg-system-88f56586caf3488d9849bd658a68409e59559f3e.tar.gz
vyatta-cfg-system-88f56586caf3488d9849bd658a68409e59559f3e.zip
vyatta-cfg-system: missing encrypted-password breaks user config node
The fix for bug #557 now allows the encrypted-password Authentication node to be deleted again, but this causes the config to fail on reboot, leaving the user login node empty. This fix checks for an empty / missing encrypted-password node on reboot / config reload, either creating a new node or replacing the existing one and assigning it the value of "!". This has the same effect as the fix for bug #336, allowing the user to be set as only using RSA based logins. Bug #573 http://bugzilla.vyos.net/show_bug.cgi?id=573
Diffstat (limited to 'lib')
-rwxr-xr-xlib/Vyatta/Login/User.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index d3e9b8bd..e03888cd 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -126,9 +126,14 @@ sub _delete_user {
sub _update_user {
my $user = shift;
my $cfg = new Vyatta::Config;
-
+ my $pwd = "";
+
$cfg->setLevel("system login user $user");
- my $pwd = $cfg->returnValue('authentication encrypted-password');
+ if ($cfg->exists('authentication encrypted-password')) {
+ $pwd = $cfg->returnValue('authentication encrypted-password');
+ } else {
+ $pwd = "!";
+ }
my $level = $cfg->returnValue('level');
my $fname = $cfg->returnValue('full-name');
my $home = $cfg->returnValue('home-directory');