summaryrefslogtreecommitdiff
path: root/www/p5-Apache-Session/files
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>2001-12-06 15:55:28 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>2001-12-06 15:55:28 +0000
commit530a0ad790e206b976abbb7c5c14848629c161a4 (patch)
tree439c87acf173d28a31b69bc9ecd4b38d4cd57c29 /www/p5-Apache-Session/files
parentadd newmat (diff)
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.
Notes
Notes: svn path=/head/; revision=51147
Diffstat (limited to 'www/p5-Apache-Session/files')
-rw-r--r--www/p5-Apache-Session/files/patch-Session::Lock::File.pm24
-rw-r--r--www/p5-Apache-Session/files/patch-Session::Store::File.pm71
2 files changed, 95 insertions, 0 deletions
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";