r57886 - in /branches/upstream/libparanoid-perl/current: CHANGELOG META.yml Makefile.PL lib/Paranoid.pm lib/Paranoid/Process.pm
jawnsy-guest at users.alioth.debian.org
jawnsy-guest at users.alioth.debian.org
Fri May 14 01:08:24 UTC 2010
Author: jawnsy-guest
Date: Fri May 14 01:08:18 2010
New Revision: 57886
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=57886
Log:
[svn-upgrade] Integrating new upstream version, libparanoid-perl (0.26)
Modified:
branches/upstream/libparanoid-perl/current/CHANGELOG
branches/upstream/libparanoid-perl/current/META.yml
branches/upstream/libparanoid-perl/current/Makefile.PL
branches/upstream/libparanoid-perl/current/lib/Paranoid.pm
branches/upstream/libparanoid-perl/current/lib/Paranoid/Process.pm
Modified: branches/upstream/libparanoid-perl/current/CHANGELOG
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparanoid-perl/current/CHANGELOG?rev=57886&op=diff
==============================================================================
--- branches/upstream/libparanoid-perl/current/CHANGELOG (original)
+++ branches/upstream/libparanoid-perl/current/CHANGELOG Fri May 14 01:08:18 2010
@@ -1,4 +1,11 @@
CHANGELOG
+
+v0.26 (2010/05/08)
+==================
+--Changed daemonize's behavior: reopening STD* on /dev/null and chdir'ing
+ to /. Hindsight's 20/20, eh?
+--Made backup/restore of SIGCHLD in pcapture dependent upon an actual
+ sighandler being installed
v0.25 (2010/05/05)
==================
Modified: branches/upstream/libparanoid-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparanoid-perl/current/META.yml?rev=57886&op=diff
==============================================================================
--- branches/upstream/libparanoid-perl/current/META.yml (original)
+++ branches/upstream/libparanoid-perl/current/META.yml Fri May 14 01:08:18 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Paranoid
-version: 0.25
+version: 0.26
abstract: General function library for safer, more secure programming
author:
- Arthur Corliss <corliss at digitalmages.com>
@@ -13,8 +13,7 @@
Errno: 0
Fcntl: 0
File::Glob: 0
- Test::More: 0
- Test::Pod: 0
+ POSIX: 0
no_index:
directory:
- t
Modified: branches/upstream/libparanoid-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparanoid-perl/current/Makefile.PL?rev=57886&op=diff
==============================================================================
--- branches/upstream/libparanoid-perl/current/Makefile.PL (original)
+++ branches/upstream/libparanoid-perl/current/Makefile.PL Fri May 14 01:08:18 2010
@@ -30,8 +30,7 @@
'Errno' => 0,
'Fcntl' => 0,
'File::Glob' => 0,
- 'Test::Pod' => 0,
- 'Test::More' => 0,
+ 'POSIX' => 0,
},
($ExtUtils::MakeMaker::VERSION ge '6.30_00' ? (
LICENSE => 'perl',) : ()),
Modified: branches/upstream/libparanoid-perl/current/lib/Paranoid.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparanoid-perl/current/lib/Paranoid.pm?rev=57886&op=diff
==============================================================================
--- branches/upstream/libparanoid-perl/current/lib/Paranoid.pm (original)
+++ branches/upstream/libparanoid-perl/current/lib/Paranoid.pm Fri May 14 01:08:18 2010
@@ -2,7 +2,7 @@
#
# (c) 2005, Arthur Corliss <corliss at digitalmages.com>
#
-# $Id: Paranoid.pm,v 0.25 2010/05/05 00:20:17 acorliss Exp $
+# $Id: Paranoid.pm,v 0.26 2010/05/09 06:40:38 acorliss Exp $
#
# This software is licensed under the same terms as Perl, itself.
# Please see http://dev.perl.org/licenses/ for more information.
@@ -24,7 +24,7 @@
use vars qw($VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS);
use base qw(Exporter);
-($VERSION) = ( q$Revision: 0.25 $ =~ /(\d+(?:\.(\d+))+)/sm );
+($VERSION) = ( q$Revision: 0.26 $ =~ /(\d+(?:\.(\d+))+)/sm );
@EXPORT = qw(psecureEnv);
@EXPORT_OK = qw(psecureEnv);
@@ -98,7 +98,7 @@
=head1 VERSION
-$Id: Paranoid.pm,v 0.25 2010/05/05 00:20:17 acorliss Exp $
+$Id: Paranoid.pm,v 0.26 2010/05/09 06:40:38 acorliss Exp $
=head1 SYNOPSIS
Modified: branches/upstream/libparanoid-perl/current/lib/Paranoid/Process.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libparanoid-perl/current/lib/Paranoid/Process.pm?rev=57886&op=diff
==============================================================================
--- branches/upstream/libparanoid-perl/current/lib/Paranoid/Process.pm (original)
+++ branches/upstream/libparanoid-perl/current/lib/Paranoid/Process.pm Fri May 14 01:08:18 2010
@@ -2,7 +2,7 @@
#
# (c) 2005, Arthur Corliss <corliss at digitalmages.com>
#
-# $Id: Process.pm,v 0.99 2010/05/06 07:42:50 acorliss Exp $
+# $Id: Process.pm,v 0.101 2010/05/10 04:43:30 acorliss Exp $
#
# This software is licensed under the same terms as Perl, itself.
# Please see http://dev.perl.org/licenses/ for more information.
@@ -28,7 +28,7 @@
use POSIX qw(getuid setuid setgid WNOHANG setsid);
use Carp;
-($VERSION) = ( q$Revision: 0.99 $ =~ /(\d+(?:\.(\d+))+)/sm );
+($VERSION) = ( q$Revision: 0.101 $ =~ /(\d+(?:\.(\d+))+)/sm );
@EXPORT = qw(switchUser daemonize);
@EXPORT_OK = qw(MAXCHILDREN childrenCount installChldHandler
@@ -138,14 +138,15 @@
if ( defined $pid ) {
# Fork was successful, close parent file descriptors
- close STDIN;
- close STDOUT;
- close STDERR;
+ $rv = open(STDIN, '/dev/null') and open(STDOUT, '>/dev/null');
# Create a new process group
- setsid();
-
- $rv = 1;
+ unless ($rv) {
+ setsid();
+ $rv = open STDERR, '>&STDOUT';
+ die "Can't dup stdout: $!" unless $rv;
+ chdir '/';
+ }
} else {
Paranoid::ERROR =
@@ -355,8 +356,10 @@
$cmd = "( $cmd ) 2>&1";
# Backup SIGCHLD handler and set it to something safe
- $sigchld = $SIG{CHLD};
- $SIG{CHLD} = sub {1};
+ if ( defined $SIG{CHLD} ) {
+ $sigchld = $SIG{CHLD};
+ $SIG{CHLD} = sub {1};
+ }
# Execute and snarf the output
pdebug( 'executing command', PDLEVEL2 );
@@ -367,7 +370,7 @@
pdebug( "command exited with raw rv: $$cref", PDLEVEL2 );
# Restore SIGCHLD handler
- $SIG{CHLD} = $sigchld;
+ $SIG{CHLD} = $sigchld if defined $SIG{CHLD};
# Check the return value
if ( $$cref == -1 or $$cref == 32512 ) {
@@ -408,7 +411,7 @@
=head1 VERSION
-$Id: Process.pm,v 0.99 2010/05/06 07:42:50 acorliss Exp $
+$Id: Process.pm,v 0.101 2010/05/10 04:43:30 acorliss Exp $
=head1 SYNOPSIS
@@ -475,9 +478,10 @@
$rv = daemonize();
-This function forks a child who closes all STD* filehandles and starts a new
-process group. The parent exits cleanly. If the fork fails for any reason it
-returns a false value.
+This function forks a child who reopens all STD* filehandles on /dev/null and
+starts a new process group. The parent exits cleanly. If the fork fails for
+any reason it returns a false value. The child will also change its directory
+to B</>.
=head2 pfork
More information about the Pkg-perl-cvs-commits
mailing list