404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.137.175.166: ~ $
3

e�$g+%�@s<ddlZddlZddlZddlZddlZddlZddlmZyddlm	Z	Wne
k
rdeZ	YnXddlm
Z
ddlmZddlmZddlmZddlmZdd	lmZdd
lmZdadZdd
�Zdd�Zdd�Zdd�Zdd�Zd'dd�Zd(dd�Zd)dd�ZGdd�de�Zdd �Z d!d"�Z!d#d$�Z"d%d&�Z#dS)*�N)�	rpcServer)�DictType)�rpclib)�
clientCaps)�config)�	rhnserver)�
up2dateErrors)�
up2dateLog)�up2dateUtilsz /var/spool/up2date/loginAuth.pklcCs@tj�}|d}tj|tj�s"dSt|d�}|j�}|j�|S)N�systemIdPath�r)r�initUp2dateConfig�os�access�R_OK�open�read�close)�cfg�path�f�ret�r�!/usr/lib/python3.6/up2dateAuth.py�getSystemIds
rc	Cs&tj�}ytjjt��ddd}Wn
dStj�}||k�r"tj	�}|j
jt�|�}|d}|d|jd��}t
j|t
j�s�yt
j|�Wn
dSt
j|t
j�s�dSt
j|t
j�r�|d}yt
j||�Wn
dSt|d�}|j|�|j�yt
j|tdd��WnYnXdS)	NrZ
os_releaser�/z.save�w�0600�)rr
r�	xmlrpclib�loadsrr
Z
getVersionr�	RhnServerZregistrationZupgrade_version�rfindrr�W_OK�mkdir�F_OK�renamer�writer�chmod�int)	r�idVerZ	systemVer�sZnewSystemIdr�dirZsavePathrrrr�maybeUpdateVersion*s>


r-cCs�tj�}|jd�ts$|jd�dStj�td�}tjjt�}tj	|tj
�s�y tj|�tj|t
dd��Wn|jd|�dSttd�}tjtt
d	d��tj||�|j�|d
ttd�}|jd|d
d
|d�dS)z�
    Pickle loginInfo to a file
    Returns:
    True    -- wrote loginInfo to a pickle file
    False   -- did _not_ write loginInfo to a pickle file
    zwriteCachedLogin() invokedz1writeCachedLogin() loginInfo is None, so bailing.F)�time�	loginInfoZ0700rz'Unable to write pickled loginInfo to %s�wbrr.zX-RHN-Auth-Expire-OffsetzWrote pickled loginInfo at z with expiration of z	 seconds.T)r	�initLog�	log_debugr/r.rr�dirname�pcklAuthFileNamerr#r$r(r)�log_mer�pickle�dumpr�float)�log�dataZpcklDir�pcklAuth�
expireTimerrr�writeCachedLoginTs.



r=c	CsTtj�}|jd�tjttj�s2|jdt�dSttd�}ytj	|�}Wn*t
tfk
rt|jd�|j�dSX|j�yLt
jjt��ddd}d|d	d
}||kr�|jd||f�dSWnYnX|d}|d	}tj�}|t|d
�}|jd|d|dt|d
��||k�r<|jd||f�dSt|�|jd|�dS)zb
    Read pickle info from a file
    Caches authorization info for connecting to the server.
    zreadCachedLogin invokedz'Unable to read pickled loginInfo at: %sF�rbzSUnexpected EOF. Probably an empty file,                        regenerate auth filerZ	system_idzID-%sr/zX-RHN-Server-Idz#system id version changed: %s vs %sr.zX-RHN-Auth-Expire-Offsetz(Checking pickled loginInfo, currentTime=z
, createTime=z, expire-offset=z9Pickled loginInfo has expired, created = %s, expire = %s.z<readCachedLogin(): using pickled loginInfo set to expire at T)r	r1r2rrr4rrr6�load�EOFError�
ValueErrorrrrr rr.r8�_updateLoginInfo)	r9r;r:r*ZcidVerZcreatedTime�liZcurrentTimer<rrr�readCachedLogintsH


rDcCs2t|�tkr*tt�tkr$tj|�q.|andadS)z,
    Update the global var, "loginInfo"
    N)�typerr/�update)rCrrrrB�s
rBFc	Cs�tj�}|jd|�|r,tr,t�r,tStj|d�}tjj	�}x|D]\}}|j
||�qHW|dkrnt�}|svdSt�|j
d�|jj|tj�t|��}|jj�t|�t�tr�|j
d�|jdt�tS)Nzlogin(forceUpdate=%s) invoked)�timeoutzlogging into up2date serverz?successfully retrieved authentication token from up2date serverz
logininfo:)r	r1r2r/rDrr!rZcapsZheaderFormatZ
add_headerrr-r5Zup2date�login�socketZgetfqdn�_get_panel_nameZcapabilitiesZvalidaterBr=)	ZsystemId�forceUpdaterGr9ZserverZ
headerlistZ
headerName�valuerCrrrrH�s.



rHcCs0tj�}|jd�td|d�ts,tjd��tS)NzupdateLoginInfo() login infoT)rKrGzUnable to authenticate)r	r1r5rHr/rZAuthenticationError)rGr9rrr�updateLoginInfo�s

rMcCs8ytaWntk
r daYnXtr*tSt|d�tS)N)rG)r/�	NameErrorrH)rGrrr�getLoginInfo�s

rOc@seZdZdS)�_FailedToGetPanelNameN)�__name__�
__module__�__qualname__rrrrrP�srPcCsLy
t�}Wn8tk
rBt�s8|jtj��|jd�t�}YnX|j�S)Nz?Failed to get panel name via cldetect, using fallback mechanism)	�_get_panel_name_via_cldetectrP�_is_cldeploy_runningZ
log_exception�sys�exc_infor5�_fallback_get_panel_name�lower)r9Z
panel_namerrrrJ�s

rJcCstd}d}d}tjj|�r8t|��}|j�j�}WdQRX|rpd|}tjj|�rpt|��}d|j�k}WdQRX|S)Nz/var/lock/cldeploy.lckFz/proc/%s/cmdlineZcldeploy)rr�existsrr�strip)Zlock_file_pathZcldeploy_running�pidrZpid_cmdline_pathrrrrU�s

rUcCsrddg\}}}tjj|�s(td|��tj|tjtjdd�}|j�\}}|jdkrjtddj	|�|f��|j
�S)	Nz/usr/bin/cldetectz--detect-cp-nameonlyz7Failed to obtain panel name because '%s' does not existT)�stdout�stderrZuniversal_newlinesrz:Failed to obtain panel name using '%s' command; stderr: %s� )rrrZrP�
subprocess�Popen�PIPEZcommunicate�
returncode�joinr[)Zbinary�_�cmdZprocessr]r^rrrrTs
rTcCsdtjjd�rdStjjd�r dStjjd�r0dStjjd�r@dStjjd	�rPd
Stjjd�r`dSd
S)Nz/usr/local/psa/admin/Zpleskz/usr/local/interworx/Z	interworxz#/usr/local/cpanel/whostmgr/docroot/Zcpanelz/usr/local/ispmgr/Zispmgrz/usr/local/directadmin/Zdirectadminz/usr/local/mgr5/sbin/mgrctlZispmgr5�unknown)rr�isdir�isfilerrrrrX"srX)NFN)N)N)$rr6rVr.rIr`Zup2date_clientr�typesr�ImportError�dictZrhnrrrrrr	r
r/r4rr-r=rDrBrHrMrO�	ExceptionrPrJrUrTrXrrrr�<module>s@
* ,
%






Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 113 B 0644
__init__.cpython-36.pyc File 113 B 0644
capabilities.cpython-36.opt-1.pyc File 5.28 KB 0644
capabilities.cpython-36.pyc File 5.34 KB 0644
cldetect.cpython-36.opt-1.pyc File 2.31 KB 0644
cldetect.cpython-36.pyc File 2.31 KB 0644
clientCaps.cpython-36.opt-1.pyc File 1.98 KB 0644
clientCaps.cpython-36.pyc File 1.98 KB 0644
clpwd.cpython-36.opt-1.pyc File 3.9 KB 0644
clpwd.cpython-36.pyc File 3.9 KB 0644
config.cpython-36.opt-1.pyc File 10.38 KB 0644
config.cpython-36.pyc File 10.38 KB 0644
debUtils.cpython-36.opt-1.pyc File 2.03 KB 0644
debUtils.cpython-36.pyc File 2.03 KB 0644
getMethod.cpython-36.opt-1.pyc File 2.25 KB 0644
getMethod.cpython-36.pyc File 2.25 KB 0644
haltree.cpython-36.opt-1.pyc File 3.07 KB 0644
haltree.cpython-36.pyc File 3.07 KB 0644
hardware.cpython-36.opt-1.pyc File 18.42 KB 0644
hardware.cpython-36.pyc File 18.42 KB 0644
hardware_gudev.cpython-36.opt-1.pyc File 7.69 KB 0644
hardware_gudev.cpython-36.pyc File 7.69 KB 0644
hardware_hal.cpython-36.opt-1.pyc File 6.73 KB 0644
hardware_hal.cpython-36.pyc File 6.73 KB 0644
hardware_udev.cpython-36.opt-1.pyc File 7.67 KB 0644
hardware_udev.cpython-36.pyc File 7.67 KB 0644
pkgUtils.cpython-36.opt-1.pyc File 269 B 0644
pkgUtils.cpython-36.pyc File 269 B 0644
pkgplatform.cpython-36.opt-1.pyc File 288 B 0644
pkgplatform.cpython-36.pyc File 288 B 0644
pmPlugin.cpython-36.opt-1.pyc File 2.45 KB 0644
pmPlugin.cpython-36.pyc File 2.45 KB 0644
rhnChannel.cpython-36.opt-1.pyc File 4.39 KB 0644
rhnChannel.cpython-36.pyc File 4.39 KB 0644
rhnHardware.cpython-36.opt-1.pyc File 468 B 0644
rhnHardware.cpython-36.pyc File 468 B 0644
rhnPackageInfo.cpython-36.opt-1.pyc File 1.9 KB 0644
rhnPackageInfo.cpython-36.pyc File 1.9 KB 0644
rhncli.cpython-36.opt-1.pyc File 7.17 KB 0644
rhncli.cpython-36.pyc File 7.17 KB 0644
rhnreg.cpython-36.opt-1.pyc File 27 KB 0644
rhnreg.cpython-36.pyc File 27.25 KB 0644
rhnreg_constants.cpython-36.opt-1.pyc File 13.69 KB 0644
rhnreg_constants.cpython-36.pyc File 13.69 KB 0644
rhnserver.cpython-36.opt-1.pyc File 4.6 KB 0644
rhnserver.cpython-36.pyc File 4.6 KB 0644
rpcServer.cpython-36.opt-1.pyc File 7.27 KB 0644
rpcServer.cpython-36.pyc File 7.27 KB 0644
rpmUtils.cpython-36.opt-1.pyc File 3.11 KB 0644
rpmUtils.cpython-36.pyc File 3.11 KB 0644
transaction.cpython-36.opt-1.pyc File 2.59 KB 0644
transaction.cpython-36.pyc File 2.59 KB 0644
tui.cpython-36.opt-1.pyc File 31.25 KB 0644
tui.cpython-36.pyc File 31.25 KB 0644
up2dateAuth.cpython-36.opt-1.pyc File 7.07 KB 0644
up2dateAuth.cpython-36.pyc File 7.07 KB 0644
up2dateErrors.cpython-36.opt-1.pyc File 13.32 KB 0644
up2dateErrors.cpython-36.pyc File 13.32 KB 0644
up2dateLog.cpython-36.opt-1.pyc File 2.48 KB 0644
up2dateLog.cpython-36.pyc File 2.48 KB 0644
up2dateUtils.cpython-36.opt-1.pyc File 4.06 KB 0644
up2dateUtils.cpython-36.pyc File 4.06 KB 0644