Bugzilla – Attachment 34321 Details for
Bug 13431
Shared FastMmap file causes issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13431 - Shared FastMmap file causes issues
Bug-13431---Shared-FastMmap-file-causes-issues.patch (text/plain), 2.26 KB, created by
Jacek Ablewicz
on 2014-12-11 14:09:15 UTC
(
hide
)
Description:
Bug 13431 - Shared FastMmap file causes issues
Filename:
MIME Type:
Creator:
Jacek Ablewicz
Created:
2014-12-11 14:09:15 UTC
Size:
2.26 KB
patch
obsolete
>From a44374386158463c5413283645fd96625cd0d46a Mon Sep 17 00:00:00 2001 >From: Jacek Ablewicz <abl@biblos.pk.edu.pl> >Date: Thu, 11 Dec 2014 14:11:44 +0100 >Subject: [PATCH] Bug 13431 - Shared FastMmap file causes issues > >Koha::Cache package does not take into account that, when using >fastmmap caching variant, mmaped cache file created in /tmp >(typically: /tmp/sharefile-koha-koha), would only be >further accessible to the one given OS user - the one which >created it. >In many Koha setups, in the circumstances when various system scripts >are executed by 2+ users with diffrent UIDs (like multi-tenant servers, >for example) this may cause many kinds of issues. Observable symptom >is usually the appearance of the below error when searching, or looking >at MARC Framework pages and a few other places: > >Open of share file /tmp/sharefile-koha-koha failed: Permission denied >at /usr/lib/perl5/Cache/FastMmap.pm line 640. > >This patch adds the ID of the OS user to the mmaped file name created >in /tmp, to prevent such kinds of conflicts and/or permission problems >from happening. > >To test: > >1) remove the /tmp/sharefile-koha-* file[s] (if any) >2) do something which would lead to its re-creation >(e.g., performing any search in OPAC should be sufficient >to cause that) >3) observe that /tmp/sharefile-koha-koha got created >4) remove it >5) apply patch >6) redo step 2) >7) observe that file created in /tmp now does have >the OS user id included in it's name (e.g. it would be named >like that 'sharefile-koha-koha-www-data' - depending on the >particular test setup) >8) add some additional user to the /etc/passwd, with the same >UID www-data has, but with different name (e.g. 'www-data2'); redo >the tests; ensure that it still works fine in such unusual case >--- > Koha/Cache.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Cache.pm b/Koha/Cache.pm >index 1638324..a8efc31 100644 >--- a/Koha/Cache.pm >+++ b/Koha/Cache.pm >@@ -161,7 +161,7 @@ sub _initialize_fastmmap { > my ($self) = @_; > > $self->{'fastmmap_cache'} = Cache::FastMmap->new( >- 'share_file' => "/tmp/sharefile-koha-$self->{'namespace'}", >+ 'share_file' => "/tmp/sharefile-koha-".$self->{'namespace'}."-".getpwuid($>), > 'expire_time' => $self->{'timeout'}, > 'unlink_on_exit' => 0, > ); >-- >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 13431
:
34321
|
34323
|
34453
|
34826
|
35726
|
35727
|
35728
|
35823
|
35824