[Rt-commit] rt branch, 4.0-trunk, updated. rt-4.0.11-63-gdc221d9

Thomas Sibley trs at bestpractical.com
Wed Apr 17 12:19:34 EDT 2013


The branch, 4.0-trunk has been updated
       via  dc221d91198594f515ab22937f3bb6b421d2faf0 (commit)
      from  d731ee1ee9696c7f42dfe5ce581eb776379fe477 (commit)

Summary of changes:
 lib/RT/Interface/Web/Session.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit dc221d91198594f515ab22937f3bb6b421d2faf0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Apr 16 21:54:16 2013 -0700

    Correct variable name to avoid confusion
    
    The tenth returned value (index 9) of stat() is the mtime, not the
    ctime, as documented in `perldoc -f stat`.  ctime is index 10, the
    eleventh returned value.
    
    Sessions stored in the database are cleared by their last updated time;
    mtime, not ctime, is the appropriate file-system analogue.  Targeting
    creation time also makes no sense, as it will logout still active
    sessions.

diff --git a/lib/RT/Interface/Web/Session.pm b/lib/RT/Interface/Web/Session.pm
index d13bd8b..4edd9bd 100644
--- a/lib/RT/Interface/Web/Session.pm
+++ b/lib/RT/Interface/Web/Session.pm
@@ -207,8 +207,8 @@ sub _ClearOldDir {
 
     foreach my $id( @{ $self->Ids } ) {
         if( int $older_than ) {
-            my $ctime = (stat(File::Spec->catfile($dir,$id)))[9];
-            if( $ctime > $now - $older_than ) {
+            my $mtime = (stat(File::Spec->catfile($dir,$id)))[9];
+            if( $mtime > $now - $older_than ) {
                 $RT::Logger->debug("skipped session '$id', isn't old");
                 next;
             }

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


More information about the Rt-commit mailing list