Skip to content

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