Skip to content

Commit 45b855a

Browse files
committed
Warn on POSTGRES_PASSWORD of 100+ characters
1 parent 0d9c944 commit 45b855a

11 files changed

+143
-0
lines changed

10/alpine/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

10/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

11/alpine/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

11/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.4/alpine/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.4/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.5/alpine/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.5/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.6/alpine/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

9.6/docker-entrypoint.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ if [ "$1" = 'postgres' ]; then
8484
# messes it up
8585
if [ -n "$POSTGRES_PASSWORD" ]; then
8686
authMethod=md5
87+
88+
if [ "${#POSTGRES_PASSWORD}" -ge 100 ]; then
89+
cat >&2 <<-'EOWARN'
90+
91+
WARNING: The supplied POSTGRES_PASSWORD is 100+ characters.
92+
93+
This will not work if used via PGPASSWORD with "psql".
94+
95+
https://www.postgresql.org/message-id/flat/E1Rqxp2-0004Qt-PL%40wrigleys.postgresql.org (BUG #6412)
96+
https://github.com/docker-library/postgres/issues/507
97+
98+
EOWARN
99+
fi
87100
else
88101
# The - option suppresses leading tabs but *not* spaces. :)
89102
cat >&2 <<-'EOWARN'

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy