Author: timbo
Date: Tue Jan 25 15:59:17 2005
New Revision: 842

Modified:
   dbi/trunk/Changes
   dbi/trunk/dbiproxy.PL
   dbi/trunk/lib/DBI/ProxyServer.pm
Log:
Fixed DBI::ProxyServer to not create pid files by default.
References: Ubuntu Security Notice USN-70-1, CAN-2005-0077


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Tue Jan 25 15:59:17 2005
@@ -4,8 +4,12 @@
 
 =cut
 
-=head2 Changes in DBI 1.47 (svn rev XXX),    XXth November 2004
+=head2 Changes in DBI 1.47 (svn rev XXX),    XXth January 2005
 
+  Fixed DBI::ProxyServer to not create pid files by default.
+    References: Ubuntu Security Notice USN-70-1, CAN-2005-0077
+    Thanks to Javier Fern�ndez-Sanguino Pe�a from the
+    Debian Security Audit Project, and Jonathan Leffler.
   Fixed some tests to work with older Test::More versions.
   Fixed setting $DBI::lasth where DESTROY calls other methods.
   Fixed setting $DBI::err/errstr in DBI::PurePerl.

Modified: dbi/trunk/dbiproxy.PL
==============================================================================
--- dbi/trunk/dbiproxy.PL       (original)
+++ dbi/trunk/dbiproxy.PL       Tue Jan 25 15:59:17 2005
@@ -146,7 +146,7 @@
 =item B<--pidfile=file>
 
 (UNIX only) If this option is present, a PID file will be created at the
-given location.
+given location. Default is to not create a pidfile.
 
 =item B<--user=uid>
 

Modified: dbi/trunk/lib/DBI/ProxyServer.pm
==============================================================================
--- dbi/trunk/lib/DBI/ProxyServer.pm    (original)
+++ dbi/trunk/lib/DBI/ProxyServer.pm    Tue Jan 25 15:59:17 2005
@@ -33,12 +33,6 @@
 package DBI::ProxyServer;
 
 
-my $haveFileSpec = eval { require File::Spec };
-my $tmpDir = $haveFileSpec ? File::Spec->tmpdir() :
-    ($ENV{'TMP'} || $ENV{'TEMP'} || '/tmp');
-my $defaultPidFile = $haveFileSpec ?
-    File::Spec->catdir($tmpDir, "dbiproxy.pid") : "/tmp/dbiproxy.pid";
-
 
 ############################################################################
 #
@@ -109,7 +103,8 @@
     } else {
        $o->{'mode'} = 'single';
     }
-    $o->{'pidfile'}    = $defaultPidFile;
+    # No pidfile by default, configuration must provide one if needed
+    $o->{'pidfile'}    = 'none';
     $o->{'user'}       = undef;
 };
 
@@ -406,8 +401,7 @@
 =head1 OPTIONS
 
 When calling the DBI::ProxyServer::main() function, you supply an
-array of options. (@ARGV, the array of command line options is used,
-if you don't.) These options are parsed by the Getopt::Long module.
+array of options. These options are parsed by the Getopt::Long module.
 The ProxyServer inherits all of RPC::PlServer's and hence Net::Daemon's
 options and option handling, in particular the ability to read
 options from either the command line or a config file. See
@@ -517,7 +511,7 @@
 =item I<pidfile> (B<--pidfile=file>)
 
 (UNIX only) If this option is present, a PID file will be created at the
-given location.
+given location. Default is to not create a pidfile.
 
 =item I<user> (B<--user=uid>)
 
@@ -609,7 +603,7 @@
     {
        # This shall run in a shell or a DOS-window 
        # facility => 'daemon',
-       pidfile => 'dbiproxy.pid',
+       pidfile => 'your_dbiproxy.pid',
        logfile => 1,
        debug => 0,
        mode => 'single',

Reply via email to