File: //lib/python3.6/site-packages/firewall/__pycache__/dbus_utils.cpython-36.pyc
3
gJ @ s d ddddddddd d
gZ ddlZddlZddlZdd
lmZ ddlmZ ejdk Z dd Z
dd Zdd Zdd Z
dd Zdd Zdd ZdddZdd Zddd Zdd
ZdS )command_of_pid
pid_of_sender
uid_of_senderuser_of_uidcontext_of_sendercommand_of_senderuser_of_senderdbus_to_pythondbus_signature%dbus_introspection_prepare_properties!dbus_introspection_add_properties N)minidom)log3c C sP y6t d| d}|j d jddj }W dQ R X W n tk
rJ dS X |S )z Get command for pid from /proc z/proc/%d/cmdlinerr N)open readlinesreplacestrip Exception)pidfcmd r /usr/lib/python3.6/dbus_utils.pyr % s &c C sD | j dd}tj|d}yt|j|}W n tk
r> dS X |S )zW Get pid from sender string using
org.freedesktop.DBus.GetConnectionUnixProcessID zorg.freedesktop.DBusz/org/freedesktop/DBusN)
get_objectdbus InterfaceintZGetConnectionUnixProcessID
ValueError)bussenderdbus_obj
dbus_ifacer r r r r . s c C sD | j dd}tj|d}yt|j|}W n tk
r> dS X |S )zV Get user id from sender string using
org.freedesktop.DBus.GetConnectionUnixUser zorg.freedesktop.DBusz/org/freedesktop/DBusN)r r r r ZGetConnectionUnixUserr! )r"