Post Reply 
Installing MinimServer on Linux using su
02-10-2021, 09:38
Post: #4
RE: Installing MinimServer on Linux using su
Having thought about it, you're probably falling back on logname because you're trying to get the UID from within a SUDO call.
I tried to do something like this a while ago and I couldn't find a way to expose the Real UID from the shell as opposed to the Effective UID either, which was maddening.
I fell back on using $SUDO_USER, which should be ok if you're controlling how it's being called (doing the sudo call yourself), but it doesn't work in all scenarios ("sudo su - <another user>" from memory).

Again, no idea how this works across distributions, but it can't hurt if it's just an additional check before logname.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Installing MinimServer on Linux using su - simbun - 02-10-2021 09:38

Forum Jump:


User(s) browsing this thread: 1 Guest(s)