File: //usr/lib/python3.9/site-packages/ipapython/__pycache__/admintool.cpython-39.opt-1.pyc
a
�N(i6 � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ dZdZ
dZe�e�Zd d
� ZG dd� de�ZG d
d� d�ZdS )z�A common framework for command-line admin tools, e.g. install scripts
Handles common operations like option parsing and logging
� N)�osinfo)�version)�config)�standard_logging_setup� � c C s
ddl }ddl}z�|�|j�d��}|jdu r4W dS |�|j��|d�}t |�d }g }dt
| �v rn| �� }ndt
| �v r�| j}|D ]h}t
|dd �r�t
||j�} td|�D ]@}
|�||
|j�j�d
�}|| kr�|�||
td�t | �� q�q�W n t�y Y n0 dS )a� Takes option parser and generated options and scrubs sensitive arguments
from the global program arguments. Note that this only works for GNU GLIBC
as Python has no generic way to get access to the original argv values to
modify them in place.
The code assumes Python behavior, e.g. there are two additional args in the
list (/path/to/python -I ...) than what's passed as 'argv' here.
r N�cZ_dl_argvr �_get_all_options�_actionsZ sensitiveFzutf-8�X)�ctypesZctypes.utilZCDLL�utilZfind_library�_nameZPOINTERZc_voidpZin_dll�len�dirr r
�getattr�dest�range�castZc_char_p�value�decodeZmemset�ord� Exception)�
option_parser�options�argvr Z_cZ_argvZ_argcZall_options�opt�v�i�vi� r �7/usr/lib/python3.9/site-packages/ipapython/admintool.py�admin_cleanup_global_argv* s4
��"r"