Skip to content

Commit 818958f

Browse files
authored
Merge pull request #511 from infosiftr/pass-100
Warn on POSTGRES_PASSWORD of 100+ characters
2 parents 0d9c944 + 45b855a commit 818958f

11 files changed

+143
-0
lines changed

10/alpine/docker-entrypoint.sh

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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

+13
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'

docker-entrypoint.sh

+13
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)