REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.72 KB
Close
/proc/thread-self/root/opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/webisolation/jail_config.py
Text
Base64
# -*- coding: utf-8 -*- # # Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2021 All Rights Reserved # # Licensed under CLOUD LINUX LICENSE AGREEMENT # http://cloudlinux.com/docs/LICENCE.TXT # import typing from dataclasses import dataclass, field if typing.TYPE_CHECKING: from .mount_config import IsolatedRootConfig from .mount_types import MountEntry, MountType @dataclass class MountConfig: """ Builds mount configuration for jail.c implementation. Accumulates MountEntry objects, then renders everything at the end. """ uid: int gid: int _mounts: list[MountEntry] = field(default_factory=list, repr=False) @property def _default_opts(self) -> tuple[str, ...]: return f"uid={self.uid}", f"gid={self.gid}", "mode=0750" @property def mounts(self) -> tuple[MountEntry, ...]: """Read-only access to accumulated mount entries.""" return tuple(self._mounts) def add(self, type_: MountType, source: str, target: str = "", options: tuple[str] = tuple()): """Add a single mount entry.""" self._mounts.append( MountEntry( type=type_, source=source, target=target, options=options, ) ) def comment(self, text: str): """Add a comment line for organization.""" self._mounts.append(MountEntry(MountType.COMMENT, text)) def add_overlay(self, overlay: "IsolatedRootConfig"): """ Add mount operations for a directory overlay. Args: overlay: The overlay configuration """ if not overlay.persistent: # Create temporary in-memory storage self._mounts.append( MountEntry( MountType.BIND, "tmpfs", overlay.root_path, ("mkdir",) + self._default_opts ) ) else: # Persistent real directory storage (bind to self with mkdir) self._mounts.append( MountEntry( MountType.BIND, overlay.root_path, overlay.root_path, ("mkdir",) + self._default_opts, ) ) def close_overlay(self, overlay: "IsolatedRootConfig"): """Add the final mount that closes an overlay.""" self._mounts.extend(overlay.mounts) self._mounts.append( MountEntry(MountType.BIND, overlay.root_path, overlay.target, ("recursive",)) ) def render(self, docroot: str) -> str: """Render complete configuration to jail.c syntax.""" lines = [f"[{docroot}]"] lines.extend(m.render() for m in self._mounts) return "\n".join(lines)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 2 × Files: 13
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
crontab
DIR
-
drwxr-xr-x
2026-06-23 06:30:29
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__pycache__
DIR
-
drwxr-xr-x
2026-06-23 06:30:29
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
admin_config.py
3.07 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
config.py
1.74 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jail_config.py
2.72 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jail_config_builder.py
7.21 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
jail_utils.py
5.58 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
libenter.py
2.36 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mount_config.py
1.38 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mount_ordering.py
4.96 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
mount_types.py
1.26 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
php.py
3.39 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
service.py
1.76 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
triggers.py
1.90 KB
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
__init__.py
248 B
lrw-r--r--
2026-05-29 09:37:55
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).