On Wednesday, April 12, 2000 5:24 AM, Rodent of Unusual Size 
[SMTP:[EMAIL PROTECTED]] wrote:
> Rodent of Unusual Size wrote:
> >
> > As I understand it, the USER variable is set to the username of
> > the server-local user actually accessing the repository.  In the
> > case of a pserver-accessed repository, with usernames mapped
> > through the CVSROOT/passwd file mechanism, this will typically
> > be the value of the third field in the matching entry in the
> > CVSROOT/passwd file.
> >
> > So.. is there any way to get the *remote* username?  The one that
> > was mapped to the local one?  The one that matches the *first* field
> > in that entry?
>
> A little experimentation reveals something (I find) confusing.
> CVSROOT/loginfo contains a line like this:
>
>       DEFAULT $CVSROOT/CVSROOT/foo $USER %s
>
> The Perl CVSROOT/foo script, however, shows different values for
> $ARGV[0] (the $USER above) and $ENV{"USER"} (the actual environment).
> The former is the remote (client) username I want, whilst the
> latter is the local (server) username.
>
> It looks as though whatever does the expansion of $USER is using
> an internal table, not the environment, since the admin-file
> expansion of $USER differs from the value in the environment table.
>
> I haven't yet gone to the sources to track this down; it's with CVS
> 1.10.2.  Can anyone else confirm/deny the behaviour I'm seeing?
> Am I nuts, or missing something obvious?  Or is there really an
> overloading of the variable named USER?

There is indeed overloading of the USER variable.  From memory this is 
documented in Cederqvist, but I can't remember where.  This caught me for a 
while as well (I went as far as creating a patch to fix this behaviour)!

***************************************************************
Chris Cameron                    Open Telecommunications NZ Ltd
Software Development Team Leader
[EMAIL PROTECTED]                           P.O.Box 10-388
      +64 4 495 8403 (DDI)                          The Terrace
fax:  +64 4 495 8419                                 Wellington
cell: +64 21 650 680                                New Zealand
Life, don't talk to me about life ....(Marvin - HHGTTG)


Reply via email to