Re: Access to CVSROOT/passwd mapped username
Rodent of Unusual Size writes: 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. Variable expansion in administrative files like loginfo is completely separate from the environment. See "Expansions in administrative files" in the Cederqvist manual for more details. -Larry Jones I won't eat any cereal that doesn't turn the milk purple. -- Calvin
Re: Access to CVSROOT/passwd mapped username
Larry Jones wrote: Variable expansion in administrative files like loginfo is completely separate from the environment. So I discovered. The overloading of expansion syntax and names is hardly optimal when the meanings aren't identical, though, IMHO. (That is, having $USER expand to one thing in the admin files, and mean something else in the environment, is Not Good.) See "Expansions in administrative files" in the Cederqvist manual for more details. Um, no -- the manual is WRONG in this case. It says that USER is expanded to the username running the server. Wrong-o -- that's the meaning in the environment. In the admin expansion, USER is the username of the *client* (at least in a pserver/passwd situation). http://www.loria.fr/~molli/cvs/doc/cvs_18.html#SEC172. I would like to propose the addition of a couple of non-ambiguous symbols, such as CLIENT_USER and SERVER_USER, with identical meanings in the admin files and the environment. The current overloading of USER need not be touched. -- #kenP-)} Ken Coarhttp://Golux.Com/coar/ Apache Software Foundation http://www.apache.org/ "Apache Server for Dummies" http://Apache-Server.Com/ "Apache Server Unleashed" http://ApacheUnleashed.Com/
Re: Access to CVSROOT/passwd mapped username
Rodent of Unusual Size writes: 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. You misunderstand. The CVS internal variable "USER" is set to the name of the remote user, not the user the CVS server is running as. (The "USER" environment variable, however, *is* set to the local username the server is running as, just as though an "su" had been done.) See "Expansions in administrative files" in the Cederqvist manual for more information on internal variables. -Larry Jones Just when I thought this junk was beginning to make sense. -- Calvin
Re: Access to CVSROOT/passwd mapped username
Rodent of Unusual Size writes: Um, no -- the manual is WRONG in this case. It says that USER is expanded to the username running the server. Wrong-o -- that's the meaning in the environment. In the admin expansion, USER is the username of the *client* (at least in a pserver/passwd situation). The manual isn't wrong, it's just easily misread. The problem is that there are at least *three* easily identifiable usernames involved when running pserver, some or all of which are likely to be the same and thus people don't think about them. They are: 1) The username on the client machine. 2) The username used to login to the server (i.e., the "user" part of CVSROOT -- :pserver:[EMAIL PROTECTED]:/root). 3) The username the server is running as. The manual is trying to emphasize that it's not 1, but neglects to differentiate between 2 (the user running the server) and 3 (the user the server is running as). I've revised it to say: USERUsername of the user running CVS (on the CVS server machine). When using pserver, this is the user specified in the repository specification which need not be the same as the username the server is running as (see Section 2.9.3.1 [Password authentication server], page 21). Better? -Larry Jones Shut up and go get me some antiseptic. -- Calvin
Re: Access to CVSROOT/passwd mapped username
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? -- #kenP-)} Ken Coarhttp://Golux.Com/coar/ Apache Software Foundation http://www.apache.org/ "Apache Server for Dummies" http://Apache-Server.Com/ "Apache Server Unleashed" http://ApacheUnleashed.Com/
Re: Access to CVSROOT/passwd mapped username
Rodent of Unusual Size wrote: 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. You are correct. Internal variables are described in the Cederqvist. Cheers, Laird