◐ Shell
clean mode source ↗

bpo-36161: Use thread-safe function ttyname_r instead of unsafe one ttyname by chibby0ne · Pull Request #14868 · python/cpython

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

mangrisano

benjaminp

benjaminp

benjaminp

benjaminp

Comment on lines 2791 to 2792

* Use dynamically-allocated buffer for ttyname_r buffer
* In case there is an error with the crypt/crypt_r then raise the error,
instead of failing silently.
* Check for EINVAL (invalid argument) in errno when adding not supported
cryptographic methods, such as Blowfish in the case of glibc, but raise
other errors.
* Use _SC_TTY_MAX_LENGTH for TTY_NAME_MAX

Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>

@chibby0ne chibby0ne changed the title bpo-36161: Use thread-safe functions instead of unsafe ones (crypt, ttyname) bpo-36161: Use thread-safe function ttyname_r instead of unsafe one ttyname

Oct 5, 2019

jacobneiltaylor pushed a commit to jacobneiltaylor/cpython that referenced this pull request

Dec 5, 2019
…onGH-14868)

Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>

@glebm glebm mentioned this pull request

Dec 4, 2024

erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request

Jan 4, 2025
PR python#14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.

erlend-aasland added a commit that referenced this pull request

Jan 7, 2025
PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.

erlend-aasland added a commit to erlend-aasland/cpython that referenced this pull request

Jan 7, 2025

erlend-aasland added a commit that referenced this pull request

Jan 7, 2025
…) (#128599)

(cherry picked from commit e08b282)

PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.

srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request

Jan 8, 2025

erlend-aasland added a commit that referenced this pull request

Jan 11, 2025
…) (#128598)

(cherry picked from commit e08b282)

PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.