Skip to content

Commit

Permalink
Update server installer XML: Replace "NT AUTHORITY\SYSTEM" with it's SID
Browse files Browse the repository at this point in the history
The ruleList for "NT AUTHORITY\SYSTEM" doesn't work on Windows
system with non-English languages as they are named differently.
Hence, find and use the Security Identifier (SID) for the local system
account instead which are standard and work on all languages

Also, bump package revision for postgresql server installer

DBP-1019, Sandeep Thakkar, Reviewed by Muralikrishna Bandaru
  • Loading branch information
sandeep-edb committed Nov 30, 2024
1 parent 57199bc commit a4a1f50
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions server/installer.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ EOF
<compareText logic="equals" text="${platform_name}" value="windows"/>
</ruleList>
</setInstallerVariableFromScriptOutput>
<logMessage>
<text>"whoami: ${whoami}"</text>
</logMessage>
<!-- Windows: System account SID so that ruleList works for non-English language -->
<runProgram>
<program>${env(WINDIR)}\System32\whoami</program>
<programArguments>/USER /nh</programArguments>
</runProgram>
<setInstallerVariableFromRegEx>
<name>whoami_sid</name>
<pattern>^.*\s+(S-[0-9-]+)\s*$</pattern>
<substitution>\1</substitution>
<text>${program_stdout}</text>
</setInstallerVariableFromRegEx>
<logMessage>
<text>"whoami_sid: ${whoami_sid}"</text>
</logMessage>

<!-- Use 'whoami' to work with "NT AUTHORITY\SYSTEM" user as 'system_username' not working-->
<actionGroup>
<actionList>
Expand All @@ -144,7 +162,7 @@ EOF
</actionList>
<ruleList>
<compareText logic="equals" text="${platform_name}" value="windows"/>
<compareText logic="equals" text="${whoami}" value="nt authority\system"/>
<compareText logic="equals" text="${whoami_sid}" value="S-1-5-18"/>
</ruleList>
</actionGroup>
<!-- Use 'system_username' to work with local administrator accounts -->
Expand All @@ -167,7 +185,7 @@ EOF
</actionList>
<ruleList>
<compareText logic="equals" text="${platform_name}" value="windows"/>
<compareText logic="does_not_equal" text="${whoami}" value="nt authority\system"/>
<compareText logic="does_not_equal" text="${whoami_sid}" value="S-1-5-18"/>
</ruleList>
</actionGroup>
</actionList>
Expand Down
2 changes: 1 addition & 1 deletion server/version.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pg_major_version=16
pg_minor_version=6
package_revision=1
package_revision=2
pgadmin4=8.13
languagepack=4.4-1
stackbuilder=4.2.2

0 comments on commit a4a1f50

Please sign in to comment.