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

Split macOS and Linux implementations and fix password echo bug #436

Merged
merged 1 commit into from
Sep 3, 2021

Conversation

mjcheetham
Copy link
Collaborator

@mjcheetham mjcheetham commented Sep 2, 2021

Previously the PosixTerminal class used the POSIX termios structure and tcgetattr/tcsetattr functions for both macOS and Linux systems.

However, it transpires that the definition of the termios flags fields differs between Mac and Linux. On Linux the fields are unsigned int (4 bytes), but on macOS the fields are unsigned long (8 bytes).

This change splits the termios structure into Mac and Linux flavours and sets the correct field offsets.

This also fixes a bug with the bit fiddling.. previously we correctly cleared the echo bit when needed, but failed to set the bit if needed. This was not really an issue since echo is usually default "on" anyway.

Fixes #432

Previously the PosixTerminal class used the POSIX termios structure and
tcgetattr/tcsetattr functions for both macOS and Linux systems.

However, it transpires that the definition of the termios flags fields
differs between Mac and Linux. On Linux the fields are unsigned int (4
bytes), but on macOS the fields are unsigned long (8 bytes).

This change splits the termios structure into Mac and Linux flavours and
sets the correct field offsets.
@mjcheetham mjcheetham added bug A bug in Git Credential Manager platform:linux Specific to a Linux-based platform labels Sep 2, 2021
Copy link
Collaborator

@dscho dscho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mjcheetham mjcheetham merged commit 083579c into git-ecosystem:main Sep 3, 2021
@mjcheetham mjcheetham mentioned this pull request Oct 8, 2021
@mjcheetham mjcheetham deleted the termios branch July 10, 2023 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in Git Credential Manager platform:linux Specific to a Linux-based platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hide password when supplying basic credentials
3 participants