Erlang Mailing Lists

Author Message

<  Yaws mailing list  ~  Problems with HTTP Authentication

Guest
Posted: Thu Feb 11, 2010 9:40 pm Reply with quote
Guest
Hi all,

I'm trying to use http authentication for a simple website. The configuration looks like the following:

<server localhost>
      port = 7777
      listen = 0.0.0.0
      allowed_scripts = cgi
      docroot = /var/www
      <auth>
              dir = /
              realm = foobar
      </auth>
</server>

The directory /var/www contains a file .yaws_auth which has entries like the following:

{"testuser", "mypw"}.

When I access the site the http authentication window is shown. I enter the user/password and submit, then the window will be shown again and again. I've checked all logs without finding any useful information. Running Yaws in debug mode didn't help either.

The Yaws version I'm running is 1.87

Any idea what I'm doing wrong?

Cheers,
Tino
Post received from mailinglist
Guest
Posted: Thu Feb 11, 2010 10:52 pm Reply with quote
Guest
Tino Breddin wrote:
> Hi all,
>
> I'm trying to use http authentication for a simple website. The
> configuration looks like the following:
>
> <server localhost>
> port = 7777
> listen = 0.0.0.0
> allowed_scripts = cgi
> docroot = /var/www
> <auth>
> dir = /
> realm = foobar
> </auth>
> </server>
>
> The directory /var/www contains a file .yaws_auth which has entries like
> the following:
>
> {"testuser", "mypw"}.



Had a look at this - I feel that auth is the part of yaws that
the least documented and also cared for.
Anyway, and I'm not sure when, but .yaws_auth authentication
seems to have become broken.

diff --git a/src/yaws_config.erl b/src/yaws_config.erl
index ea492ef..df06c85 100644
--- a/src/yaws_config.erl
+++ b/src/yaws_config.erl
@@ -117,8 +117,10 @@ load_yaws_auth_from_docroot(Docroot) ->
SP = string:sub_string(Path, length(Docroot)+1),
Dir = filename:dirname(SP),
case load_yaws_auth_file(Path, #auth{dir = [Dir]}) of
- {ok, Auth} -> [Auth| Acc];
- _ -> Acc
+ Auth when is_record(Auth, auth) ->
+ [Auth| Acc];
+ _Other ->
+ Acc
end
end,
filelib:fold_files(Docroot, "^.yaws_auth$", true, Fun, []).


Is the fix,

I've checked this in, and since it's a really boring bug, I guess
it's time for a little intermediary release.

Thanks for reporting

/klacke




------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum