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

Use env vars instead of Etc module for local user lookup #293

Conversation

felixbuenemann
Copy link
Contributor

This ensures that the code works on both Unix and Windows, while Etc.getpwuid relied on /etc/passwd being present, so it returned a NoMethodError when calling name on Windows.

This change has been discussed in capistrano/capistrano#1521.

This ensures that the code works on both Unix and Windows, while
Etc.getpwuid relied on /etc/passwd being present.
@felixbuenemann
Copy link
Contributor Author

@leehambley ping.

@leehambley
Copy link
Member

Cheers!
On 1 Nov 2015 8:18 p.m., "Felix Bünemann" notifications@github.com wrote:

@leehambley https://github.com/leehambley ping.


Reply to this email directly or view it on GitHub
#293 (comment).

leehambley added a commit that referenced this pull request Nov 1, 2015
…er-name

Use env vars instead of Etc module for local user lookup
@leehambley leehambley merged commit d1b757d into capistrano:master Nov 1, 2015
@felixbuenemann felixbuenemann deleted the use-env-vars-for-local-user-name branch November 1, 2015 22:00
felixbuenemann added a commit to felixbuenemann/airbrussh that referenced this pull request Nov 1, 2015
This accounts for changes in sshkit's local username lookup introduced
by capistrano/sshkit#293 and also accounts for the conditional
formatting changes introduced by mattbrictson#66.

The latter did not previously cause failed tests, because the username
was stubbed in the tests, causing the relevant code to not be exercised.

Now the username is looked up through sshkit, which results in an empty
username on sshkit < 1.7.0, so the no-username display is triggered.
felixbuenemann added a commit to felixbuenemann/airbrussh that referenced this pull request Nov 1, 2015
This accounts for changes in sshkit's local username lookup introduced
by capistrano/sshkit#293 and also accounts for the conditional
formatting changes introduced by mattbrictson#66.

The latter did not previously cause failed tests, because the username
was stubbed in the tests, causing the relevant code to not be exercised.

Now the username is looked up through sshkit, which results in an empty
username on sshkit < 1.7.0, so the no-username display is triggered.

Unfortunately we need to keep the Etc stub for now to avoid crashing on
Windows with sshkit 1.7.0 and 1.7.1.
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.

None yet

2 participants