Paranoid - Paranoia support for safer programs
$Id: lib/Paranoid.pm, 2.08 2020/12/31 12:10:06 acorliss Exp $
use Paranoid; $errMsg = Paranoid::ERROR; psecureEnv("/bin:/usr/bin");
This collection of modules started out as modules which perform things (debatably) in a safer and taint-safe manner. Since then it's also grown to include functionality that fit into the same framework and conventions of the original modules, including keeping the debug hooks for command-line debugging.
All the modules below are intended to be used directly in your programs if you need the functionality they provide.
This module does provide one function meant to secure your environment enough to satisfy taint-enabled programs, and as a container which holds the last reported error from any code in the Paranoid framework.
This module exports the following symbols by default:
psecureEnv
The following specialized import lists also exist:
List Members -------------------------------------------------------- all @defaults PTRUE_ZERO
psecureEnv("/bin:/usr/bin");
This function deletes some of the dangerous environment variables that can be used to subvert perl when being run in setuid applications. It also sets the path, either to the passed argument (if passed) or a default of "/bin:/usr/bin".
$errMsg = Paranoid::ERROR; Paranoid::ERROR = $errMsg;
This lvalue function is not exported and must be referenced via the Paranoid namespace.
Taint-mode programming can be somewhat of an adventure until you know all the places considered dangerous under perl's taint mode. The following functions should generally have their arguments detainted before using:
exec system open glob unlink mkdir chdir rmdir chown chmod umask utime link symlink kill eval truncate ioctl fcntl chroot setpgrp setpriority syscall socket socketpair bind connect
While this module itself doesn't have any external dependencies various child modules do. Please check their documentation for any particulars should you use them.
The following modules are available for use. You should check their POD for specifics on use:
Paranoid::Args: Command-line argument parsing functions
Paranoid::Data: Misc. data manipulation functions
Paranoid::Data::AVLTree: AVL-Balanced Tree Class
Paranoid::Data::AVLTree::AVLNode: AVL-Balanced Tree Node Class
Paranoid::Debug: Command-line debugging framework and functions
Paranoid::Filesystem: Filesystem operation functions
Paranoid::Glob: Paranoid Glob objects
Paranoid::IO: File I/O wrappers for sysopen, etc.
Paranoid::IO::Line: I/O functions for working with line-based files
Paranoid::IO::Lockfile: I/O functions for working with lock files
Paranoid::Input: Input-related functions (file reading, detainting)
Paranoid::Log: Unified logging framework and functions
Paranoid::Log::Buffer: Buffered-based logging mechanism
Paranoid::Log::File: File-based logging mechanism
Paranoid::Module: Run-time module loading functions
Paranoid::Network: Network-related functions
Paranoid::Network::IPv4: General IPv4-related functions
Paranoid::Network::IPv6: General IPv6-related functions
Paranoid::Network::Socket: Wrapper module for Socket & Socket6
Paranoid::Process: Process management functions
Arthur Corliss (corliss@digitalmages.com)
This software is free software. Similar to Perl, you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License <https://www.gnu.org/licenses/gpl-1.0.html> as published by the Free Software Foundation <http://www.fsf.org/>; either version 1 <https://www.gnu.org/licenses/gpl-1.0.html>, or any later version <https://www.gnu.org/licenses/license-list.html#GNUGPL>, or b) the Artistic License 2.0 <https://opensource.org/licenses/Artistic-2.0>,
subject to the following additional term: No trademark rights to "Paranoid" have been or are conveyed under any of the above licenses. However, "Paranoid" may be used fairly to describe this unmodified software, in good faith, but not as a trademark.
(c) 2005 - 2020, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2020, Paranoid Inc. (www.paranoid.com)
To install Paranoid, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Paranoid
CPAN shell
perl -MCPAN -e shell install Paranoid
For more information on module installation, please visit the detailed CPAN module installation guide.