Re: Rewrite REMOTE_USER environment variable

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

 



Rainer

Thanks, but unfortunately that didn't work. Does <http://httpd.apache.org/docs/trunk/env.html#fixheader> have any relevance here?

Changing the rule to:
RewriteCond %{REMOTE_USER} ^0*([1-9][0-9]+)
RewriteRule ^ -  [env=RU:%1]
didn't set the RU environment variable either, so it's perhaps more fundamental than not being allowed to rewrite REMOTE_USER.

Ken

On 23/05/2017 14:20, Rainer Canavan wrote:
On Tue, May 23, 2017 at 2:10 PM, Ken Mycock <ken.mycock@xxxxxxxxxxxx> wrote:
[...]

Hence, we need to allow authentication of either form of number but to strip
leading zeros from the number stored in REMOTE_USER.

I've tried various combinations of:
RewriteCond %{REMOTE_USER} ^0*([1-9][0-9]+)
RewriteRule ^0*([1-9]+)$ [E=RU:$1]
I haven't tested it, but I think

RewriteCond %{REMOTE_USER} ^0*([1-9][0-9]+)
RewriteRule ^ -  [env=REMOTE_USER:%1]

might work. The RewriteRule does nothing to the current location,
and sets REMOTE_USER from a backreference on the RewriteCond
matches.

rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




---------------------------------------------------------------------
To unsubscribe, e-mail: users-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