PRIV_WRAPPER(1)
π priv_wrapper β the NAME section β¨
okay so bestie, welcome to the manual page for priv_wrapper, section 1 of the manual, and it's literally a library whose whole job is to disable resource limits and other priviledge dropping. that's the vibe. that's the mission. π«Ά
πΈ SYNOPSIS πΈ
like, here's how you summon it:
LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1
[PRIV_WRAPPER_CHROOT_DISABLE=1] [PRIV_WRAPPER_PRCTL_DISABLE=<options>]
[PRIV_WRAPPER_SETRLIMIT_DISABLE=<options>]
the brackets are the optional besties, they can come or not, no pressure π
π¦ DESCRIPTION π¦
so priv_wrapper is here to help you run processes that are dropping privileges or restricting resources in test environments. it can disable the chroot, prctl, pledge and setrlmit system calls, no cap.
and here's the iconic part: a disabled call always succeeds β like, it returns 0 β and it does absolutely nothing. it's giving "yes queen, everything went great" while literally doing zero things. π
one tiny caveat bestie: the pledge system call exists only on OpenBSD. iykyk. π§
π ENVIRONMENT VARIABLES π
these are the little switches that make it go. set them in your env and watch the magic.
PRIV_WRAPPER
setting this to 1 is what activates priv_wrapper. that's the on switch bestie, nothing happens without it.
PRIV_WRAPPER_DISABLE_DEEPBIND
this one lets you turn off deep binding inside priv_wrapper. super useful if you're running valgrind tools or sanitizers like (address, undefined, thread) and they're being dramatic about it. π
PRIV_WRAPPER_CHROOT_DISABLE
set this to 1 and the chroot() system call gets disabled. bye bye jail, hello freedom β¨
PRIV_WRAPPER_PRCTL_DISABLE
you can disable prctl calls with this. two ways, pick your fighter:
- disable literally all of them with
PRIV_WRAPPER_PRCTL_DISABLE=ALL - or pick special options, like
PRIV_WRAPPER_PRCTL_DISABLE=PR_SET_SECCOMP|PR_SET_NO_NEW_PRIVS
the supported options are:
PR_SET_SECCOMPPR_SET_NO_NEW_PRIVSPR_SET_DUMPABLE
PRIV_WRAPPER_SETRLIMIT_DISABLE
same energy, but for resource limits. either go all in with PRIV_WRAPPER_SETRLIMIT_DISABLE=ALL, or pick the specific resources you want gone, like:
PRIV_WRAPPER_SETRLIMIT_DISABLE=RLIMIT_STACK|RLIMIT_CORE
the supported options are:
RLIMIT_CPURLIMIT_FSIZERLIMIT_DATARLIMIT_STACKRLIMIT_CORERLIMIT_RSSRLIMIT_NOFILERLIMIT_ASRLIMIT_NPROCRLIMIT_MEMLOCKRLIMIT_LOCKSRLIMIT_SIGPENDINGRLIMIT_MSGQUEUERLIMIT_NICERLIMIT_RTPRIORLIMIT_RTTIMERLIMIT_NLIMITS
PRIV_WRAPPER_PLEDGE_DISABLE
set this to 1 and the pledge() system call gets disabled. (remember bestie, pledge is OpenBSD-only π¦)
PRIV_WRAPPER_DEBUGLEVEL
if you need to see what's going on inside priv_wrapper itself, or you're hunting down a bug, you can enable logging support β that works if you built it with debug symbols. the levels go like this:
0= ERROR1= WARNING2= DEBUG3= TRACE
β¨ EXAMPLE β¨
here's the main character moment, two whole recipes:
LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1
PRIV_WRAPPER_PRCTL_DISABLE="PR_SET_SECCOMP|PR_SET_NO_NEW_PRIVS"
LD_PRELOAD=libpriv_wrapper.so PRIV_WRAPPER=1
PRIV_WRAPPER_CHROOT_DISABLE=1 PRIV_WRAPPER_PRCTL_DISABLE=ALL
PRIV_WRAPPER_SETRLIMIT_DISABLE="RLIMIT_CPU|RLIMIT_DATA|RLIMIT_NLIMITS"
copy, paste, slay. π
π AUTHOR π
Samba Team β that's the icon, the legend, the moment. periodt. π«Ά
and that's the whole page bestie!! this one's from the PRIV_WRAPPER(1) manual, section 1, dated 2022-09-14. go forth and disable some privilege dropping, you absolute legend πβ¨π
π¦ where this page comes from
- fedora 43: priv_wrapper 1.0.1-10.fc43 Β· GPL-3.0-or-later
- fedora 43: priv_wrapper 1.0.1-10.fc43 Β· GPL-3.0-or-later
- fedora 44: priv_wrapper 1.0.1-11.fc44 Β· GPL-3.0-or-later
- fedora 44: priv_wrapper 1.0.1-11.fc44 Β· GPL-3.0-or-later
- opensuse-leap 16.0: priv_wrapper 1.0.1-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: priv_wrapper 1.0.1-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: priv_wrapper 1.0.1-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: priv_wrapper 1.0.1-bp160.1.12 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms