acl extension user name retrieving issue

LAO Zhongcheng laozc at bhh.com.cn
Thu May 21 00:01:24 CDT 2009


Hi,

I found that the acl extension didn't work well in a CGI environment.
It always causes an authorization error in my environment.

I traced the error and found out that
the getuser() method which acl extension uses throws an exception
in this situation.
I have only a little experience in Python.
I've modified the source and changed that to use
the environment variable REMOTE_USER instead of getuser() in CGI mode
to make it work. (Have a glance at the attached diff please.)

But another issue comes out.
It doesn't seem to work in a WSGI application.
The REMOTE_USER variable was empty when acl extension was called.
I checked for some material online and it seems that
information about the request stores in an environ
variable and it will be passed to the WSGI application.
The REMOTE_USER should be retrieved from this environ variable.
I didn't find a place that Mercurial passes it to the extension.

So is there any way to make it work properly.
And is this an issue needs to be filed?

Johnson Lau


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: acl.diff
Url: http://selenic.com/pipermail/mercurial/attachments/20090521/07fa7ea8/attachment.txt 


More information about the Mercurial mailing list