CGI-Session-ExpireSessions-1.14/0000755000175000017500000000000014041757112014623 5ustar ronronCGI-Session-ExpireSessions-1.14/MANIFEST0000644000175000017500000000066414041757112015762 0ustar ronronChangelog.ini Changes examples/expire-sessions.pl examples/expire-set.pl lib/CGI/Session/ExpireSessions.pm LICENSE Makefile.PL MANIFEST This list of files MANIFEST.SKIP README t/00.versions.t t/00.versions.tx t/delete-via-find.t t/new-line.t t/use.t xt/author/pod.t META.yml Module YAML meta-data (added by MakeMaker) META.json Module JSON meta-data (added by MakeMaker) CGI-Session-ExpireSessions-1.14/MANIFEST.SKIP0000644000175000017500000000115714041755532016531 0ustar ronron# Avoid version control files. ,v$ \B\.cvsignore$ \B\.git\b \B\.gitignore\b \B\.svn\b \bCVS\b \bRCS\b # Avoid Makemaker generated and utility files. \bblib \bblibdirs$ \bpm_to_blib$ \bMakefile$ \bMakeMaker-\d # Avoid Module::Build generated and utility files. \b_build \bBuild$ \bBuild.bat$ # Avoid Devel::Cover generated files \bcover_db # Avoid temp and backup files. ~$ \#$ \.# \.bak$ \.old$ \.rej$ \.tmp$ # Avoid OS-specific files/dirs # Mac OSX metadata \B\.DS_Store # Mac OSX SMB mount metadata files \B\._ # Avoid UltraEdit files. \.prj$ \.pui$ ^MYMETA.yml$ ^MYMETA\.json$ ^CGI-Session-ExpireSessions-.* CGI-Session-ExpireSessions-1.14/META.json0000644000175000017500000000263314041757112016250 0ustar ronron{ "abstract" : "Expires CGI::Session db-based and file-based sessions", "author" : [ "Ron Savage (ron@savage.net.au)" ], "dynamic_config" : 1, "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "CGI-Session-ExpireSessions", "no_index" : { "directory" : [ "t", "inc" ] }, "prereqs" : { "build" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "runtime" : { "requires" : { "CGI::Session" : "4.14", "Carp" : "0", "File::Spec" : "0" } }, "test" : { "requires" : { "Test::More" : "1.001002" } } }, "release_status" : "stable", "resources" : { "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "type" : "git", "url" : "https://github.com/ronsavage/CGI-Session-ExpireSessions.git", "web" : "https://github.com/ronsavage/CGI-Session-ExpireSessions" } }, "version" : "1.14", "x_serialization_backend" : "JSON::PP version 4.02" } CGI-Session-ExpireSessions-1.14/examples/0000755000175000017500000000000014041757112016441 5ustar ronronCGI-Session-ExpireSessions-1.14/examples/expire-sessions.pl0000444000175000017500000000077112150573411022136 0ustar ronron#!/usr/bin/env perl use strict; use warnings; use CGI::Session::ExpireSessions; use DBI; # ----------------------------------------------- my($dbh) = DBI -> connect ( 'DBI:mysql:aussi:127.0.0.1', 'root', 'pass', { AutoCommit => 1, PrintError => 0, RaiseError => 1, ShowErrorStatement => 1, } ); CGI::Session::ExpireSessions -> new(dbh => $dbh, verbose => 1) -> expire_db_sessions(); CGI::Session::ExpireSessions -> new(temp_dir => '/temp', verbose => 1) -> expire_file_sessions(); CGI-Session-ExpireSessions-1.14/examples/expire-set.pl0000444000175000017500000000412012150573411021053 0ustar ronron#!/usr/bin/env perl # # Name: # expire-set.pl. # # Author: # Ron Savage # http://savage.net.au/index.html # # Purpose: # Call CGI::Session::ExpireSessions' sub expire_sessions() twice, # in order to demonstrate various options available with the module # CGI::Session::ExpireSessions. # # Note: # tab = 4 spaces || die. use strict; use warnings; use CGI::Session; use CGI::Session::ExpireSessions 1.08; # ------------- # Create a default (i.e. file-based) type of session, and then sleep so we can be sure # that the session will be older than the time specified by delta (1 second). # Also, you can - in the background - create a db-based session, and then # run this program, and that db-based session will be deleted by the first call to # sub expire_sessions(). my($s) = CGI::Session -> new(); sleep(2); # Note: # Parameters to CGI::Session::ExpireSessions can be given # when calling new() and/or when calling expire_sessions(). my($expirer) = CGI::Session::ExpireSessions -> new(delta => 1); # Note: # o cgi_session_dsn # This value is mandatory in order to use db-based sessions, since, by default, # CGI::Session used file-based sessions. # o dsn_args # This value (! undef) is mandatory, in order to use database sessions. $expirer -> expire_sessions ( cgi_session_dsn => 'driver:mysql;serializer:default;id:MD5', dsn_args => { DataSource => 'dbi:mysql:mids', User => 'root', Password => 'toor', } ); # Note: # o cgi_session_dsn # This value is mandatory to reset the value above back to the default. # Note that this default will be supplied by CGI::Session. # o dsn_args # This value (undef) is not really mandatory in order to cancel out the db_dsn above, # because the value of cgi_session_dsn is what says this call to expire_sessions() # is intended to deal with file-based sessions. Nevertheless, I set it to undef because # it would be /very confusing/ to specify database parametes to file-based sessions. # So don't do that! # o verbose # This value is optional. The default value is 0. $expirer -> expire_sessions ( cgi_session_dsn => undef, dsn_args => undef, verbose => 1, ); CGI-Session-ExpireSessions-1.14/README0000444000175000017500000000334712150573411015505 0ustar ronronREADME file for CGI::Session::ExpireSessions. Warning: WinZip 8.1 and 9.0 both contain an 'accidental' bug which stops them recognizing POSIX-style directory structures in valid tar files. You are better off using a reliable tool such as InfoZip: ftp://ftp.info-zip.org/pub/infozip/ 1 Installing from a Unix-like distro ------------------------------------ shell>gunzip CGI-Session-ExpireSessions-1.03.tgz shell>tar mxvf CGI-Session-ExpireSessions-1.03.tar On Unix-like systems, assuming you have installed Module::Build V 0.25+: shell>perl Build.PL shell>./Build shell>./Build test shell>./Build install On MS Windows-like systems, assuming you have installed Module::Build V 0.25+: shell>perl Build.PL shell>perl Build shell>perl Build test shell>perl Build install Alternately, without Module::Build, you do this: Note: 'make' on MS Windows-like systems may be called 'nmake' or 'dmake'. shell>perl Makefile.PL shell>make shell>make test shell>su (for Unix-like systems) shell>make install shell>exit (for Unix-like systems) On all systems: Run ExpireSessions.pm through you favourite pod2html translator. If you are using my fancy-pom2.pl, with its 'default.css' file installed in /apache2/htdocs/css/, you'd do: shell>perl fancy-pom2.pl html -css ExpireSessions.pm > /apache2/htdocs/ExpireSessions.html or perhaps something like: shell>perl fancy-pom2.pl html -css ExpireSessions.pm > /perl/html/site/lib/CGI/Session/ExpireSessions.html 2 Installing from an ActiveState distro --------------------------------------- shell>unzip CGI-Session-ExpireSessions-1.03.zip shell>ppm install --location=. CGI-Session-ExpireSessions shell>del CGI-Session-ExpireSessions-1.03.ppd shell>del PPM-CGI-Session-ExpireSessions-1.03.tar.gz CGI-Session-ExpireSessions-1.14/xt/0000755000175000017500000000000014041757112015256 5ustar ronronCGI-Session-ExpireSessions-1.14/xt/author/0000755000175000017500000000000014041757112016560 5ustar ronronCGI-Session-ExpireSessions-1.14/xt/author/pod.t0000444000175000017500000000020412150573411017516 0ustar ronronuse Test::More; eval "use Test::Pod 1.45"; plan skip_all => "Test::Pod 1.45 required for testing POD" if $@; all_pod_files_ok(); CGI-Session-ExpireSessions-1.14/lib/0000755000175000017500000000000014041757112015371 5ustar ronronCGI-Session-ExpireSessions-1.14/lib/CGI/0000755000175000017500000000000014041757112015773 5ustar ronronCGI-Session-ExpireSessions-1.14/lib/CGI/Session/0000755000175000017500000000000014041757112017416 5ustar ronronCGI-Session-ExpireSessions-1.14/lib/CGI/Session/ExpireSessions.pm0000644000175000017500000004232014041757111022737 0ustar ronronpackage CGI::Session::ExpireSessions; # Name: # CGI::Session::ExpireSessions. # # Documentation: # POD-style documentation is at the end. Extract it with pod2html.*. # # Reference: # Object Oriented Perl # Damian Conway # Manning # 1-884777-79-1 # P 114 # # Note: # o Tab = 4 spaces || die. # # Author: # Ron Savage # Home page: http://savage.net.au/index.html # # Licence: # Australian copyright (c) 2004 Ron Savage. # # All Programs of mine are 'OSI Certified Open Source Software'; # you can redistribute them and/or modify them under the terms of # The Artistic License, a copy of which is available at: # http://www.opensource.org/licenses/index.html use strict; use warnings; require 5.005_62; require Exporter; use Carp; use CGI::Session; use File::Spec; our @ISA = qw(Exporter); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. # This allows declaration use CGI::Session::ExpireSessions ':all'; # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); our $VERSION = '1.14'; # ----------------------------------------------- # Preloaded methods go here. # ----------------------------------------------- # Encapsulated class data. { my(%_attr_data) = ( _cgi_session_dsn => undef, _dbh => '', _delta => 2 * 24 * 60 * 60, # Seconds. _dsn_args => undef, _table_name => 'sessions', _temp_dir => '/tmp', _time => time(), _verbose => 0, ); sub _check_expiry { my($self, $D) = @_; my($expired) = 0; my($time) = time(); if ( ($time - $$D{'_SESSION_ATIME'}) >= $$self{'_delta'}) { $expired = 1; print STDOUT "Delta time: $$self{'_delta'}. Time elapsed: ", $time - $$D{'_SESSION_ATIME'}, ". Expired?: $expired. \n" if ($$self{'_verbose'}); } if ($$D{'_SESSION_ETIME'} && ! $expired) { $expired = 1 if ($time >= ($$D{'_SESSION_ATIME'} + $$D{'_SESSION_ETIME'}) ); print STDOUT "Last access time: $$D{'_SESSION_ATIME'}. Expiration time: $$D{'_SESSION_ETIME'}. Time elapsed: ", $time - $$D{'_SESSION_ATIME'}, ". Expired?: $expired. \n" if ($$self{'_verbose'}); } $expired; } sub _default_for { my($self, $attr_name) = @_; $_attr_data{$attr_name}; } # Warning: The args hashref passed in to sub _purge() has /no/ connexion # with the $self hashref with belongs to the object instantiated by our client. # The client code did something like this to create an object: # my($expirer) = CGI::Session::ExpireSessions -> new(delta => 1); # and we, the object, i.e. $expirer, are in fact the server. sub _purge { my($session, $args) = @_; return if ($session -> is_empty() ); if ($session -> is_expired() || ($$args{'_time'} - $session -> atime() >= $$args{'_delta'}) ) { print STDOUT "Expiring id @{[$session -> id()]}. \n" if ($$args{'_verbose'}); $session -> delete(); $session -> flush(); } } sub _standard_keys { keys %_attr_data; } } # End of encapsulated class data. # ----------------------------------------------- sub expire_db_sessions { my($self, %arg) = @_; $self -> set(%arg) if (%arg); Carp::croak(__PACKAGE__ . ". You must specify a value for the parameter 'dbh'") if (! $$self{'_dbh'}); my($sth) = $$self{'_dbh'} -> prepare("select * from $$self{'_table_name'}"); $sth -> execute(); my($serializer) = 'eval'; if (defined $$self{_serializer}) { $serializer = $$self{_serializer}; } my($data, $D, @id, $untainted_data); while ($data = $sth -> fetchrow_hashref() ) { # Untaint the data the brute force way. ($untainted_data) = $$data{'a_session'} =~ /(.*)/; if ($serializer eq 'eval') { eval $untainted_data; push @id, $$data{id} if ($self -> _check_expiry($D) ); } else { my($serializer) = "CGI::Session::Serialize::$serializer"; my($thawed) = $serializer -> thaw($untainted_data); push @id, $$data{id} if ($self -> _check_expiry($thawed) ); } } for (@id) { print STDOUT "Expiring db id: $_. \n" if ($$self{'_verbose'}); $sth = $$self{'_dbh'} -> prepare("delete from $$self{'_table_name'} where id = ?"); $sth -> execute($_); $sth -> finish(); } if ( ($#id < 0) && $$self{'_verbose'}) { print STDOUT "No db ids are due to expire. \n"; } } # End of expire_db_sessions. # ----------------------------------------------- sub expire_file_sessions { my($self, %arg) = @_; $self -> set(%arg) if (%arg); Carp::croak(__PACKAGE__ . ". You must specify a value for the parameter 'temp_dir'") if (! $$self{'_temp_dir'}); opendir(INX, $$self{'_temp_dir'}) || Carp::croak("Can't opendir($$self{'_temp_dir'}): $!"); my(@file) = map{File::Spec -> catfile($$self{'_temp_dir'}, $_)} grep{/cgisess_[0-9a-f]{32}/} readdir(INX); closedir INX; my($count) = 0; my($time) = time(); my($file, @stat, $D); for my $file (@file) { @stat = stat($file); # Delete old, tiny files. if ( ( ($time - $stat[8]) >= $$self{'_delta'}) && ($stat[7] <= 5) ) { $count++; print STDOUT "Delta time: $$self{'_delta'}. Size: $stat[7] bytes. Time elapsed: ", $time - $stat[8], ". Expired?: 1. \n" if ($$self{'_verbose'}); unlink $file; next; } # Ignore new, tiny files. next if ($stat[7] <= 5); open(INX, $file) || Carp::croak("Can't open($file): $!"); binmode INX; my(@session) = ; close INX; # Pod/perlfunc.html#item_eval # This does not work: # eval{no warnings 'all'; $session[0]}; # This was when I used to say 'eval $session[0];', but that fails # when the session data contains \n characters. Hence the join. eval join('', @session); if ($@) { print STDOUT "Unable to parse contents of file: $file. \n" if ($$self{'_verbose'}); next; } if ($self -> _check_expiry($D) ) { $count++; print STDOUT "Expiring file id: $$D{'_SESSION_ID'}. \n" if ($$self{'_verbose'}); unlink $file; } } print STDOUT "No file ids are due to expire. \n" if ( ($count == 0) && $$self{'_verbose'}); } # End of expire_file_sessions. # ----------------------------------------------- sub expire_sessions { my($self, %arg) = @_; return if (! CGI::Session -> can('find') ); # Return the result of find, which is: # o Undef for failure # o 1 for success $self -> set(%arg) if (%arg); return CGI::Session -> find ( $$self{'_cgi_session_dsn'}, sub{_purge(@_, { # This hashref is a parameter for _purge(). _delta => $$self{'_delta'} || 0, # These 2 defaults are in case the user sets them to undef! _time => $$self{'_time'} || time(), # The defaults then stop Perl issuing warning messages about _verbose => $$self{'_verbose'}, # uninitialized variables during the call to sub _purge(). })}, $$self{'_dsn_args'} ); } # End of expire_sessions. # ----------------------------------------------- sub new { my($class, %arg) = @_; my($self) = bless({}, $class); for my $attr_name ($self -> _standard_keys() ) { my($arg_name) = $attr_name =~ /^_(.*)/; if (exists($arg{$arg_name}) ) { $$self{$attr_name} = $arg{$arg_name}; } else { $$self{$attr_name} = $self -> _default_for($attr_name); } } return $self; } # End of new. # ----------------------------------------------- sub set { my($self, %arg) = @_; for my $arg (keys %arg) { $$self{"_$arg"} = $arg{$arg} if (exists($$self{"_$arg"}) ); } } # End of set. # ----------------------------------------------- 1; __END__ =head1 NAME CGI::Session::ExpireSessions - Expires CGI::Session db-based and file-based sessions =head1 Synopsis #!/usr/bin/env perl use strict; use warnings; use CGI::Session::ExpireSessions; use DBI; # ----------------------------------------------- my($dbh) = DBI -> connect ( 'dbi:mysql:aussi:127.0.0.1', 'root', 'pass', { AutoCommit => 1, PrintError => 0, RaiseError => 1, ShowErrorStatement => 1, } ); CGI::Session::ExpireSessions -> new(dbh => $dbh, verbose => 1) -> expire_db_sessions(); CGI::Session::ExpireSessions -> new(temp_dir => '/tmp', verbose => 1) -> expire_file_sessions(); CGI::Session::ExpireSessions -> new(verbose => 1) -> expire_sessions(); # Note: You are strongly urged to use method expire_sessions() (it requires CGI::Session V 4 or later), # since it does not eval the session data, and hence avoids the security issues of evaling a string # which comes from outside the program. See examples/expire-set.pl, which contains extensive comments. =head1 Description C is a pure Perl module. It deletes C-type sessions which have passed their use-by date. It works with C-type sessions in a database or in disk files, but does not appear to work with C-type sessions. The recommended way to use this module is via method C, which requires C V 4 or later. Sessions can be expired under one of three conditions: =over 4 =item o You deem the session to be expired as of now =over 4 =item o Methods: C and C You want the session to be expired and hence deleted now because it's last access time is longer ago than the time you specify in the call to new, using the delta parameter. That is, delete the session because the time span, between the C time and now, is greater than delta. In other words, force sessions to expire. The module has always used this condition to delete sessions. =item o Method: C You want the session to be expired and hence deleted now because it's C time is longer ago than the time you specify in the call to new, using the delta parameter. =back =item o The session has already expired This section applies to all 3 methods: C, C and C. This condition is new as of V 1.02. You want the session to be deleted now because it has already expired. That is, you want this module to delete the session, rather than getting C to delete it, when C would delete the session automatically if you used C to retrieve the session. Note: This condition assumes the session's expiration time is defined (it does not have to be). =item o The file size is <= 5 bytes and was accessed more than 'delta' seconds ago This condition is new as of V 1.03. This section applies to method: C. See below for how to provide a value of delta to the constructor. Old versions of C sometimes create a file of size 0 bytes, so this test checks for such files, and deletes them if they are old enough. =back Sessions are deleted if any of these conditions is true. Sessions are deleted from the 'sessions' table in the database, or from the temp directory, depending on how you use C. =head1 Distributions This module is available both as a Unix-style distro (*.tgz) and an ActiveState-style distro (*.ppd). The latter is shipped in a *.zip file. See http://savage.net.au/Perl-modules.html for details. See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing each type of distro. =head1 Security For file-based sessions, method C parses the contents of the file, using eval{}, in an attempt to determine the access and expiration times recorded within the file. So, if you are uneasy about the security implication of this (as you should be), don't use this method. Use method C instead. The latter is a much more sophisticated way of expiring sessions, but it does require C V 4 or later. =head1 Constructor and initialization new(...) returns a C object. This is the class's contructor. Usage: CGI::Session::ExpireSessions -> new(). This method takes a set of parameters. Only some of these parameters are mandatory. For each parameter, call method C as new(param_1 => value_1, param_2 => value_2, ...). Note: As of V 1.07 of this module, you may call method C to set parameters after calling method C. Not only that, but you may pass into all of the 3 methods C, C and C any of the parameters accepted by C, since these 3 methods call C if their caller provides parameters. Parameters which can be used with C, C, or C: =over 4 =item o cgi_session_dsn This is the DSN (Data Source Name) used by C to control what type of sessions you previously created and what type of sessions you now wish to expire. Do not confuse this with the DSN used by C's method find(param_1, \&sub, {DataSource => other_dsn...}, ...) when referring to db-based sessions. Method C is the only method in this module which uses this parameter. So, when you call C, this parameter - cgi_session_dsn - determines the set of sessions processed by, and possibly expired by, the call to C. The default value is undef, which means C defaults to file-based sessions. This parameter is optional for file-based sessions, and mandatory for db-based sessions. =item o dbh This is a database handle for the database containing the table 'sessions'. Either this parameter is mandatory, or the temp_dir parameter is mandatory. =item o delta =over 4 =item o Methods: C and C This is the number of seconds since the C to the session, which determines whether or not the session will be expired. =item o Method: C This is the number of seconds since the C time of the session, which determines whether or not the session will be expired. =back The default value is 2 * 24 * 60 * 60, which is the number of seconds in 2 days. By default, then, sessions which were last accessed more than 2 days ago are expired. This parameter is optional. =item o dsn_args If your cgi_session_dsn uses file-based storage, then this hashref might contain keys such as: { Directory => Value 1, NoFlock => Value 2, UMask => Value 3 } If your cgi_session_dsn uses db-based storage, then this hashref contains (up to) 3 keys, and looks like: { DataSource => Value 1, User => Value 2, Password => Value 3 } These 3 form the DSN, username and password used by DBI to control access to your database server, and hence are only relevant when using db-based sessions. Method C is the only method in this module which uses the parameter dsn_args. The default value for this parameter is undef. These parameters are optional for file-based sessions, and mandatory for db-based sessions. =item o table_name This is the name of the database table used to hold the sessions. The default value is 'sessions'. This parameter is optional. =item o temp_dir This is the name of the temp directory where you store CGI::Session-type session files. The default value is '/tmp'. Either this parameter is mandatory, or the dbh parameter is mandatory. =item o time The session's C time is subtracted from the value of this parameter, and if the result is greater than or equal to the value of parameter 'delta', then the session is expired. Method C is the only method in this module which uses this parameter. The default value is obtained by calling time(). This parameter is optional. =item o verbose This is a integer, 0 or 1, which - when set to 1 - causes progress messages to be written to STDOUT. The default value is 0. This parameter is optional. =back =head1 Method: expire_db_sessions() Returns nothing. This method uses the dbh parameter passed to C to delete database-type sessions. =head1 Method: expire_file_sessions() Returns nothing. This method uses the temp_dir parameter passed to C to delete file-type sessions. =head1 Method: expire_sessions() Return value: =over 4 =item o undef Returns undef if your version of C does not support method C. Also, returns undef when C's method C failed for some reason. =item o 1 Returns 1 when C succeeds. =back Returns the result of calling CGI::Session's method find(), which will be undef for some sort of failure, and 1 for success. This method handles both file-based and db-based sessions. =head1 Example code See the examples/ directory in the distro. There are 2 demo programs: expire-sessions.pl and expire-set.pl. =head1 SUPPORT Bugs should be reported via the CPAN bug tracker at L =head1 REPOSITORY L. =head1 Author C was written by Ron Savage Iron@savage.net.auE> in 2004. Home page: http://savage.net.au/index.html =head1 Copyright Australian copyright (c) 2004, Ron Savage. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html =cut CGI-Session-ExpireSessions-1.14/Makefile.PL0000644000175000017500000000263414041756706016612 0ustar ronronuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. # ---------------------- my(%params) = ( ($] ge '5.005') ? ( 'AUTHOR' => 'Ron Savage (ron@savage.net.au)', 'ABSTRACT' => 'Expires CGI::Session db-based and file-based sessions', ) : (), clean => { FILES => 'blib/* Makefile MANIFEST CGI-Session-ExpireSessions-*' }, dist => { COMPRESS => 'gzip', SUFFIX => 'gz' }, DISTNAME => 'CGI-Session-ExpireSessions', LICENSE => 'perl', NAME => 'CGI::Session::ExpireSessions', PL_FILES => {}, PREREQ_PM => { 'Carp' => 0, 'CGI::Session' => 4.14, 'File::Spec' => 0, }, TEST_REQUIRES => { 'Test::More' => 1.001002, }, VERSION_FROM => 'lib/CGI/Session/ExpireSessions.pm', ); if ( ($ExtUtils::MakeMaker::VERSION =~ /^\d\.\d\d$/) && ($ExtUtils::MakeMaker::VERSION > 6.30) ) { $params{LICENSE} = 'perl'; } if ($ExtUtils::MakeMaker::VERSION ge '6.46') { $params{META_MERGE} = { 'meta-spec' => { version => 2, }, resources => { bugtracker => 'https://rt.cpan.org/Public/Dist/Display.html?Name=CGI-Session-ExpireSessions', license => 'http://dev.perl.org/licenses/', repository => { type => 'git', url => 'https://github.com/ronsavage/CGI-Session-ExpireSessions.git', web => 'https://github.com/ronsavage/CGI-Session-ExpireSessions', }, }, }; } WriteMakefile(%params); CGI-Session-ExpireSessions-1.14/Changes0000644000175000017500000001262314041754056016126 0ustar ronronRevision history for Perl extension CGI::Session::ExpireSessions. 1.14 2021-04-27T19:10:00 - Adopt patch to sub expire_db_sessions() from Noam Rathaus. With thanx! - Change licence from artistic_2 to perl. - Update POD re repository to be on github, and submission of patches. - Update Makefile.PL. 1.13 2013-05-27T15:57:00 - Replace /usr/bin/perl with /usr/bin/env perl. - Replace common::sense with use strict and use warnings, to get uninit var warnings. - Rename test files from \d\d-*.t to *.t. - Clean up the POD so it passes tests. Specifically, '=item 1' becomes '=item o 1', and all other '=item' tokens are replaced by '=item o' to match. 1.12 2010-02-21T12:54:42 - Remove text 'All rights reserved' (for Debian licensing). - Remove POD heads 'Required Modules' and 'Changes'. 1.11 2010-02-10T14:01:28 - MANIFEST.SKIP updated to exclude MYMETA.yml. Add MYMETA.yml. 1.10 2009-11-13T13:20:00 - Run dos2unix - Rename Changes.txt to CHANGES 1.09 2008-05-15T11:11:00 - Delete V 1.08 from CPAN and upload V 1.09, hoping CPAN will index it properly this time. All this because some uses have logged a ticket (RT#35515) about not being able to use 'cpan' to install the module. They are right, I can't get 'cpan' to work either - Start shipping Changelog.ini 1.08 2006-06-12T11:32:00 - Version 1.07 was never uploaded to CPAN. It was just available from my site, and was meant for testing the proposed callback mechanism in CGI::Session::find. That mechanism was changed before CGI::Session 4.14 was released, so my module's code now changes to match. Also, since CGI::Session has been patched so its sub find() no longer updates the session's access time, my module now uses atime instead of ctime when checking for expiry 1.07 2006-04-12T14:36:00 - Add method expire_sessions() which uses CGI::Session V 4 method find() to find all sessions, and then expires sessions if appropriate. All this without evaling the contents of the session and which therefore resolves RT bug 16069 - Document the new method and the new parameters to new() - Add test t/03-delete-via-find.t to test the new code - Add examples/expire-set.pl to demonstrate and document further ways of using the new method - Make CGI::Session V 4.13 a prerequisite 1.06 2006-04-04T10:04:00 - Add binmode after open in sub expire_file_sessions - Change "eval $session[0]" into "eval join('', @session)" to handle session data containing \n - Add a new test, t/new-line.t, to test session data containing \n - The problem with session data containing \n characters was reported via RT by m-uchino at yetipapa.com 1.05 2005-10-26T11:25:00 - Untaint the data read in from the sessions table before eval-ing it. The problem, reported (with a code patch) by Dr RA Jones, was that the original code triggered an insecure dependency warning when running under -T, but only when using DBD::PgPP under MS Windows. The exact reason for this warning in this situation remains a mystery - Simplify code in new() to no longer check if caller is an object as per the new standard on such matters 1.04 2004-11-02T15:20:00 - Note: All files referred to here match the CGI::Session file name format /cgisess_[0-9a-f]{32}/ - Fix the assumption in sub expire_file_sessions() that the program was being run in the temp directory, by adding the temp directory's name as a prefix to all file names. Original patch: Matthias Blising - Fix sub expire_file_sessions() to delete files of size <= 5 bytes which are old enough. Files of size 0 are sometimes created by CGI::Session under unknown circumstances. As always, use new(delta => 123) to change the definition of 'old enough' - Fix verbose message for file session where it should have referred to $$D{'_SESSION_ID'} and not $$D{'id'}. The latter was a careless copy-and-paste from the database code - Ignore recent files whose size is <= 5 bytes - Change text of verbose messages from 'Time lapsed' to 'Time elapsed' - Add a security warning to the POD. Actually this comment is redundant, because you always read the POD, right? 1.03 2004-07-19T14:47:00 - Change Makefile.PL to coexist with Module::Build - Add t/pod.t to test all PODs 1.02 2004-06-29T10:08:00 - Add code so sessions which have already expired are also deleted. Originally, the module allowed you to force sessions to expire, via the delta parameter to new(). Now it also checks for sessions which have already expired, that is for sessions which CGI::Session would delete automatically when retrieving them. Thanx to Adam Gent for this suggestion - Rewrite the POD where it discusses expiration and deletion 1.01 2004-04-27T10:01:00 - Add another parameter to new(): table_name. This allows you to store sessions in a table with a non-default name. The default name is of course 'sessions'. Thanx to Mark Stosberg for this suggestion - This module does not work with Mark's module CGI::Session::PureSQL. The best solution to this problem seems to be to extend CGI::Session to offer a session iterator. This suggesion is also from Mark. I will propose this today to the author of CGI::Session when I report the bug in CGI:Session V 3.94 line 168, which says: if ( $arg->isa('CGI') ) This bug means classes such as CGI::Simple can't be used here as a replacement for CGI. The code needs to be something like: if ($arg -> can('cookie') )... elsif ($arg -> can('param') )... 1.00 2004-04-19T12:37:29 - Original versionCGI-Session-ExpireSessions-1.14/META.yml0000644000175000017500000000141314041757112016073 0ustar ronron--- abstract: 'Expires CGI::Session db-based and file-based sessions' author: - 'Ron Savage (ron@savage.net.au)' build_requires: ExtUtils::MakeMaker: '0' Test::More: '1.001002' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 1 generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: CGI-Session-ExpireSessions no_index: directory: - t - inc requires: CGI::Session: '4.14' Carp: '0' File::Spec: '0' resources: license: http://dev.perl.org/licenses/ repository: https://github.com/ronsavage/CGI-Session-ExpireSessions.git version: '1.14' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' CGI-Session-ExpireSessions-1.14/t/0000755000175000017500000000000014041757112015066 5ustar ronronCGI-Session-ExpireSessions-1.14/t/new-line.t0000444000175000017500000000157312150573411016772 0ustar ronron#!/usr/bin/env perl use strict; use diagnostics; BEGIN { use Test::More; plan(tests => 5); use_ok('CGI::Session'); use_ok('CGI::Session::ExpireSessions'); }; # Create a block so $s goes out of scope before we try to access the session. # Without the {}, CGI::Session::ExpireSessions does not see this session, # although it will see sessions created by previous runs of this program. { my($s) = new CGI::Session(undef, undef, {Directory => 't'} ); ok($s, 'The test session has been created'); $s -> expire(1); ok($s -> id, "The test session's id has been set"); $s -> param(purpose => "Test new-line within session data. Works with CGI::Session::ExpireSessions V 1.06\n"); ok($s -> param('purpose'), "The test session's parameter called 'purpose' has been set"); } CGI::Session::ExpireSessions -> new(delta => 0, temp_dir => 't', verbose => 1) -> expire_file_sessions(); CGI-Session-ExpireSessions-1.14/t/00.versions.tx0000644000175000017500000000077314041756121017537 0ustar ronron#/usr/bin/env perl use strict; use warnings; # I tried 'require'-ing modules but that did not work. use <: $module_name :>; # For the version #. use Test::More; <: $module_list_1 :> # ---------------------- pass('All external modules loaded'); my(@modules) = qw / <: $module_list_2 :> /; diag "Testing <: $module_name :> V $<: $module_name :>::VERSION"; for my $module (@modules) { no strict 'refs'; my($ver) = ${$module . '::VERSION'} || 'N/A'; diag "Using $module V $ver"; } done_testing; CGI-Session-ExpireSessions-1.14/t/delete-via-find.t0000444000175000017500000000202712150573411020204 0ustar ronron#!/usr/bin/env perl use strict; use diagnostics; BEGIN { use CGI::Session; use CGI::Session::ExpireSessions; use Test::More; if (CGI::Session -> can('find') ) { plan tests => 3; } else { plan skip_all => "Requires a version of CGI::Session with method 'find()'"; } }; # Create a block so $s goes out of scope before we try to access the session. # Without the {}, CGI::Session::ExpireSessions does not see this session, # although it will see sessions created by previous runs of this program. { my($s) = new CGI::Session(undef, undef, {Directory => 't'} ); ok($s, 'The test session has been created'); $s -> expire(1); ok($s -> id, "The test session's id has been set"); #print "id: ", $s -> id(), ". \n"; $s -> param(purpose => "Create session simply to test deleting it with CGI::Session's sub find()"); ok($s -> param('purpose'), "The test session's parameter called 'purpose' has been set"); } CGI::Session::ExpireSessions -> new(delta => 0, dsn_args => {Directory => 't'}, verbose => 1) -> expire_sessions(); CGI-Session-ExpireSessions-1.14/t/use.t0000444000175000017500000000015112150573411016037 0ustar ronronuse Test::More tests => 1; # ------------------------ BEGIN{ use_ok('CGI::Session::ExpireSessions'); } CGI-Session-ExpireSessions-1.14/t/00.versions.t0000644000175000017500000000107314041757111017341 0ustar ronron#/usr/bin/env perl use strict; use warnings; # I tried 'require'-ing modules but that did not work. use CGI::Session::ExpireSessions; # For the version #. use Test::More; use Carp; use CGI::Session; use File::Spec; # ---------------------- pass('All external modules loaded'); my(@modules) = qw / Carp CGI::Session File::Spec /; diag "Testing CGI::Session::ExpireSessions V $CGI::Session::ExpireSessions::VERSION"; for my $module (@modules) { no strict 'refs'; my($ver) = ${$module . '::VERSION'} || 'N/A'; diag "Using $module V $ver"; } done_testing; CGI-Session-ExpireSessions-1.14/Changelog.ini0000644000175000017500000001345014041757111017215 0ustar ronron[Module] Name=CGI::Session::ExpireSessions Changelog.Creator=Module::Metadata::Changes V 2.12 Changelog.Parser=Config::IniFiles V 3.000002 [V 1.14] Date=2021-04-27T19:10:00 Comments= < 123) to change the definition of 'old enough' - Fix verbose message for file session where it should have referred to $$D{'_SESSION_ID'} and not $$D{'id'}. The latter was a careless copy-and-paste from the database code - Ignore recent files whose size is <= 5 bytes - Change text of verbose messages from 'Time lapsed' to 'Time elapsed' - Add a security warning to the POD. Actually this comment is redundant, because you always read the POD, right? EOT [V 1.03] Date=2004-07-19T14:47:00 Comments= <isa('CGI') ) This bug means classes such as CGI::Simple can't be used here as a replacement for CGI. The code needs to be something like: if ($arg -> can('cookie') )... elsif ($arg -> can('param') )... EOT [V 1.00] Date=2004-04-19T12:37:29 Comments=- Original version CGI-Session-ExpireSessions-1.14/LICENSE0000644000175000017500000004740714041754056015650 0ustar ronronTerms of Perl itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" ---------------------------------------------------------------------------- The General Public License (GPL) Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS ---------------------------------------------------------------------------- The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End