Bugzilla – Attachment 37095 Details for
Bug 13876
Permission issues on updating via installer - dev installations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 13876: [QA Follow-up] Resolve updatedatabase logfile issues
SIGNED-OFF-Bug-13876-QA-Follow-up-Resolve-updateda.patch (text/plain), 2.28 KB, created by
Katrin Fischer
on 2015-03-22 20:29:45 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 13876: [QA Follow-up] Resolve updatedatabase logfile issues
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2015-03-22 20:29:45 UTC
Size:
2.28 KB
patch
obsolete
>From 9e44a11898f11218fdbf0ce60ceca8711c4e1fca Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 20 Mar 2015 16:13:51 +0100 >Subject: [PATCH] [SIGNED OFF] Bug 13876: [QA Follow-up] Resolve updatedatabase > logfile issues > >This patch removes the test on write permissions of the logdir. >It uses File::Temp to generate a file in the logdir or otherwise in >a system tmp dir. >This resolves issues with both write permissions as well as SELinux >denials. >Note that after generating an empty file, we are appending to it in >the system statement. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > installer/install.pl | 21 ++++++++++++++++----- > 1 file changed, 16 insertions(+), 5 deletions(-) > >diff --git a/installer/install.pl b/installer/install.pl >index 63094ab..6c297e0 100755 >--- a/installer/install.pl >+++ b/installer/install.pl >@@ -323,12 +323,9 @@ elsif ( $step && $step == 3 ) { > > my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); > my $logdir = C4::Context->config('logdir'); >- unless ( -w $logdir ) { >- $logdir = tempdir; >- } >- my ( $logfilepath, $logfilepath_errors ) = ( $logdir . "/updatedatabase_$now.log", $logdir . "/updatedatabase-error_$now.log" ); >+ my ( $logfilepath, $logfilepath_errors ) = ( chk_log($logdir, "updatedatabase_$now"), chk_log($logdir, "updatedatabase-error_$now") ); > >- my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl > $logfilepath 2> $logfilepath_errors"; >+ my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl >> $logfilepath 2>> $logfilepath_errors"; > > system($cmd ); > >@@ -423,3 +420,17 @@ else { > } > } > output_html_with_http_headers $query, $cookie, $template->output; >+ >+sub chk_log { #returns a logfile in $dir or - if that failed - in temp dir >+ my ($dir, $name) = @_; >+ $name.= '_XXXX'; >+ my ($fh, $fn)= eval { >+ File::Temp::tempfile($name, DIR => $dir, SUFFIX => '.log' ) >+ }; >+ if(!$fn) { >+ ($fh, $fn)= File::Temp::tempfile( $name, TMPDIR => 1, SUFFIX => '.log'); >+ #if this should not work, let croak take over >+ } >+ close $fh if $fh; >+ return $fn; >+} >-- >1.9.1
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 13876
:
37014
|
37022
|
37052
|
37053
|
37094
|
37095
|
37906
|
37965
|
37966
|
37999
|
38000
|
38001
|
38002
|
38004
|
38021
|
38022
|
38023