aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin/passwordauth.pm
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2017-08-23 13:13:23 -0400
committerJoey Hess <joeyh@joeyh.name>2017-08-23 13:13:23 -0400
commite3dfb26b904edb4645fee4b43e93a6d54e2e8041 (patch)
treec350e1fd5bd8739f92d865e1ab56ab9d72b016c7 /IkiWiki/Plugin/passwordauth.pm
parent056349a7f0cf3dd470cdd9633b7fe955fb03268f (diff)
downloadikiwiki-e3dfb26b904edb4645fee4b43e93a6d54e2e8041.tar
ikiwiki-e3dfb26b904edb4645fee4b43e93a6d54e2e8041.tar.gz
emailauth, passwordauth: Avoid leaving cgisess_* files in the system temp directory.
Due to the use/abuse of CGI::Session to generate a token for the login process, a new session database was created for each login, and left behind afterwards. While each file is small, with many logings this could bloat the size of /tmp significantly. Fixed by making CGI::Session write to /dev/null, since there does not seem to be a way to entirely prevent the writing. This commit was sponsored by Henrik Riomar on Patreon.
Diffstat (limited to 'IkiWiki/Plugin/passwordauth.pm')
-rw-r--r--IkiWiki/Plugin/passwordauth.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/IkiWiki/Plugin/passwordauth.pm b/IkiWiki/Plugin/passwordauth.pm
index 33b8efbed..8d99cf2f6 100644
--- a/IkiWiki/Plugin/passwordauth.pm
+++ b/IkiWiki/Plugin/passwordauth.pm
@@ -113,7 +113,7 @@ sub gentoken ($$;$) {
eval q{use CGI::Session};
error($@) if $@;
- my $token = CGI::Session->new->id;
+ my $token = CGI::Session->new("driver:DB_File", undef, {FileName => "/dev/null"})->id;
if (! $reversable) {
setpassword($user, $token, $tokenfield);
}