ACIL FM
Dark
Refresh
Current DIR:
/usr/lib/python3.9/site-packages/tuned/utils
/
usr
lib
python3.9
site-packages
tuned
utils
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
__pycache__
-
chmod
Open
Rename
Delete
class_loader.py
1.78 MB
chmod
View
DL
Edit
Rename
Delete
commands.py
16.84 MB
chmod
View
DL
Edit
Rename
Delete
config_parser.py
1.53 MB
chmod
View
DL
Edit
Rename
Delete
global_config.py
3.48 MB
chmod
View
DL
Edit
Rename
Delete
nettool.py
5.57 MB
chmod
View
DL
Edit
Rename
Delete
polkit.py
1.4 MB
chmod
View
DL
Edit
Rename
Delete
profile_recommender.py
5.81 MB
chmod
View
DL
Edit
Rename
Delete
__init__.py
0 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /usr/lib/python3.9/site-packages/tuned/utils/polkit.py
import dbus import tuned.logs log = tuned.logs.get() class polkit(): def __init__(self): self._bus = dbus.SystemBus() self._proxy = self._bus.get_object('org.freedesktop.PolicyKit1', '/org/freedesktop/PolicyKit1/Authority', follow_name_owner_changes = True) self._authority = dbus.Interface(self._proxy, dbus_interface='org.freedesktop.PolicyKit1.Authority') def check_authorization(self, sender, action_id): """Check authorization, return codes: 1 - authorized 2 - polkit error, but authorized with fallback method 0 - unauthorized -1 - polkit error and unauthorized by the fallback method -2 - polkit error and unable to use the fallback method """ if sender is None or action_id is None: return False details = {} flags = 1 # AllowUserInteraction flag cancellation_id = "" # No cancellation id subject = ("system-bus-name", {"name" : sender}) try: ret = self._authority.CheckAuthorization(subject, action_id, details, flags, cancellation_id)[0] except (dbus.exceptions.DBusException, ValueError) as e: log.error("error querying polkit: %s" % e) # No polkit or polkit error, fallback to always allow root try: uid = self._bus.get_unix_user(sender) except dbus.exceptions.DBusException as e: log.error("error using fallback authorization method: %s" % e) return -2 if uid == 0: return 2 else: return -1 return 1 if ret else 0
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply