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?
-- 
#ken    P-)}

Ken Coar                    <http://Golux.Com/coar/>
Apache Software Foundation  <http://www.apache.org/>
"Apache Server for Dummies" <http://Apache-Server.Com/>
"Apache Server Unleashed"   <http://ApacheUnleashed.Com/>

Reply via email to