diff options
-rw-r--r-- | IkiWiki/CGI.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/CGI.pm b/IkiWiki/CGI.pm index 99cead64f..52d3474f5 100644 --- a/IkiWiki/CGI.pm +++ b/IkiWiki/CGI.pm @@ -645,8 +645,14 @@ sub cgi_getsession ($) { #{{{ CGI::Session->name("ikiwiki_session_".encode_utf8($config{wikiname})); my $oldmask=umask(077); - my $session = CGI::Session->new("driver:DB_File", $q, - { FileName => "$config{wikistatedir}/sessions.db" }); + my $session = eval { + CGI::Session->new("driver:DB_File", $q, + { FileName => "$config{wikistatedir}/sessions.db" }) + }; + if (! $session || $@) { + error($@." ".CGI::Session->errstr()); + } + umask($oldmask); return $session; |