RE: MODIFIYING THE REMOTE_USER VARIABLE : additionnal hints

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: MODIFIYING THE REMOTE_USER VARIABLE : additionnal hints

Patrick CLAVIER
Hye,

What means %1 in your syntax ? ( I have no syntax error but I don 't know
what happens ...

To be more precise, I would like to put the value of the LDAP_USER_ALT
variable into the REMOTE_USER variable

Is there a solution to exchange the contents of variables ?


-----Original Message-----
From: Bud P. Bruegger [mailto:[hidden email]]
Sent: Friday, April 22, 2005 5:07 PM
To: [hidden email]
Subject: Re: [users@httpd] MODIFIYING THE REMOTE_USER VARIABLE


At 16.47 22/04/2005 +0200, you wrote:
>Hye,
>
>With Apache HTTP Server ver 2.0.40 and LDAP autentication, is it
>possible
>to OVERWRITE the REMOTE_USER Variable ? With the mod_rewrite module ?
>
>If Yes, What is the syntax according to the RewriteRule Directive , the
>{LA-U:REMOTE_USER} and E=VAR:VAL flag ?

Brian just proposed this:

RewriteEngine On
RewriteCond %{HTTP:HTTP_SOME_HEADER_FIELD} (.*)
RewriteRule .* - [E=REMOTE_USER:%1]

and it works for me on Apache 1.3.  So I assume that also 2.0 will work.

cheers
-b




>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP Server
>Project. See <URL:http://httpd.apache.org/userslist.html> for more
>info. To unsubscribe, e-mail: [hidden email]
>    "   from the digest: [hidden email]
>For additional commands, e-mail: [hidden email]


----------------------------------------------------------------------------
---------------------
Ing. Bud P. Bruegger, Ph.D.                 +39-0564-488577
(voice),  -21139 (fax)
Servizio Elaborazione Dati                    e-mail:
[hidden email]
Comune di
Grosseto                            http://www.comune.grosseto.it/cie/
Via Ginori,
43                                      http://OpenPortalGuard.sf.net
58100 Grosseto (Tuscany, Italy)           jabber:  [hidden email]

Free Software in Public Administration:  not just a good idea, but a
necessity

Perfection is attained, not when there is nothing more to be added, but
when there is nothing more to be taken away -- Antoine de Saint-Exupery


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info. To
unsubscribe, e-mail: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: MODIFIYING THE REMOTE_USER VARIABLE : additionnal hints

Brian Hughes

OK... since it's my syntax, I'm happy to answer this particular
question. In the RewriteCond statement, the last part is (.*), what
that does is match on any value in the named HTTP header field
(different than an environment variable set by Apache) and stores that
value in a regular expression back-reference. That back-reference is
used in the RewriteRule statement to set the value of the custom
environment variable.

RewriteCond back-references are stored in %1-%9, while RewriteRule
back-references are stored in $1-$9.

Now, that's pretty much the only part of your message I can really
answer. As has been stated by others, setting the REMOTE_USER value in
this manner should not work...

-Brian

On Apr 25, 2005, at 03:41 AM, Patrick CLAVIER wrote:

> What means %1 in your syntax ? ( I have no syntax error but I don 't
> know
> what happens ...
>
> To be more precise, I would like to put the value of the LDAP_USER_ALT
> variable into the REMOTE_USER variable
>
> Is there a solution to exchange the contents of variables ?
>
>
> -----Original Message-----
> From: Bud P. Bruegger [mailto:[hidden email]]
> Sent: Friday, April 22, 2005 5:07 PM
> To: [hidden email]
> Subject: Re: [users@httpd] MODIFIYING THE REMOTE_USER VARIABLE
>
> RewriteEngine On
> RewriteCond %{HTTP:HTTP_SOME_HEADER_FIELD} (.*)
> RewriteRule .* - [E=REMOTE_USER:%1]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: MODIFIYING THE REMOTE_USER VARIABLE : additionnal hints

Patrick CLAVIER
Thanks for these explanations

-----Original Message-----
From: Brian Hughes '89 [mailto:[hidden email]]
Sent: Monday, April 25, 2005 3:36 PM
To: [hidden email]
Subject: Re: [users@httpd] MODIFIYING THE REMOTE_USER VARIABLE : additionnal
hints



OK... since it's my syntax, I'm happy to answer this particular
question. In the RewriteCond statement, the last part is (.*), what
that does is match on any value in the named HTTP header field
(different than an environment variable set by Apache) and stores that
value in a regular expression back-reference. That back-reference is
used in the RewriteRule statement to set the value of the custom
environment variable.

RewriteCond back-references are stored in %1-%9, while RewriteRule
back-references are stored in $1-$9.

Now, that's pretty much the only part of your message I can really
answer. As has been stated by others, setting the REMOTE_USER value in
this manner should not work...

-Brian

On Apr 25, 2005, at 03:41 AM, Patrick CLAVIER wrote:

> What means %1 in your syntax ? ( I have no syntax error but I don 't
> know
> what happens ...
>
> To be more precise, I would like to put the value of the LDAP_USER_ALT
> variable into the REMOTE_USER variable
>
> Is there a solution to exchange the contents of variables ?
>
>
> -----Original Message-----
> From: Bud P. Bruegger [mailto:[hidden email]]
> Sent: Friday, April 22, 2005 5:07 PM
> To: [hidden email]
> Subject: Re: [users@httpd] MODIFIYING THE REMOTE_USER VARIABLE
>
> RewriteEngine On
> RewriteCond %{HTTP:HTTP_SOME_HEADER_FIELD} (.*)
> RewriteRule .* - [E=REMOTE_USER:%1]


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info. To
unsubscribe, e-mail: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [hidden email]
   "   from the digest: [hidden email]
For additional commands, e-mail: [hidden email]