Skip to content

Commit 7215d6c

Browse files
committed
Grant access on DATA_DIR to domain user before initdb starting
1 parent 8189a2f commit 7215d6c

File tree

1 file changed

+5
-12
lines changed

1 file changed

+5
-12
lines changed

nsis/postgresql.nsi

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -368,10 +368,8 @@ Section $(PostgreSQLString) sec1
368368
;AccessControl::GrantOnFile "$DATA_DIR" "(BU)" "FullAccess" ;GenericWrite
369369
;Pop $0 ;"ok" or "error" + error details
370370

371-
;;;AccessControl::GrantOnFile "$DATA_DIR" "$ServiceAccount_text" "FullAccess"
372-
;;;Pop $0 ;"ok" or "error" + error details
373-
;;;AccessControl::GrantOnFile "$DATA_DIR" "$loggedInUser" "FullAccess" ;GenericWrite
374-
;;;Pop $0 ;"ok" or "error" + error details
371+
DetailPrint "GRANT FullAccess ON $DATA_DIR TO $loggedInUser"
372+
AccessControl::GrantOnFile "$DATA_DIR" "$loggedInUser" "FullAccess" ;GenericWrite
375373
DetailPrint "GRANT FullAccess ON $DATA_DIR TO $loggedInUserShort"
376374
AccessControl::GrantOnFile "$DATA_DIR" "$loggedInUserShort" "FullAccess"
377375
Pop $0
@@ -471,12 +469,6 @@ Section $(PostgreSQLString) sec1
471469
DetailPrint "GRANT FullAccess ON $DATA_DIR TO $ServiceAccount_text"
472470
AccessControl::GrantOnFile "$DATA_DIR" "$ServiceAccount_text" "FullAccess"
473471
Pop $0 ;"ok" or "error" + error details
474-
DetailPrint "GRANT FullAccess ON $DATA_DIR TO $loggedInUser"
475-
AccessControl::GrantOnFile "$DATA_DIR" "$loggedInUser" "FullAccess" ;GenericWrite
476-
Pop $0 ;"ok" or "error" + error details
477-
DetailPrint "GRANT FullAccess ON $DATA_DIR TO $loggedInUserShort"
478-
AccessControl::GrantOnFile "$DATA_DIR" "$loggedInUserShort" "FullAccess" ;GenericWrite
479-
Pop $0 ;"ok" or "error" + error details
480472

481473
DetailPrint "GRANT GenericRead + GenericExecute ON $INSTDIR TO $ServiceAccount_text"
482474
AccessControl::GrantOnFile "$INSTDIR" "$ServiceAccount_text" "GenericRead + GenericExecute"
@@ -486,17 +478,18 @@ Section $(PostgreSQLString) sec1
486478
AccessControl::GrantOnFile "$DATA_DIR\postgresql.conf" "$ServiceAccount_text" "FullAccess"
487479
Pop $0 ;"ok" or "error" + error details
488480
DetailPrint "GRANT FullAccess ON $DATA_DIR\postgresql.conf TO $loggedInUser"
489-
AccessControl::GrantOnFile "$DATA_DIR\postgresql.conf" "$loggedInUser" "FullAccess" ;"GenericRead + GenericExecute" ;GenericWrite
481+
AccessControl::GrantOnFile "$DATA_DIR\postgresql.conf" "$loggedInUser" "FullAccess"
490482
Pop $0 ;"ok" or "error" + error details
491483
DetailPrint "GRANT FullAccess ON $DATA_DIR\postgresql.conf TO $loggedInUserShort"
492-
AccessControl::GrantOnFile "$DATA_DIR\postgresql.conf" "$loggedInUserShort" "FullAccess" ;GenericWrite
484+
AccessControl::GrantOnFile "$DATA_DIR\postgresql.conf" "$loggedInUserShort" "FullAccess"
493485
Pop $0 ;"ok" or "error" + error details
494486

495487
DetailPrint "GRANT FullAccess ON $INSTDIR\scripts TO $loggedInUser"
496488
AccessControl::GrantOnFile "$INSTDIR\scripts" "$loggedInUser" "FullAccess"
497489
DetailPrint "GRANT GenericRead + GenericExecute ON $INSTDIR\scripts\pgpro_upgrade.cmd TO $loggedInUser"
498490
AccessControl::GrantOnFile "$INSTDIR\scripts\pgpro_upgrade.cmd" "$loggedInUser" "GenericRead + GenericExecute"
499491
Pop $0 ;"ok" or "error" + error details
492+
500493
${if} $isDataDirExist == 1
501494
; there exist data directory. We need to stop service,
502495
; run pgpro-upgrade script and

0 commit comments

Comments
 (0)