[Rt-commit] rt branch, 4.2/fix-chmod-in-install-page, created. rt-4.0.4-302-gb6abef0

? sunnavy sunnavy at bestpractical.com
Mon Jan 16 12:27:30 EST 2012


The branch, 4.2/fix-chmod-in-install-page has been created
        at  b6abef01a8dcd19f3699d6b0dbbcdb8800973f1a (commit)

- Log -----------------------------------------------------------------
commit b6abef01a8dcd19f3699d6b0dbbcdb8800973f1a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Jan 16 21:43:28 2012 +0800

    use "chmod 440" as "chmod -w" is affected by umask.
    
    umask(0077) in RT::Interface::Web::Handler::InitSessionDir makes
    group's writable bit still on after calling "chmod -w", which fails
    t/web/install.t
    
    besides, perl has chmod itself, no need to use heavy system call

diff --git a/share/html/Install/Finish.html b/share/html/Install/Finish.html
index e567b3f..5830cdd 100644
--- a/share/html/Install/Finish.html
+++ b/share/html/Install/Finish.html
@@ -79,9 +79,11 @@ if ( $Run ) {
     RT->InitClasses();
     RT->InitPlugins();
 
-    system( 'chmod -w ' . RT::Installer->ConfigFile ) &&
+    my $ret = chmod 0440, RT::Installer->ConfigFile;
+    if ( !$ret ) {
         $RT::Logger->error(
                 'failed to make ' . RT::Installer->ConfigFile . ' readonly' );
+    }
     my $root = RT::User->new( RT->SystemUser );
     $root->Load('root');
     my ($ok, $val) = $root->SetPassword( $RT::Installer->{InstallConfig}{Password} );

-----------------------------------------------------------------------


More information about the Rt-commit mailing list