[Cvsnt] Getting username

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


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


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 cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
> > 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 https://www.march-hare.com/cvspro/en.asp#downcvs
> >
>
> _______________________________________________
> Cvsnt mailing list
> Cvsnt at cvsnt.org
> http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs


_______________________________________________
Cvsnt mailing list
Cvsnt at cvsnt.org
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs



More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook