//sbin UP
#!/opt/cloudlinux/venv/bin/python3 -sbb
# -*- coding: utf-8 -*-
#
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2025 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# https://cloudlinux.com/docs/LICENCE.TXT
#
"""
Execute a command inside CageFS for a site (document root or domain).
This wrapper provides a command-line interface for executing commands within
the isolated CageFS environment for a specific website.
"""
import argparse
import os
import sys
from clcagefslib.webisolation import libenter
def create_parser():
"""
Create argument parser for cagefs_enter_site.
Returns:
argparse.ArgumentParser: Configured argument parser
"""
parser = argparse.ArgumentParser(
# the command is named with _underscores_ to match
# existing cagefs_enter wrapper from lvewrappers
prog="cagefs_enter_site",
description="Execute a command inside CageFS for a site (document root or domain)",
)
parser.add_argument("site", type=str, help="Document root or domain")
parser.add_argument(
"command", type=str, nargs=argparse.REMAINDER, help="Command to execute"
)
return parser
def main():
"""
Main entry point.
Returns:
int: Exit code
"""
parser = create_parser()
args = parser.parse_args()
if not args.command:
parser.error("COMMAND is required")
try:
return libenter.enter_site(args.site, args.command)
except ValueError as e:
print(f"Error: {e}", file=sys.stderr)
return 1
except KeyboardInterrupt:
# Clean Ctrl+C exit without traceback (exit code 130 = SIGINT).
return 130
if __name__ == "__main__":
if os.geteuid() == 0:
print("Error: This program can not be run as root", file=sys.stderr)
sys.exit(1)
sys.exit(main())
| cagefs_enter_site | 1877 | V |
| cagefsctl-user | 13203 | V |
| chroot | 42448 | V |
| consoletype | 12160 | V |
| cracklib-check | 13360 | V |
| cracklib-format | 251 | V |
| cracklib-packer | 13368 | V |
| cracklib-unpacker | 9248 | V |
| create-cracklib-dict | 990 | V |
| ddns-confgen | 20944 | V |
| dnssec-checkds | 936 | V |
| dnssec-coverage | 938 | V |
| dnssec-dsfromkey | 62304 | V |
| dnssec-importkey | 62304 | V |
| dnssec-keyfromlabel | 66312 | V |
| dnssec-keygen | 74592 | V |
| dnssec-keymgr | 934 | V |
| dnssec-revoke | 58104 | V |
| dnssec-settime | 62296 | V |
| dnssec-signzone | 120016 | V |
| dnssec-verify | 54112 | V |
| exim | 1280 | V |
| faillock | 21016 | V |
| genrandom | 12672 | V |
| hsendmail | 7510347 | V |
| ip | 709944 | V |
| isc-hmac-fixup | 12136 | V |
| ldconfig | 1009752 | V |
| lvdctl | 5555 | V |
| mkhomedir_helper | 25024 | V |
| named-checkzone | 37512 | V |
| named-compilezone | 37512 | V |
| nsec3hash | 12584 | V |
| pam_console_apply | 46280 | V |
| pam_timestamp_check | 12152 | V |
| pluginviewer | 21064 | V |
| proxyexec | 21680 | V |
| pwhistory_helper | 20928 | V |
| saslauthd | 96688 | V |
| sasldblistusers2 | 21264 | V |
| saslpasswd2 | 16816 | V |
| sendmail | 7510347 | V |
| sendmail.bak | 1048 | V |
| sendmail.exim | 1280 | V |
| testsaslauthd | 17056 | V |
| tmpwatch | 36320 | V |
| tsig-keygen | 20944 | V |
| unix_chkpwd | 37744 | V |
| unix_update | 37744 | V |