HEX
Server: LiteSpeed
System: Linux shams.tasjeel.ae 5.14.0-611.5.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 08:09:09 EST 2025 x86_64
User: infowars (1469)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //usr/lib/python3.9/site-packages/ipapython/__pycache__/kernel_keyring.cpython-39.opt-1.pyc
a

}�f'�@s�ddlmZddlZddlmZddlmZddlmZdZ	dZ
dd	�Zd
d�Zdd
�Z
ddd�Zdd�Zdd�Zdd�Zdd�Zdd�ZdS)�)�absolute_importN)�run)�paths)�tasksz@s�usercCsttjdtgddd�}|jS)z
    Dump all keys
    �listFT��
raiseonerrZcapture_output)rr�KEYCTL�KEYRING�output)�result�r�</usr/lib/python3.9/site-packages/ipapython/kernel_keyring.py�	dump_keys(s�rcCs6ttjdtt|gddd�}|jr,td|��|j��S)zv
    One cannot request a key based on the description it was created with
    so find the one we're looking for.
    �searchFTrzkey %s not found)	rrr
r�KEYTYPE�
returncode�
ValueError�
raw_output�rstrip��keyr
rrr�get_real_key1s�rcCs4ttjdt|gddd�}|jr*td|��|j��S)z�
    Fetches the value of a persistent key from storage, trimming trailing
    any tailing whitespace.

    Assert when key is not a string-type.
    Zget_persistentFTrzpersistent key %s not found)rrr
rrrrrrrrr�get_persistent_key>s�rTcCsF|rt��durdSt��}ztt|��Wnty@YdS0dS)z�Returns True if the kernel persistent keyring is supported.

    If check_container is True and a containerized environment is detected,
    return False. There is no support for keyring namespace isolation yet.
    NFT)rZdetect_container�os�geteuidr�strr)Zcheck_container�uidrrr�is_persistent_keyring_supportedMsrcCs(zt|�WdSty"YdS0dS)zC
    Returns True/False whether the key exists in the keyring.
    TFN)rr)rrrr�has_key^s
r cCs8t|�}ttjd|gddd�}|jr2td|j��|jS)z�
    Read the keyring and return the value for key.

    Use pipe instead of print here to ensure we always get the raw data.
    �pipeFTrzkeyctl pipe failed: %s)rrrr
rr�	error_logr�r�real_keyr
rrr�read_keyjs�r%cCsJt|�r<t|�}ttjd|g|dd�}|jrFtd|j��n
t||�dS)zK
    Update the keyring data. If they key doesn't exist it is created.
    ZpupdateF��stdinr	zkeyctl pupdate failed: %sN)	r rrrr
rrr"�add_key)r�valuer$r
rrr�
update_keyzs�r*cCsFt|�rtd|��ttjdt|tg|dd�}|jrBtd|j��dS)z*
    Add a key to the kernel keyring.
    zkey %s already existsZpaddFr&zkeyctl padd failed: %sN)	r rrrr
rrrr")rr)r
rrrr(�s�r(cCs6t|�}ttjd|tgdd�}|jr2td|j��dS)z'
    Remove a key from the keyring
    �unlinkF)r	zkeyctl unlink failed: %sN)rrrr
rrrr"r#rrr�del_key�s�r,)T)Z
__future__rrZipapython.ipautilrZipaplatform.pathsrZipaplatform.tasksrrrrrrrr r%r*r(r,rrrr�<module>s