Re: [users@httpd] Modifying environment variables passed to CGI's.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for your help.  It pointed me in the right direction, though it still doesn't quite work.  Here are the entries I made in my httpd.conf:

RewriteLog /opt/asn/logs/rewrite.log
RewriteLogLevel 5
RewriteCond %{LA-U:REMOTE_USER} ^(.*)@ COMPANY.COM$
RewriteRule /.* - [E=REMOTE_USER:%1]


My intent is to modify the REMOTE_USER variable to drop the Kerberos Realm name.  This seems to work correctly from the apache log entry:

10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [server1.company.com/sid#81ec8][rid#16c660/initial] (5) lookahead: path=/oasis/preproduction/htdocs/gifs/oasis- home.gif var=REMOTE_USER -> val=gdwfkd@xxxxxxxxxxx
10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [ server1.company.com/sid#81ec8][rid#16c660/initial] (4) RewriteCond: input='gdwfkd@xxxxxxxxxxx' pattern='^(.*)@COMPANY.COM$' => matched
10.1.12.70 - - [04/Oct/2006:13:48:45 --0700] [server1.company.com/sid#81ec8][rid#16c660/initial] (5) setting env variable 'REMOTE_USER' to 'gdwfkd'

but the variable that gets passed to the CGI script still has the realm name append to it.

Any help would be appreciated.



On 10/3/06, Rob Wilkerson < r.d.wilkerson@xxxxxxxxx> wrote:

On Oct 3, 2006, at 7:08 PM, Jason Lingel wrote:

> Is there a way to modify an environment variable that gets passed
> to a CGI?  For example, I'm doing Kerberos authentication and the
> realm gets appended to the REMOTE_USER variable, e.g., REMOTE_USER=
> username@xxxxxxxxxxxxx.  I just want username and not the realm.  I
> would prefer not to do this in the CGI because the CGIs are already
> written (legacy in house application).
>
> TIA.
>
I just did this using mod_rewrite by setting the E flag.

RewriteRule /.* - [E=varname:value]

In my case, I needed to pass the request uri to ColdFusion (which
doesn't appear to pass it along as it should).  I did so using this
capability (I was already using mod_rewrite).

RewriteRule /.* /my/redirect.cfm [E=MY_REQUEST_URI:%{REQUEST_URI},PT]

Worked like a charm.

Hope this helps.

---------------------------------------------------------------------
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: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux