mirror of
https://github.com/xcat2/xcat-core.git
synced 2025-08-21 10:40:24 +00:00
For command 'rspconfig <node> "userid=<username>" "username=<username>" "password=<password>"', if no userid and username specified, the default userid will be 1, if userid not set but with username specified, the default userid will be 2
This commit is contained in:
@@ -672,7 +672,7 @@ sub setpassword {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sessdata->{onuserid} = '1';# User ID 1 is permanently associated with User 1, the null user name
|
||||
$sessdata->{onuserid} = '2';# The default userid will be 2 if no userid specified
|
||||
}
|
||||
}
|
||||
my @data = ();
|
||||
@@ -706,7 +706,13 @@ sub setpassword {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$sessdata->{onuserid} = '1';
|
||||
# If have username specified, if has been dealt will be store in newusername, else need to check the args array. And the default userid must be 2.
|
||||
if (exists($sessdata->{newusername}) or (grep /username/, @{$sessdata->{extraargs}})) {
|
||||
$sessdata->{onuserid} = '2';
|
||||
# If No username specified, the default userid will be 1.
|
||||
} else {
|
||||
$sessdata->{onuserid} = '1';
|
||||
}
|
||||
}
|
||||
}
|
||||
$command = 0x47;
|
||||
@@ -776,6 +782,14 @@ sub password_set {
|
||||
# xCAT::SvrUtils::sendmsg("set password Done",$callback,$sessdata->{node},%allerrornodes);
|
||||
# }
|
||||
#}
|
||||
|
||||
# Give out the return complete MSG
|
||||
if ($sessdata->{subcommand} =~ m/username/) {
|
||||
xCAT::SvrUtils::sendmsg("set username Done",$callback,$sessdata->{node},%allerrornodes);
|
||||
} elsif ($sessdata->{subcommand} =~ m/password/) {
|
||||
xCAT::SvrUtils::sendmsg("set password Done",$callback,$sessdata->{node},%allerrornodes);
|
||||
}
|
||||
|
||||
$sessdata->{subcommand} = shift @{$sessdata->{extraargs}};
|
||||
if ($sessdata->{subcommand} and $sessdata->{subcommand} ne '') {
|
||||
setpassword($sessdata);
|
||||
|
Reference in New Issue
Block a user