summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <shemming@brocade.com>2013-05-02 14:35:23 -0700
committerStephen Hemminger <shemming@brocade.com>2013-05-02 14:35:23 -0700
commit06de833692473549d168081461cc089dbefb8365 (patch)
tree8323aca7991fde0d211e6777daebccf6580be0b5
parent22c7f9b24a4b04be73eb6b7a901efe19e5cb180c (diff)
downloadvyatta-cfg-system-06de833692473549d168081461cc089dbefb8365.tar.gz
vyatta-cfg-system-06de833692473549d168081461cc089dbefb8365.zip
login: force vyatta user's to have vbash as shell
If account already existed in passwd file, but then same user added to Vyatta config, force the shell to be vbash. This fixes case of autologin on initial livecd boot where the autologin happens as 'vyatta' but gets bash instead of vbash as shell.
-rwxr-xr-xlib/Vyatta/Login/User.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Vyatta/Login/User.pm b/lib/Vyatta/Login/User.pm
index 411aed6c..1bf058d6 100755
--- a/lib/Vyatta/Login/User.pm
+++ b/lib/Vyatta/Login/User.pm
@@ -158,12 +158,13 @@ sub _update_user {
# make new user using vyatta shell
# and make home directory (-m)
# and with default group of 100 (users)
- $cmd = 'useradd -s /bin/vbash -m -N';
+ $cmd = 'useradd -m -N';
} else {
# update existing account
$cmd = "usermod";
}
+ $cmd .= " -s /bin/vbash";
$cmd .= " -p '$pwd'";
$cmd .= " -c \"$fname\"" if ( defined $fname );
$cmd .= " -d \"$home\"" if ( defined $home );