Name not getting set properly?

starkos - March 13, 2008 - 17:08
Project:Webserver authentication
Version:5.x-0.0-rc1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

First attempt with rc1 and didn't seem to think anyone is logged in; problem seems to be at line 21:

if ($name != $_SERVER["REMOTE_USER"]) {
$name = $_SERVER["REDIRECT_REMOTE_USER"];
}

Here, $name hasn't been set yet. If I add:

$name = $_SERVER['REMOTE_ADDR'];

before this block then it starts to work.

#1

smsearcy - March 25, 2008 - 17:49
Status:active» patch (code needs review)

The code in question is testing inequality instead of testing the result of the assignment to $name (which is what I think was intended). I've attached a patch (this is my first patch, please let me know if I should do something differently).

edit: I encountered this issue with Drupal 5.7 on IIS6 (Windows 2003) with PHP 5.

AttachmentSize
webserver_auth-233852-1.patch377 bytes

#2

tmclaugh - March 28, 2008 - 17:38

I've encountered this issue on a CentOS 4 box with apache 2.0.52 and PHP 4.3.9 and an OpenBSD box with apache 1.3.29 and PHP 5.2.3 with both using mod_auth_kerb to control access to drupal. I noticed when webserver_auth_init() was entered that $name was empty so it always failed the conditional but REDIRECT_REMOTE_USER is not set. I'm not sure how that gets setup by apache though. I ended up using this change instead so it uses REDIRECT_USER if it is set:

http://drupal.org/node/14294#comment-784044

#3

rgeorgy - April 2, 2008 - 14:16

subscribe

#4

moshe weitzman - April 21, 2008 - 16:44
Status:patch (code needs review)» fixed

this was just fixed in a more verbose way in another issue.

#5

Anonymous (not verified) - May 5, 2008 - 16:52
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.