Skip to content
Snippets Groups Projects
Commit 90317882 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Use login name if provided in LDAP

parent b5005e00
No related branches found
No related tags found
No related merge requests found
...@@ -149,6 +149,7 @@ if ($mesg->code()) { ...@@ -149,6 +149,7 @@ if ($mesg->code()) {
# Some flags we may need # Some flags we may need
my $needDSS; my $needDSS;
my $loginUsername;
# If no matches # If no matches
...@@ -188,6 +189,12 @@ if ($ldapEntry) { ...@@ -188,6 +189,12 @@ if ($ldapEntry) {
$port = $ldapLoginPort; $port = $ldapLoginPort;
} }
# Check if we need to set the username
if (my $ldapLoginUsername = $ldapEntry->get_value('awitLoginUsername')) {
logger('INFO'," - Username %s (awitLoginUsername)",$ldapLoginUsername);
$loginUsername = $ldapLoginUsername;
}
# Check if we have a description # Check if we have a description
if (my $ldapDescription = $ldapEntry->get_value('description')) { if (my $ldapDescription = $ldapEntry->get_value('description')) {
logger('INFO',"Description"); logger('INFO',"Description");
...@@ -223,6 +230,11 @@ if (defined($port)) { ...@@ -223,6 +230,11 @@ if (defined($port)) {
push(@sshArgs,'-p',$port); push(@sshArgs,'-p',$port);
} }
# Check if we have a different username defined to login as
if (defined($loginUsername)) {
push(@sshArgs,'-l',$loginUsername);
}
# If the server is ancient, we need to enable DSS # If the server is ancient, we need to enable DSS
if (defined($needDSS)) { if (defined($needDSS)) {
push(@sshArgs,'-o','PubkeyAcceptedKeyTypes=+ssh-dss'); push(@sshArgs,'-o','PubkeyAcceptedKeyTypes=+ssh-dss');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment