You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Ben Collins-Sussman <su...@collab.net> on 2001/07/26 22:42:55 UTC

proposal: apr_get_username()

I need to get the char *username of the person running the current
process.  I looked in apr_user.h, and see routines for converting
back-and-forth between apr_uid_t and char *username -- but no routines
for fetching either one!

If it's okay with people, I'd like to add apr_get_username().  I can
implement the Unix part by calling getuid().  But somebody else would
need to write the win32 equivalent.

Thoughts?

Re: proposal: apr_get_username()

Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: "Ben Collins-Sussman" <su...@collab.net>
Sent: Thursday, July 26, 2001 3:42 PM

> I need to get the char *username of the person running the current
> process.  I looked in apr_user.h, and see routines for converting
> back-and-forth between apr_uid_t and char *username -- but no routines
> for fetching either one!
> 
> If it's okay with people, I'd like to add apr_get_username().  I can
> implement the Unix part by calling getuid().  But somebody else would
> need to write the win32 equivalent.

Well... which exactly do you want, the security context (user, primary group)
of the executing thread, or the process context?  Be warned, the child thread
once impersonating 'nobody' might not be able to ask that about the process.

I have the this-thread implementation ready, if you were thinking in that 
direction.  If not, it's a two line change.

Bill


Re: proposal: apr_get_username()

Posted by Luke Kenneth Casson Leighton <lk...@samba-tng.org>.
On Thu, Jul 26, 2001 at 04:56:24PM -0400, Cliff Woolley wrote:

> > If it's okay with people, I'd like to add apr_get_username().  I can
> > implement the Unix part by calling getuid().  But somebody else would
> > need to write the win32 equivalent.
> >
> > Thoughts?
> 
> +1... Luke has asked for this as well.  

yesplease.

> I have no idea how it would work
> on Win32, but there's got to be some way or another to do it...

recommend taking a look at cygwin32's sourcecode, they have
to do it in there (i don't believe it's fake).

the only thing that's almost impossible is setuid()-Win32,
because there isn't one.

luke

Re: proposal: apr_get_username()

Posted by Cliff Woolley <cl...@yahoo.com>.
On 26 Jul 2001, Ben Collins-Sussman wrote:

> I need to get the char *username of the person running the current
> process.  I looked in apr_user.h, and see routines for converting
> back-and-forth between apr_uid_t and char *username -- but no routines
> for fetching either one!
>
> If it's okay with people, I'd like to add apr_get_username().  I can
> implement the Unix part by calling getuid().  But somebody else would
> need to write the win32 equivalent.
>
> Thoughts?

+1... Luke has asked for this as well.  I have no idea how it would work
on Win32, but there's got to be some way or another to do it...

--Cliff

--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA