Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fcac595

Browse files
committed
PGPRO-2784: Windows installer does not clear permissive ACL entries
1 parent c8d7b40 commit fcac595

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

build/build64.cmd

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
SET ARCH=X64
22
SET SDK=MSVC2013
3-
SET PG_MAJOR_VERSION=10
4-
SET PG_PATCH_VERSION=4
3+
SET PG_MAJOR_VERSION=12
4+
SET PG_PATCH_VERSION=0
55
SET PRODUCT_NAME=PostgreSQL
66
rem SET PRODUCT_NAME=PostgreSQL 1C
77
rem SET ONE_C=YES
88
rem SET PGURL=http://repo.postgrespro.ru/1c-10-beta/src/postgrespro-1c-10.3.tar.bz2
9+
SET PERL5LIB=.
10+
SET MSBFLAGS=/m
911
call run.cmd %1

nsis/postgresql.nsi

+28
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,17 @@ Section $(componentServer) sec1
933933
${endif}
934934
FileClose $LogFile ;Closes the filled file
935935

936+
937+
AccessControl::DisableFileInheritance "$DATA_DIR"
938+
AccessControl::RevokeOnFile "$DATA_DIR" "(BU)" "GenericWrite + GenericRead"
939+
AccessControl::RevokeOnFile "$DATA_DIR" "(AU)" "GenericWrite + GenericRead"
940+
AccessControl::RevokeOnFile "$DATA_DIR" "(DU)" "GenericWrite + GenericRead"
941+
942+
push "$INSTDIR"
943+
call createAccessForFolder
944+
945+
946+
936947
SectionEnd
937948

938949
Section $(componentDeveloper) secDev
@@ -2509,3 +2520,20 @@ Function un.onInit
25092520
${endif}
25102521

25112522
FunctionEnd
2523+
2524+
Function createAccessForFolder
2525+
pop $0
2526+
AccessControl::DisableFileInheritance "$0"
2527+
AccessControl::RevokeOnFile "$0" "(BU)" "GenericWrite"
2528+
AccessControl::RevokeOnFile "$0" "(AU)" "GenericWrite"
2529+
AccessControl::RevokeOnFile "$0" "(DU)" "GenericWrite"
2530+
AccessControl::GrantOnFile "$0" "(BU)" "GenericRead + GenericExecute"
2531+
${if} ${AtLeastWin8}
2532+
;ALL_APP_PACKAGES (S-1-15-2-1)
2533+
AccessControl::GrantOnFile "$0" "(S-1-15-2-1)" "GenericRead + GenericExecute"
2534+
;The SID for "ALL RESTRICTED APPLICATION PACKAGES" is S-1-15-2-2
2535+
AccessControl::GrantOnFile "$0" "(S-1-15-2-2)" "GenericRead + GenericExecute"
2536+
${endif}
2537+
2538+
FunctionEnd
2539+

0 commit comments

Comments
 (0)