pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: m_fysh@hotmail.com
Subject: BUG #16364: ICACLS error when installing under system context "NT AUTHORITY\SYSTEM"  ie installing with SCCM
Date: Wed, 15 Apr 2020 06:31:29 +0000
Message-ID: <16364-88ed41c117f20e13@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      16364
Logged by:          MF
Email address:      m_fysh@hotmail.com
PostgreSQL version: 12.2
Operating system:   Windows 10
Description:        

ICACLS error when installing under system context "NT AUTHORITY\SYSTEM"  ie
installing with SCCM

System context has no user profile, the installer tries to set security
permissions to domain\hostname
The first call to icacls removes inheritance 
C:\WINDOWS\System32\icacls "C:\Windows\Temp/postgresql_installer_9283e94fc0"
/inheritance:r

The next call adds permissions for  domain\hostname$  (this should be "NT
AUTHORITY\SYSTEM" or "hostname\Administrators")
Executing C:\WINDOWS\System32\icacls
"C:\Windows\Temp/postgresql_installer_9283e94fc0" /T /Q /grant
"COR\Txxx6767$:(OI)(CI)F"

At that point the permissions on the folder have changed but the installer
no longer has access to the folder contents
So the next step fails 
Error running C:\WINDOWS\System32\icacls
"C:\Windows\Temp/postgresql_installer_9283e94fc0" /T /Q /grant
"CORP\TM10336767$:(OI)(CI)F":
C:\Windows\Temp/postgresql_installer_9283e94fc0\*: Access is denied.

To reproduce the error use the Sysinternals tool 
Open a cmd windows as admin the run 
psexec.exe -s -i cmd 
This will open a new CMD window in System context. install PostgreSQL

When installing as just and ADMIN user (with profile)
Executing icacls
"C:\Users\USER_adm\AppData\Local\Temp/postgresql_installer_57a6af5619"
/inheritance:r
the user is still the owner of the folder so can still make changes to it.

Note you are now adding the current user  domain\user in the next call to
icacls.exe
Executing icacls
"C:\Users\USER_adm\AppData\Local\Temp/postgresql_installer_57a6af5619" /T /Q
/grant "COR\USER_adm:(OI)(CI)F"
So an Admin User install will work
But a System install will not.

I tried this will 12.2.2, 12.2.1, 10.12.2



view thread (4+ messages)  latest in thread

Message-ID: <16364-88ed41c117f20e13@postgresql.org>
Permalink:  ../16364-88ed41c117f20e13@postgresql.org/
Also on:    postgresql.org/message-id/16364-88ed41c117f20e13@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, m_fysh@hotmail.com
  Subject: Re: BUG #16364: ICACLS error when installing under system context "NT AUTHORITY\SYSTEM"  ie installing with SCCM
  In-Reply-To: <16364-88ed41c117f20e13@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox