Re: get current user name?



Alan Balmer <albalmer@xxxxxxx> writes:
> On Fri, 19 Aug 2005 06:33:21 GMT, rlb@xxxxxxxxxxxxxxxxxxxxxx (Richard
> Bos) wrote:
>
>>djbitchpimp@xxxxxxxxxxxxx wrote:
>>
>>> How do I retrieve the username of the currently logged in user? I
>>> basically to check if the user is logged in as root and if not, exit
>>> the program.
>>
>>You call GetUserName, which is declared in <winbase.h>...
>
> Odd - I can't seem to find either the function or the include file
> mentioned in the C standard, or even the POSIX standard. Are you sure
> you're in the right newsgroup?

Yes, he's sure he's in the right newsgroup; that's the point he was
trying to make. See the "oops" below.

>>> I though about using the LOGNAME environment variable, but if a regular
>>> user used su root,
>>
>>...oops.

--
Keith Thompson (The_Other_Keith) kst-u@xxxxxxx <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.
.



Relevant Pages

  • Re: get current user name?
    ... >> How do I retrieve the username of the currently logged in user? ... >> basically to check if the user is logged in as root and if not, ... or even the POSIX standard. ... Balmer Consulting ...
    (comp.lang.c)
  • Re: cant open word
    ... Where exactly in the root of drive c do I place ... >Use Windows Search to locate it. ... >Please post all follow-up questions to the newsgroup. ... >>disks would have those files on them. ...
    (microsoft.public.word.application.errors)
  • Re: 0x20: 0000208D: NameErr: DSID-031001CD, problem 2001
    ... Repost this issue that you are experiencing to the windows.server.security newsgroup ... The root domain named ROOTdomain.com, ... I installing issued CA in second domain named mydomain not in root of the forest. ...
    (microsoft.public.security)
  • Re: enterprise vs stand-alone CA
    ... I think that this below is the newsgroup that you were wanting to post to. ... I'm not sure if it makes better sense to set up Enterprise Root CAs or Stand-alone root CAs. ... That is, i can't tell them to authenticate with the domain, they have to authenticate with and communicate over SSL with a specific DC. ...
    (microsoft.public.security)
  • Re: Two old figure questions
    ... You don't remember what happened then, or the root cause (which has ... Please do not tell me how long I have been on this newsgroup. ... Maybe my posting frequency labels me more of a lurker ... I'm not saying how long you've been here. ...
    (rec.games.miniatures.warhammer)