Merge pull request #683 from Icinga:fix/jea_username_length_check_exclude_domain

Fix: JEA installer to exclude domain from user name length check

The domain of the provided user for JEA installation should not be included in the length check.

Windows has a maximum of 20 digits per username, which can easily be exceeded if the domain is wrongly included.
This commit is contained in:
Lord Hepipud 2024-02-20 14:16:20 +01:00 committed by GitHub
commit 173161cd54
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 16 additions and 6 deletions

View file

@ -11,6 +11,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/28)
### Bugfixes
* [#683](https://github.com/Icinga/icinga-powershell-framework/pull/683) Fixes JEA installer to exclude domain from user name length check, which can easily exceed the Windows 20 digits username limit
### Enhancements
* [#679](https://github.com/Icinga/icinga-powershell-framework/pull/679) Adds a new data provider for fetching process information of Windows systems, while sorting all objects based on a process name and their process id

View file

@ -13,9 +13,11 @@ function Install-IcingaJEAProfile()
return;
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return;
}

View file

@ -17,9 +17,11 @@ function Install-IcingaSecurity()
return;
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return;
}

View file

@ -13,9 +13,11 @@ function New-IcingaWindowsUser()
};
}
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
# Max length for the user name
if ($IcingaUser.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
if ($IcingaUserInfo.User.Length -gt 20) {
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
return @{
'User' = $null;