Bugzilla – Attachment 46573 Details for
Bug 15553
cgisess_ files polluting the /tmp directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15553: [QA Follow-up] Replace hardcoded tmp and add instance to dirname
Bug-15553-QA-Follow-up-Replace-hardcoded-tmp-and-a.patch (text/plain), 1.54 KB, created by
Marcel de Rooy
on 2016-01-13 10:33:13 UTC
(
hide
)
Description:
Bug 15553: [QA Follow-up] Replace hardcoded tmp and add instance to dirname
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2016-01-13 10:33:13 UTC
Size:
1.54 KB
patch
obsolete
>From 14fdd1306762b856df681c1fb5f8d280db0b086a Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 13 Jan 2016 11:16:02 +0100 >Subject: [PATCH] Bug 15553: [QA Follow-up] Replace hardcoded tmp and add > instance to dirname >Content-Type: text/plain; charset=utf-8 > >If you use multiple instances on one server, you could have the situation >that instance A creates the cgisess subfolder and instance B could have a >permission problem. This patch resolves that by allowing each instance to >have its own cgisess subfolder. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index fd99ca0..e3e4cde 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -20,6 +20,7 @@ package C4::Auth; > use strict; > use warnings; > use Digest::MD5 qw(md5_base64); >+use File::Spec; > use JSON qw/encode_json/; > use URI::Escape; > use CGI::Session; >@@ -1710,7 +1711,9 @@ sub get_session { > } > else { > # catch all defaults to tmp should work on all systems >- $session = new CGI::Session( "driver:File;serializer:yaml;id:md5", $sessionID, { Directory => '/tmp/cgisess' } ); >+ my $dir = File::Spec->tmpdir; >+ my $instance = C4::Context->config( 'database' ); #actually for packages not exactly the instance name, but generally safer to leave it as it is >+ $session = new CGI::Session( "driver:File;serializer:yaml;id:md5", $sessionID, { Directory => "$dir/cgisess_$instance" } ); > } > return $session; > } >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15553
:
46503
|
46559
|
46572
| 46573