Skip to main content

Binding for the OpenBSD pledge(2) system call

Project description

def pledge(promises: Optional[Iterable[str]] = None,
           execpromises: Optional[Iterable[str]] = None) -> None: ...

Throws OSError if the platform does not support pledge(2) or if the pledge fails.


The following will restrict the current process to only the stdio and tty promises, and then attempt to violate that restriction:

import pypledge
pypledge.pledge(['stdio', 'tty'])
f = open('foo.txt')

On OpenBSD 5.9, this will terminate with SIGABRT because the rpath promise was required.

On other platforms, this will throw OSError.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pypledge, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size pypledge-0.3.1.tar.gz (2.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page