OpenBSD::Pledge(3p) Perl Programmers Reference Guide OpenBSD::Pledge(3p)

OpenBSD::Pledge(3p) Perl Programmers Reference Guide OpenBSD::Pledge(3p) #

OpenBSD::Pledge(3p) Perl Programmers Reference Guide OpenBSD::Pledge(3p)

NNAAMMEE #

 OpenBSD::Pledge - Perl interface to OpenBSD pledge(2)

SSYYNNOOPPSSIISS #

   use OpenBSD::Pledge;

   my $file = "/usr/share/dict/words";
   pledge( qw( rpath ) ) || die "Unable to pledge: $!";
   open my $fh, '<', $file or die "Unable to open $file: $!";

   pledge() || die "Unable to pledge again: $!";
   print grep { /pledge/i } readline($fh);
   close $fh;

DDEESSCCRRIIPPTTIIOONN #

 This module provides a perl interface to OpenBSD's pplleeddggee(2) ssyyssccaallll(2).

 Once you promise that your program will only use certain syscalls the
 kernel will kill the program if it attempts to call any other interfaces.

EEXXPPOORRTT #

 Exports "pledge" by default.

FFUUNNCCTTIIOONNSS #

pplleeddggee Perl interface to pplleeddggee(2).

         pledge(@promises)

 The "stdio" promise is always implied, as ppeerrll(1) itself is useless
 without it.

 Returns true on success, returns false and sets $! on failure

BBUUGGSS AANNDD LLIIMMIITTAATTIIOONNSS #

 Perl is particularly fond of "stdio" so that promise is always added by
 "pledge".

SSEEEE AALLSSOO #

 pplleeddggee(2)

 <http://man.openbsd.org/pledge.2>

AAUUTTHHOORR #

 Andrew Hewus Fresh, <afresh1@OpenBSD.org>

LLIICCEENNSSEE AANNDD CCOOPPYYRRIIGGHHTT #

 Copyright (C) 2015,2021 by Andrew Hewus Fresh <afresh1@OpenBSD.org>

 Permission to use, copy, modify, and distribute this software for any
 purpose with or without fee is hereby granted, provided that the above
 copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES #

WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF #

MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR #

ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES #

WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN #

ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF #

OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #

perl v5.36.3 2021-06-10 OpenBSD::Pledge(3p)