Paranoid(3pm)
π Paranoid π
okay bestie, buckle up β this is the Paranoid manual page, straight out of the Perl user-contributed docs. it's giving β¨security blanket for your Perl programsβ¨ and i'm obsessed. let's get into it π«Ά
π VERSION π
$Id: lib/Paranoid.pm, 2.10 2022/03/08 00:01:04 acorliss $
like, that's the version string, exactly as it is. no notes π
β¨ SYNOPSIS β¨
use Paranoid;
$errMsg = Paranoid::ERROR;
psecureEnv("/bin:/usr/bin");
sub foo {
# this function can return '0' as a valid return value
# that should be construed as a boolean true value
return PTRUE_ZERO;
}
literally just copy that energy into your program and you're set πΈ
π DESCRIPTION π
okay so this whole collection of modules started out as, like, modules that do things in a (debatably π) safer and taint-safe way. and since then it's also grown to include functionality that fits into the same framework and conventions as the original modules β including keeping the debug hooks for command-line debugging. periodt. π
all the modules listed below are meant to be used directly in your programs, if you need the functionality they provide. no middleman, no cap.
this module itself gives you exactly one function that's meant to secure your environment enough to satisfy taint-enabled programs, plus it works as a container that holds the last reported error from any code in the Paranoid framework. two jobs, both iconic π
π¦ IMPORT LISTS π¦
by default this module exports this symbol:
psecureEnv
and the following specialized import lists also exist, bestie:
List Members
--------------------------------------------------------
all @defaults PTRUE_ZERO
π§ SUBROUTINES/METHODS π§
psecureEnv
psecureEnv("/bin:/usr/bin");
this function deletes some of the dangerous environment variables that can be used to subvert perl when it's being run in setuid applications π like, actual sabotage potential. it also sets the path β either to the argument you pass it (if you pass one) or to a default of "/bin:/sbin:/usr/bin:/usr/sbin".
NOTE: they did explicitly exclude/usr/localdirectories from that default path, and here's the tea β:/usr/localis often where admins stash random scripts and programs that may not have undergone any serious scrutiny and review for security issues. only the base OS directories are presumed as safe, and honestly even that may be stretching the truth as it is π you can override the defaults as desired, though. your call, bestie.
Paranoid::ERROR
$errMsg = Paranoid::ERROR;
Paranoid::ERROR = $errMsg;
this is an lvalue function β she's not exported, so you have to reference her via the Paranoid namespace. no shortcuts π
PTRUE_ZERO
this is a constant that evaluates to '0 but true', which is the whole slay β it lets 0 be passed for boolean true use-cases. the way that 0 can just be true... iconic. β¨
π TAINT NOTES π
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 de-tainted 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
π¦ DEPENDENCIES π¦
okay so 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. iykyk π
π SEE ALSO π
the following modules are available for use. you should check their POD for specifics on use:
Paranoid::Args: Command-line argument parsing functionsParanoid::Data: Misc. data manipulation functionsParanoid::Data::AVLTree: AVL-Balanced Tree ClassParanoid::Data::AVLTree::AVLNode: AVL-Balanced Tree Node ClassParanoid::Debug: Command-line debugging framework and functionsParanoid::Filesystem: Filesystem operation functionsParanoid::Glob: Paranoid Glob objectsParanoid::IO: File I/O wrappers forsysopen, etc.Paranoid::IO::FileMultiplexer: File Multiplexer ObjectParanoid::IO::FileMultiplexer::Block: Block-level Allocator/AccessorParanoid::IO::FileMultiplexer::Block::BATHeader: BAT Header BlockParanoid::IO::FileMultiplexer::Block::FileHeader: File Header BlockParanoid::IO::FileMultiplexer::Block::StreamHeader: Stream Header BlockParanoid::IO::Line: I/O functions for working with line-based filesParanoid::IO::Lockfile: I/O functions for working with lock filesParanoid::Input: Input-related functions (file reading, detainting)Paranoid::Log: Unified logging framework and functionsParanoid::Log::Buffer: Buffered-based logging mechanismParanoid::Log::File: File-based logging mechanismParanoid::Module: Run-time module loading functionsParanoid::Network: Network-related functionsParanoid::Network::IPv4: General IPv4-related functionsParanoid::Network::IPv6: General IPv6-related functionsParanoid::Network::Socket: Wrapper module for Socket & Socket6Paranoid::Process: Process management functions
π BUGS AND LIMITATIONS π
not me... this section is literally empty. the audacity π nothing listed, nothing to warn you about here, bestie.
πΈ AUTHOR πΈ
Arthur Corliss (corliss@digitalmages.com)
π LICENSE AND COPYRIGHT π
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. π so like, describe it, don't claim it, got it? π«Ά
(c) 2005 - 2020, Arthur Corliss (corliss@digitalmages.com) (tm) 2008 - 2020, Paranoid Inc. (www.paranoid.com)
and that's the whole page, bestie!! this was generated by perl v5.38.2 and dated 2024-03-07 β go forth and be safe out there πβ¨ππ·π¦
π¦ where this page comes from
- debian trixie: libparanoid-perl 2.10-2 Β· other
- ubuntu resolute: libparanoid-perl 2.10-2 Β· other
- ubuntu stonking: libparanoid-perl 2.10-2 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms