Unset bootstrap credentials before exec-ing the server (#1412)

POSTGRES_PASSWORD (and related vars) are only needed during initdb and
the temporary-server initialisation phase. After that they serve no
purpose, but remain in the process environment for the entire lifetime
of the container, where any loaded C extension can read them via
environ.

Unsetting them immediately before the final exec ensures the running
PostgreSQL server process starts with a clean environment.
This commit is contained in:
Mats Kindahl authored and GitHub committed 2026-07-06 11:12:21 -07:00
1 parent be0b7ac960
commit 4f9ced003b
25 files changed
+50

No files matched your search

+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"
+2
View File
@@ -377,6 +377,8 @@ _main() {
EOM
fi
unset "${!POSTGRES_@}"
fi
exec "$@"