A frequently cut-and-pasted HTTP basic authentication configuration
for nginx sets it to the empty string when not authenticated, which
is not useful.
my $cgi=shift;
my $session=shift;
my $cgi=shift;
my $session=shift;
- if (defined $cgi->remote_user()) {
+ if (length $cgi->remote_user()) {
$session->param("name", $cgi->remote_user());
}
}
$session->param("name", $cgi->remote_user());
}
}
my $buttons=$params{buttons};
if ($form->title eq "signin" &&
my $buttons=$params{buttons};
if ($form->title eq "signin" &&
- ! defined $cgi->remote_user() && defined $config{cgiauthurl}) {
+ ! length $cgi->remote_user() && defined $config{cgiauthurl}) {
my $button_text="Login with HTTP auth";
push @$buttons, $button_text;
my $button_text="Login with HTTP auth";
push @$buttons, $button_text;
my $cgi=shift;
my $session=shift;
my $cgi=shift;
my $session=shift;
- if (! defined $cgi->remote_user() &&
+ if (! length $cgi->remote_user() &&
(! defined $session->param("name") ||
! IkiWiki::userinfo_get($session->param("name"), "regdate")) &&
defined $config{httpauth_pagespec} &&
(! defined $session->param("name") ||
! IkiWiki::userinfo_get($session->param("name"), "regdate")) &&
defined $config{httpauth_pagespec} &&
* t/git-cgi.t: Wait 1 second before doing a revert that should work.
This hopefully fixes a race condition in which the test failed
around 6% of the time. (Closes: 862494)
* t/git-cgi.t: Wait 1 second before doing a revert that should work.
This hopefully fixes a race condition in which the test failed
around 6% of the time. (Closes: 862494)
+ * Guard against set-but-empty REMOTE_USER CGI variable on
+ misconfigured nginx servers, and in general treat sessions with
+ a set-but-empty name as if they were not signed in.
-- Simon McVittie <smcv@debian.org> Sun, 14 May 2017 15:34:52 +0100
-- Simon McVittie <smcv@debian.org> Sun, 14 May 2017 15:34:52 +0100
> with one of a limited set of authorized usernames.
>
> --[[smcv]]
> with one of a limited set of authorized usernames.
>
> --[[smcv]]
+>
+>> If my theory is correct, ikiwiki git master now works around this, and the
+>> [[plugins/httpauth]] documentation now recommends a more correct configuration.
+>> --[[smcv]]