Skip to content

Commit 173161c

Browse files
authored
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.
2 parents adec9b8 + 36015f4 commit 173161c

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

doc/100-General/10-Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
1111

1212
[Issues and PRs](https://github.com/Icinga/icinga-powershell-framework/milestone/28)
1313

14+
### Bugfixes
15+
16+
* [#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
17+
1418
### Enhancements
1519

1620
* [#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

lib/core/jea/Install-IcingaJeaProfile.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ function Install-IcingaJEAProfile()
1313
return;
1414
}
1515

16+
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
17+
1618
# Max length for the user name
17-
if ($IcingaUser.Length -gt 20) {
18-
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
19+
if ($IcingaUserInfo.User.Length -gt 20) {
20+
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
1921

2022
return;
2123
}

lib/core/windows/Install-IcingaSecurity.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ function Install-IcingaSecurity()
1717
return;
1818
}
1919

20+
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
21+
2022
# Max length for the user name
21-
if ($IcingaUser.Length -gt 20) {
22-
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
23+
if ($IcingaUserInfo.User.Length -gt 20) {
24+
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
2325

2426
return;
2527
}

lib/core/windows/New-IcingaWindowsUser.psm1

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ function New-IcingaWindowsUser()
1313
};
1414
}
1515

16+
$IcingaUserInfo = Split-IcingaUserDomain -User $IcingaUser;
17+
1618
# Max length for the user name
17-
if ($IcingaUser.Length -gt 20) {
18-
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUser;
19+
if ($IcingaUserInfo.User.Length -gt 20) {
20+
Write-IcingaConsoleError 'The specified user name "{0}" is too long. The maximum character limit is 20 digits.' -Objects $IcingaUserInfo.User;
1921

2022
return @{
2123
'User' = $null;

0 commit comments

Comments
 (0)