/opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/__pycache__/cli.cpython-311.pyc (5293B)
§
~Ë÷˜ŸGuÔã óŒ — d Z ddlZddlZddlZddlZddlZddlmZ ej e ¦ « Z
dZd„ ZdZ
d„ Zd„ Zd „ Zdd
„Zd„ ZdS )
z¤
CLI helper utilities for CageFS user commands.
Provides functions for:
- Re-entering CageFS environment
- Calling commands via proxyexec for privilege escalation
é N)Úclcagefsz/var/.cagefs/.cagefs.tokenc óÞ — t t d¦ « 5 } | ¦ « ¦ « cddd¦ « S # 1 swxY w Y dS # t t
f$ r Y dS w xY w)zv
Read the CageFS token from the token file.
Returns:
str: The CageFS token, or None if not found
ÚrN)ÚopenÚCAGEFS_TOKEN_PATHÚreadÚstripÚIOErrorÚOSError)Úfs úCopt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/cli.pyÚget_cagefs_tokenr sµ € ðÝ
Õ# SÑ
)Ô
)ð $¨QØ—6’6‘8”8—>’>Ñ#Ô#ð $ð $ð $ð $ñ $ô $ð $ð $ð $ð $ð $ð $øøøð $ð $ð $ð $ð $ð $øå•WÐð ð ð Øˆtˆtðøøøs3 ‚A —&A
½A Á
AÁA ÁAÁA ÁA,Á+A,ú/usr/sbin/proxyexecc óø — t j ¦ « } t j d| z ¦ « }| d¦ « r|dt d¦ « … }|t
k S # t t f$ r Y dS w xY w)zÐ
Verify that the parent process is the proxyexec daemon
by checking /proc/
/exe (kernel-controlled, not spoofable).
Returns:
bool: True if parent process is the proxyexec daemon
z/proc/%d/exez
(deleted)NF)ÚosÚgetppidÚreadlinkÚendswithÚlenÚPROXYEXEC_DAEMON_PATHr r
)ÚppidÚ
parent_exes r
Ú_is_parent_proxyexecr . sŠ € ðÝŒz‰|Œ|ˆÝ”[ °$Ñ!6Ñ7Ô7ˆ
à×Ò˜|Ñ,Ô,ð 9Ø#Ð$7¥c¨,Ñ&7Ô&7Ð%7Ð$7Ô8ˆJØÕ2Ò2Ð2øÝ•WÐð ð ð Øˆuˆuðøøøs ‚A!A$ Á$A9Á8A9c ó` — t j d¦ « €dS t ¦ « S )aG
Check if the script is running via proxyexec.
Verifies both that the PROXYEXEC_UID environment variable is set
and that the parent process is the proxyexec daemon binary.
This prevents spoofing via environment variable injection.
Returns:
bool: True if running via proxyexec, False otherwise
Ú
PROXYEXEC_UIDNF)r ÚenvironÚgetr © ó r
Úis_running_via_proxyexecr A s) € õ
„z‡~‚~�oÑ&Ô&Ð.؈uÝÑ!Ô!Ð!r c óØ — t ¦ « }|st d¦ « dS t j t j ¦ « ¦ « j }t j ¦ « }t t j
¦ « ¦ « }ddd||| |g|z }d|i}t j |t j t j t j |¬¦ « }| ¦ « |j S )a,
Call a command via proxyexec to execute with root privileges.
Args:
alias: The proxyexec command alias (e.g., "CAGEFSCTL_USER_SITE_ISOLATION_LIST")
args_list: Additional arguments to pass
Returns:
int: Exit code from the proxyexec command, or None on error
zFailed to read CageFS tokenNr z-czcagefs.sockÚCAGEFS_TOKEN©ÚstdoutÚstderrÚstdinÚenv)r ÚloggerÚerrorÚpwdÚgetpwuidr ÚgetuidÚpw_nameÚgetcwdÚstrÚgetpidÚ
subprocessÚPopenÚsysr$ r% r&