[Cvsnt] Getting username

Russell Brasser radix at otsoftware.com
Tue Feb 12 03:34:38 GMT 2002


Gary,
    I am currently using :

$login = getlogin() || "unknown" ;

since getpwuid is not implemented for windows and $ENV{'USERNAME'} is empty
when te script is called from a pserver connection. What surprised me was
that even though CVSNT is set to "impersonate" the user it has
authenticated, it seems to still be the SYSTEM user.

"Gary L Peskin" <garyp at firstech.com> wrote in message
news:00b701c1b365$5e440770$116da8c0 at GARY004...
> I use this:
>
> $login = $ENV{'USER'} || getlogin || (getpwuid($<))[0] ||
> sprintf("uid#%d",$<);
>
> I don't really know perl but it seems to work.
>
> HTH,
> Gary
>
> > -----Original Message-----
> > From: cvsnt-admin at cvsnt.org [mailto:cvsnt-admin at cvsnt.org] On
> > Behalf Of Russell Brasser
> > Sent: Monday, February 11, 2002 3:24 PM
> > To: cvsnt at cvsnt.org
> > Subject: [Cvsnt] Getting username
> >
> >
> > Hello,
> >
> >     I am running a perl script to log checkins and send
> > notifications. In thi script I am using a standard way of
> > getting the username so that the logs/e-mails can reflect who
> > checked what in.
> >
> > When checking in locally, everything works fine. However,
> > when I check in using the pserver (even if it is in
> > "impersonation" mode) the username always says SYSTEM.
> >
> > Any suggestions?
> >
> > Thanks
> > -Russ
> >
> >
> > _______________________________________________
> > Cvsnt mailing list
> > Cvsnt at cvsnt.org http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt
> >
>
> _______________________________________________
> Cvsnt mailing list
> Cvsnt at cvsnt.org
> http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt


_______________________________________________
Cvsnt mailing list
Cvsnt at cvsnt.org
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt



More information about the cvsnt mailing list