question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`sudo logname` returning `root` instead of my user

See original GitHub issue
  • I am on the latest Hyper.app version
  • I have searched the issues of this repo and believe that this is not a duplicate
  • OS version and name: macOS Catalina
  • Hyper.app version: 3.0.2
  • Link of a Gist with the contents of your .hyper.js: default one, not relevant
  • Relevant information from devtools N/A
  • The issue is reproducible in vanilla Hyper.app: Is Vanilla

Issue

If I run sudo logname on Hyper, I get root, but if I run it on any other terminal app (included the macOS default one), I get my username (which is what I’d expect).

Above, Hyper, below, Terminal:

image

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
Stanzillacommented, Oct 10, 2019

I don’t have a mac, so that’s a nope from me, sorry.

0reactions
bramuscommented, Nov 29, 2020

I’ve filed an issue over at Electron, and the reply there was as follows:

This is not an electron issues, this is fundamentally how Cocoa apps works, you can check by making a simple swift app that just exec’s logname and comparing. Whether it’s a bug in Cocoa / macOS is up to your interpretation, but it’s definitely not an Electron specific issue 😄

Oh, Apple … 😭

Read more comments on GitHub >

github_iconTop Results From Across the Web

username is appearing as root instead of a user who logged in?
Ah, this is simple. Your jenkins user is defined in /etc/passwd like this: jenkins:x:996:993:Jenkins Automation ...
Read more >
Why does "sudo -u root echo `whoami`" not return root?
sudo echo `whoami`. Returns your name because whoami changes to your username before sudo runs. It's like: sudo echo myname. you can see...
Read more >
How Can I Log In As root User? - nixCraft
Explains how to log in as a root user ( super user) under UNIX / Linux / BSD / macOS operating systems from...
Read more >
How to come out of root user? - Ask Ubuntu
From what I gather you're simply trying to return to your user account after gaining access to root. Try typing exit. in terminal....
Read more >
How do you find the original user through multiple sudo and ...
Results: Use who am i | awk '{print $1}' OR logname as no other methods are guaranteed. Logged in as self: evan> echo...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found