From 530a0ad790e206b976abbb7c5c14848629c161a4 Mon Sep 17 00:00:00 2001 From: Sheldon Hearn Date: Thu, 6 Dec 2001 15:55:28 +0000 Subject: Add patches that cause Apache::Session to give the administrator a clue as to WHICH file or directory is missing when it dies because it is unable to create, read or write a session file. Without these patches, setting up things like PageKit and other mod_perl-based software can be much more time-consuming than it needs to be. These patches will be submitted back to the author. --- .../files/patch-Session::Lock::File.pm | 24 ++++++++ .../files/patch-Session::Store::File.pm | 71 ++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 www/p5-Apache-Session/files/patch-Session::Lock::File.pm create mode 100644 www/p5-Apache-Session/files/patch-Session::Store::File.pm (limited to 'www/p5-Apache-Session/files') diff --git a/www/p5-Apache-Session/files/patch-Session::Lock::File.pm b/www/p5-Apache-Session/files/patch-Session::Lock::File.pm new file mode 100644 index 000000000000..aea3c01aad72 --- /dev/null +++ b/www/p5-Apache-Session/files/patch-Session::Lock::File.pm @@ -0,0 +1,24 @@ +--- Session/Lock/File.pm.orig Sat Sep 2 00:21:17 2000 ++++ Session/Lock/File.pm Thu Dec 6 17:37:40 2001 +@@ -36,8 +36,9 @@ + + my $LockDirectory = $session->{args}->{LockDirectory} || + $Apache::Session::Lock::File::LockDirectory; ++ my $LockFile = $LockDirectory."/Apache-Session-".$session->{data}->{_session_id}.".lock"; + +- open($fh, "+>".$LockDirectory."/Apache-Session-".$session->{data}->{_session_id}.".lock") || die $!; ++ open($fh, "+> $LockFile") || die "$LockFile: $!"; + + $self->{fh} = $fh; + $self->{opened} = 1; +@@ -58,8 +59,9 @@ + + my $LockDirectory = $session->{args}->{LockDirectory} || + $Apache::Session::Lock::File::LockDirectory; ++ my $LockFile = $LockDirectory."/Apache-Session-".$session->{data}->{_session_id}.".lock"; + +- open($fh, "+>".$LockDirectory."/Apache-Session-".$session->{data}->{_session_id}.".lock") || die $!; ++ open($fh, "+> $LockFile") || die "$LockFile: $!"; + + $self->{fh} = $fh; + $self->{opened} = 1; diff --git a/www/p5-Apache-Session/files/patch-Session::Store::File.pm b/www/p5-Apache-Session/files/patch-Session::Store::File.pm new file mode 100644 index 000000000000..27d0b3aa903d --- /dev/null +++ b/www/p5-Apache-Session/files/patch-Session::Store::File.pm @@ -0,0 +1,71 @@ +--- Session/Store/File.pm.orig Mon Jul 24 05:44:52 2000 ++++ Session/Store/File.pm Thu Dec 6 17:49:31 2001 +@@ -33,13 +33,14 @@ + my $session = shift; + + my $directory = $session->{args}->{Directory} || $Apache::Session::Store::File::Directory; ++ my $file = $directory.'/'.$session->{data}->{_session_id}; + +- if (-e $directory.'/'.$session->{data}->{_session_id}) { +- die "Object already exists in the data store"; ++ if (-e $file) { ++ die "Object already exists in the data store: $file"; + } + +- sysopen ($self->{fh}, $directory.'/'.$session->{data}->{_session_id}, O_RDWR|O_CREAT) || +- die "Could not open file: $!"; ++ sysopen ($self->{fh}, $file, O_RDWR|O_CREAT) || ++ die "Could not open $file: $!"; + + $self->{opened} = 1; + +@@ -51,10 +52,11 @@ + my $session = shift; + + my $directory = $session->{args}->{Directory} || $Apache::Session::Store::File::Directory; ++ my $file = $directory.'/'.$session->{data}->{_session_id}; + + if (!$self->{opened}) { +- sysopen ($self->{fh}, $directory.'/'.$session->{data}->{_session_id}, O_RDWR|O_CREAT) || +- die "Could not open file: $!"; ++ sysopen ($self->{fh}, $file, O_RDWR|O_CREAT) || ++ die "Could not open $file: $!"; + + $self->{opened} = 1; + } +@@ -69,11 +71,12 @@ + my $session = shift; + + my $directory = $session->{args}->{Directory} || $Apache::Session::Store::File::Directory; ++ my $file = $directory.'/'.$session->{data}->{_session_id}; + +- if (-e $directory.'/'.$session->{data}->{_session_id}) { ++ if (-e $file) { + if (!$self->{opened}) { +- sysopen ($self->{fh}, $directory.'/'.$session->{data}->{_session_id}, O_RDWR|O_CREAT) || +- die "Could not open file: $!"; ++ sysopen ($self->{fh}, $file, O_RDWR|O_CREAT) || ++ die "Could not open $file: $!"; + + $self->{opened} = 1; + } +@@ -96,15 +99,16 @@ + my $session = shift; + + my $directory = $session->{args}->{Directory} || $Apache::Session::Store::File::Directory; ++ my $file = $directory.'/'.$session->{data}->{_session_id}; + + if ($self->{opened}) { + CORE::close $self->{fh}; + $self->{opened} = 0; + } + +- if (-e $directory.'/'.$session->{data}->{_session_id}) { +- unlink ($directory.'/'.$session->{data}->{_session_id}) || +- die "Could not remove file: $!"; ++ if (-e $file) { ++ unlink ($file) || ++ die "Could not remove $file: $!"; + } + else { + die "Object does not exist in the data store"; -- cgit v1.2.3