[ Th3_Err0r Bypassed ]




Upload:

Command:

liwaavux@216.73.216.140: ~ $
# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2024 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
import functools
import grp

import secureio
from clcommon import ClPwd

from .const import BASEDIR
from .exceptions import UserNotFoundError


def get_user_prefix(username) -> str:
    base = 100
    try:
        uid = secureio.clpwd.get_uid(username)
    except ClPwd.NoSuchUserException:
        raise UserNotFoundError(username)
    b = uid % base
    prefix = "%02d" % b
    return prefix


def get_var_cagefs_prefixed(username):
    prefix = get_user_prefix(username)
    return f"{BASEDIR}/{prefix}"


def get_user_var_cagefs_path(username):
    return f"{get_var_cagefs_prefixed(username)}/{username}/"


@functools.cache
def get_linksafe_gid() -> int | None:
    try:
        return grp.getgrnam('linksafe').gr_gid
    except KeyError:
        return None


def user_exists(user):
    return user in secureio.clpwd.get_user_dict()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
selector Folder 0755
webisolation Folder 0755
__init__.py File 180 B 0644
cli.py File 3.58 KB 0644
const.py File 936 B 0644
domain.py File 21.1 KB 0755
exceptions.py File 402 B 0644
fs.py File 1020 B 0644
io.py File 2.68 KB 0644