8000 Mac install: use 'whoami' for user name by derrickstolee · Pull Request #356 · microsoft/scalar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Mac install: use 'whoami' for user name #356

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

Merged
merged 1 commit into from
Mar 25, 2020

Conversation

derrickstolee
Copy link
Contributor
@derrickstolee derrickstolee commented Mar 25, 2020

Resolves #336.

Since sudo whoami always returns "root", we should not just replace our use of logname with whoami. Instead, fall back to whoami only if logname returns "root".

Copy link
Member
@kewillford kewillford 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. Did you try running the install script with sudo and see if it returned root? Just curious.

@derrickstolee
Copy link
Contributor Author

Looks good. Did you try running the install script with sudo and see if it returned root? Just curious.

$ sudo whoami
root

$ sudo logname
stolee

I suppose that's a great reason for doing it the way we did.

Also, going through the hoops of installing tmux, I don't get the same behavior reported in #356. logname works just fine.

Maybe we should just close both here?

Resolves microsoft#336.

I am unable to reproduce the situation where 'logname' returns
root while 'whoami' does not, but at least we have a fallback
option. 'whoami' definitely returns root under 'sudo' so we
do not want to start there.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
@derrickstolee derrickstolee merged commit c5c1716 into microsoft:master Mar 25, 2020
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.

Can't install Scalar in a tmux window because /usr/bin/logname returns root
2 participants
0