Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert all entrypoint "echo"s to "printf" #1024

Merged
merged 1 commit into from
Dec 21, 2022

Conversation

tianon
Copy link
Member

@tianon tianon commented Dec 21, 2022

The use of the echo shell built-in has been actively discouraged for a long time, but it's really convenient so we keep doing it. This converts them all to use printf appropriately such that we avoid issues like echo "$someVar" from doing the wrong thing if $someVar is -n or similar.

Closes #1023

The use of the `echo` shell built-in has been actively discouraged for a long time, but it's really convenient so we keep doing it.  This converts them all to use `printf` appropriately such that we avoid issues like `echo "$someVar"` from doing the wrong thing if `$someVar` is `-n` or similar.
@yosifkit yosifkit merged commit 7a852f4 into docker-library:master Dec 21, 2022
@yosifkit yosifkit deleted the no-echo branch December 21, 2022 20:01
docker-library-bot added a commit to docker-library-bot/official-images that referenced this pull request Dec 22, 2022
Changes:

- docker-library/postgres@7a852f4: Merge pull request docker-library/postgres#1024 from infosiftr/no-echo
- docker-library/postgres@7e5e7ec: Convert all entrypoint "echo"s to "printf"
- docker-library/postgres@f8827c3: Update generated README
stanhu added a commit to stanhu/postgres that referenced this pull request Dec 22, 2022
docker-library#1024 converted all
`echo` calls to `printf`, but this change causes the password file
used by `initdb` to be blank rather than contain a single new line.
As a result, `initdb` will fail to start with an empty value with
the error:

```
initdb: error: password file "/dev/fd/63" is empty
```

`POSTGRES_PASSWORD` can be blank if `POSTGRES_HOST_AUTH_METHOD=trust`
is used. This change adds a newline to restore the original behavior.

Closes docker-library#1025
stanhu added a commit to stanhu/postgres that referenced this pull request Dec 22, 2022
docker-library#1024 converted all
`echo` calls to `printf`, but this change causes the password file
used by `initdb` to be blank rather than contain a single newline.
As a result, `initdb` will fail to start with an empty value with
the error:

```
initdb: error: password file "/dev/fd/63" is empty
```

`POSTGRES_PASSWORD` can be blank if `POSTGRES_HOST_AUTH_METHOD=trust`
is used. This change adds a newline to restore the original behavior.

Closes docker-library#1025
bicrypt pushed a commit to panascais-docker/postgresql that referenced this pull request Mar 18, 2023
docker-library/postgres#1024 converted all
`echo` calls to `printf`, but this change causes the password file
used by `initdb` to be blank rather than contain a single newline.
As a result, `initdb` will fail to start with an empty value with
the error:

```
initdb: error: password file "/dev/fd/63" is empty
```

`POSTGRES_PASSWORD` can be blank if `POSTGRES_HOST_AUTH_METHOD=trust`
is used. This change adds a newline to restore the original behavior.

Closes #1025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsafe use of echo (may set empty password)
2 participants