403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/modules/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/modules/__pycache__/find.cpython-311.opt-1.pyc
�

���c�J����ddlmZmZmZeZdZdZdZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlmZmZddlmZdd	�Zd
�Zd�Zdd�Zd
�Zd�Zd�Zedkre��dSdS)�)�absolute_import�division�print_functiona3
---
module: find
author: Brian Coca (@bcoca)
version_added: "2.0"
short_description: Return a list of files based on specific criteria
description:
    - Return a list of files based on specific criteria. Multiple criteria are AND'd together.
    - For Windows targets, use the M(ansible.windows.win_find) module instead.
options:
    age:
        description:
            - Select files whose age is equal to or greater than the specified time.
            - Use a negative age to find files equal to or less than the specified time.
            - You can choose seconds, minutes, hours, days, or weeks by specifying the
              first letter of any of those words (e.g., "1w").
        type: str
    patterns:
        default: []
        description:
            - One or more (shell or regex) patterns, which type is controlled by C(use_regex) option.
            - The patterns restrict the list of files to be returned to those whose basenames match at
              least one of the patterns specified. Multiple patterns can be specified using a list.
            - The pattern is matched against the file base name, excluding the directory.
            - When using regexen, the pattern MUST match the ENTIRE file name, not just parts of it. So
              if you are looking to match all files ending in .default, you'd need to use C(.*\.default)
              as a regexp and not just C(\.default).
            - This parameter expects a list, which can be either comma separated or YAML. If any of the
              patterns contain a comma, make sure to put them in a list to avoid splitting the patterns
              in undesirable ways.
            - Defaults to C(*) when I(use_regex=False), or C(.*) when I(use_regex=True).
        type: list
        aliases: [ pattern ]
        elements: str
    excludes:
        description:
            - One or more (shell or regex) patterns, which type is controlled by I(use_regex) option.
            - Items whose basenames match an I(excludes) pattern are culled from I(patterns) matches.
              Multiple patterns can be specified using a list.
        type: list
        aliases: [ exclude ]
        version_added: "2.5"
        elements: str
    contains:
        description:
            - A regular expression or pattern which should be matched against the file content.
            - Works only when I(file_type) is C(file).
        type: str
    read_whole_file:
        description:
            - When doing a C(contains) search, determines whether the whole file should be read into
              memory or if the regex should be applied to the file line-by-line.
            - Setting this to C(true) can have performance and memory implications for large files.
            - This uses C(re.search()) instead of C(re.match()).
        type: bool
        default: false
        version_added: "2.11"
    paths:
        description:
            - List of paths of directories to search. All paths must be fully qualified.
        type: list
        required: true
        aliases: [ name, path ]
        elements: str
    file_type:
        description:
            - Type of file to select.
            - The 'link' and 'any' choices were added in Ansible 2.3.
        type: str
        choices: [ any, directory, file, link ]
        default: file
    recurse:
        description:
            - If target is a directory, recursively descend into the directory looking for files.
        type: bool
        default: no
    size:
        description:
            - Select files whose size is equal to or greater than the specified size.
            - Use a negative size to find files equal to or less than the specified size.
            - Unqualified values are in bytes but b, k, m, g, and t can be appended to specify
              bytes, kilobytes, megabytes, gigabytes, and terabytes, respectively.
            - Size is not evaluated for directories.
        type: str
    age_stamp:
        description:
            - Choose the file property against which we compare age.
        type: str
        choices: [ atime, ctime, mtime ]
        default: mtime
    hidden:
        description:
            - Set this to C(true) to include hidden files, otherwise they will be ignored.
        type: bool
        default: no
    follow:
        description:
            - Set this to C(true) to follow symlinks in path for systems with python 2.6+.
        type: bool
        default: no
    get_checksum:
        description:
            - Set this to C(true) to retrieve a file's SHA1 checksum.
        type: bool
        default: no
    use_regex:
        description:
            - If C(false), the patterns are file globs (shell).
            - If C(true), they are python regexes.
        type: bool
        default: no
    depth:
        description:
            - Set the maximum number of levels to descend into.
            - Setting recurse to C(false) will override this value, which is effectively depth 1.
            - Default is unlimited depth.
        type: int
        version_added: "2.6"
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        details: since this action does not modify the target it just executes normally during check mode
        support: full
    diff_mode:
        support: none
    platform:
        platforms: posix
seealso:
- module: ansible.windows.win_find
a�
- name: Recursively find /tmp files older than 2 days
  ansible.builtin.find:
    paths: /tmp
    age: 2d
    recurse: yes

- name: Recursively find /tmp files older than 4 weeks and equal or greater than 1 megabyte
  ansible.builtin.find:
    paths: /tmp
    age: 4w
    size: 1m
    recurse: yes

- name: Recursively find /var/tmp files with last access time greater than 3600 seconds
  ansible.builtin.find:
    paths: /var/tmp
    age: 3600
    age_stamp: atime
    recurse: yes

- name: Find /var/log files equal or greater than 10 megabytes ending with .old or .log.gz
  ansible.builtin.find:
    paths: /var/log
    patterns: '*.old,*.log.gz'
    size: 10m

# Note that YAML double quotes require escaping backslashes but yaml single quotes do not.
- name: Find /var/log files equal or greater than 10 megabytes ending with .old or .log.gz via regex
  ansible.builtin.find:
    paths: /var/log
    patterns: "^.*?\\.(?:old|log\\.gz)$"
    size: 10m
    use_regex: yes

- name: Find /var/log all directories, exclude nginx and mysql
  ansible.builtin.find:
    paths: /var/log
    recurse: no
    file_type: directory
    excludes: 'nginx,mysql'

# When using patterns that contain a comma, make sure they are formatted as lists to avoid splitting the pattern
- name: Use a single pattern that contains a comma formatted as a list
  ansible.builtin.find:
    paths: /var/log
    file_type: file
    use_regex: yes
    patterns: ['^_[0-9]{2,4}_.*.log$']

- name: Use multiple patterns that contain a comma formatted as a YAML list
  ansible.builtin.find:
    paths: /var/log
    file_type: file
    use_regex: yes
    patterns:
      - '^_[0-9]{2,4}_.*.log$'
      - '^[a-z]{1,5}_.*log$'

a0
files:
    description: All matches found with the specified criteria (see stat module for full output of each dictionary)
    returned: success
    type: list
    sample: [
        { path: "/var/tmp/test1",
          mode: "0644",
          "...": "...",
          checksum: 16fac7be61a6e4591a33ef4b729c5c3302307523
        },
        { path: "/var/tmp/test2",
          "...": "..."
        },
        ]
matched:
    description: Number of matches
    returned: success
    type: int
    sample: 14
examined:
    description: Number of filesystem objects looked at
    returned: success
    type: int
    sample: 34
skipped_paths:
    description: skipped paths and reasons they were skipped
    returned: success
    type: dict
    sample: {"/laskdfj": "'/laskdfj' is not a directory"}
    version_added: '2.12'
N)�to_text�	to_native)�
AnsibleModuleFc��|s|sdS|r�|r4|s2|D].}tj|��}|�|��rdS�/n�|re|rc|D]`}tj|��}|�|��r5|D]/}tj|��}|�|��rdS�0dS�ana|r |s|D]}tj||��rdS�n?|r=|r;|D]8}tj||��r!|D]}tj||��rdS�dS�9dS)zfilter using glob patternsTF)�re�compile�match�fnmatch)�f�patterns�excludes�	use_regex�p�r�es       �9/usr/lib/python3.11/site-packages/ansible/modules/find.py�pfilterr�s�����H���t�� ��	 �H�	 ��
 �
 ���J�q�M�M���7�7�1�:�:� ��4�4� �
 �
�	 �(�	 ��
 �
 ���J�q�M�M���7�7�1�:�:� �%�)�)���J�q�M�M���7�7�1�:�:�)�#(�5�5�5�)��4�4� ���	 �H�	 ��
 �
 ���?�1�a�(�(� ��4�4� �
 ��	 �(�	 ��
 �
 ���?�1�a�(�(� �%�)�)��"�?�1�a�0�0�)�#(�5�5�5�)��4�4�	 ��5�c���|�dS|dkr)|t|d|z��z
t|��krdS|dkr)|t|d|z��z
t|��krdSdS)zfilter files older than ageNTrzst_%sF)�getattr�abs)�st�now�age�	timestamps    r�	agefilterr"su��
�{��t�	����c�G�B��)�(;�<�<�<��C���H�H��t�	�q���S�7�2�w��':�;�;�;�s�3�x�x�G�G��t��5rc��|�dS|dkr|jt|��krdS|dkr|jt|��krdSdS)zfilter files greater than sizeNTrF)�st_sizer)r�sizes  r�
sizefilterr#-sQ���|��t�	
����r�z�S��Y�Y�.�.��t�	
����b�j�C��I�I�-�-��t��5rc�~�|�dStj|��}	t|��5}|r@t|�|�������cddd��S|D]%}|�|��rddd��dS�&	ddd��n#1swxYwYn#t$rYnwxYwdS)a�
    Filter files which contain the given expression
    :arg fsname: Filename to scan for lines matching a pattern
    :arg pattern: Pattern to look for inside of line
    :arg read_whole_file: If true, the whole file is read into memory before the regex is applied against it. Otherwise, the regex is applied line-by-line.
    :rtype: bool
    :returns: True if one of the lines in fsname matches the pattern. Otherwise False
    NTF)r
r�open�bool�search�readr�	Exception)�fsname�pattern�read_whole_file�progr�lines      r�
contentfilterr/8sS�����t�
�:�g���D�

�
�&�\�\�	 �Q��
3��D�K�K������1�1�2�2�	 �	 �	 �	 �	 �	 �	 �	 ��
 �
 ���:�:�d�#�#� ��
	 �	 �	 �	 �	 �	 �	 �	 �
 �
 �		 �	 �	 �	 �	 �	 �	 �	 �	 �	 �	 ����	 �	 �	 �	 ����
�
�
���
�����5sL�B-�6B!�B-�,B!�B-�B!�B-�!B%�%B-�(B%�)B-�-
B:�9B:c���d}d}	tj|j��j}n#t$rYnwxYw	tj|j��j}n#t$rYnwxYwiddtj
|j��z�dtj|j���dtj
|j���dtj|j���dtj|j���dtj|j���d	tj|j���d
tj|j���d|j�d|j�d
|j�d|j�d|j�d|j�d|j�d|j�d|j�||t5|jtjz��t5|jtjz��t5|jtjz��t5|jtjz��t5|jtjz��t5|jtj z��t5|jtj!z��t5|jtj"z��t5|jtj#z��t5|jtj$z��t5|jtj%z��d�
�S)N��modez%04o�isdir�ischr�isblk�isreg�isfifo�islnk�issock�uid�gidr"�inode�dev�nlink�atime�mtime�ctime)
�gr_name�pw_name�wusr�rusr�xusr�wgrp�rgrp�xgrp�woth�roth�xoth�isuid�isgid)&�pwd�getpwuid�st_uidrCr)�grp�getgrgid�st_gidrB�stat�S_IMODE�st_mode�S_ISDIR�S_ISCHR�S_ISBLK�S_ISREG�S_ISFIFO�S_ISLNK�S_ISSOCKr!�st_ino�st_dev�st_nlink�st_atime�st_mtime�st_ctimer&�S_IWUSR�S_IRUSR�S_IXUSR�S_IWGRP�S_IRGRP�S_IXGRP�S_IWOTH�S_IROTH�S_IXOTH�S_ISUID�S_ISGID)rrCrBs   r�statinforpUs����G��G�
��,�r�y�)�)�1�����
�
�
���
����
��,�r�y�)�)�1�����
�
�
���
���������b�j�1�1�1�����b�j�)�)��	���b�j�)�)��	���b�j�)�)�	�
	���b�j�)�)��	�$�-��
�+�+�
�	���b�j�)�)��	�$�-��
�+�+��	�r�y��	�r�y��	��
��	����	�r�y��	����	���� 	���!�"	���#�$���R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��R�Z�$�,�.�/�/��b�j�4�<�/�0�0��b�j�4�<�/�0�0�=���s�%�
2�2�A�
A"�!A"c��|�)N�)rs r�handle_walk_errorsrs�s��
�Grc��tttddddgd���tdgdgd���tdd	gd�
��td���tdd
���tddgd����td���tddgd����td���tdd
���tdd
���tdd
���tdd
���tdd
���td������d���}|j}|ds|drdg|d<ndg|d<g}i}|d�d}n�tjd|d�����}dddd d!d"�}|rMt
|�d����|�|�d#��d��z}n|�	|dd$�%��|d&�d}n�tjd'|d&�����}dd(d)d*d+d,�}|rMt
|�d����|�|�d#��d��z}n|�	|d&d-�.��tj
��}	d/}
d0}d
}|d1D�]�}
tj�
tj�|
����}
	tj�|
��st!d2t#|
��z���tj|
t&|d3�4��D�]�\}}}|t)|��zt)|��z}||zD�]�}tj�tj�||����}|d5r�|
�tjj��tjjz}t
|�tjj����t
|�tjj����z
dz}||d5kr|dd�=��tj�|���d6��r
|d7s��2	tj|��}n\#t:t<f$rH}|�d8|�d9tA|���d:���tA|��||<d}Yd}~���d}~wwxYwd|i}|d;d<kr�tC||d|d=|d��r�tE||	||d>��r�|�#tI|����tKj&|j'��r |d?r|�(|��|d@<tKj&|j'��r'tS||��r|�*|�����|�*|�����tKj+|j'��r�|d;dAkrutC||d|d=|d��rOtE||	||d>��r7|�#tI|����|�*|����<tKj&|j'��r�|d;dkr�tC||d|d=|d��r�tE||	||d>��r�tS||��rttY||dB|dC��rW|�#tI|����|d?r|�(|��|d@<|�*|����#tKj-|j'��r|d;dDkrstC||d|d=|d��rOtE||	||d>��r7|�#tI|����|�*|�����|dEsn������#t $rN}tA|��||
<|�dFtA|
���dG||
�d:���d}Yd}~���d}~wwxYw|rdH}
t)|��}|�.|d
|
|||�I��dS)JN�listT�name�path�str)�type�required�aliases�elementsr+)ry�defaultr{r|�exclude)ryr{r|)ryr&F)ryr}�file)�any�	directoryr�link)ryr}�choicesr@)r?rAr@�int)�pathsrr�containsr,�	file_typer�	age_stampr"�recurse�hidden�follow�get_checksumr�depth)�
argument_spec�supports_check_moderrz.*�*rz^(-?\d+)(s|m|h|d|w)?$��<ii�Qi�:	)�s�m�h�d�w�zfailed to process age)r�msgr"z^(-?\d+)(b|k|m|g|t)?$iii@l)�b�kr��g�tzfailed to process size)r"r�zAll paths examinedrr�z'%s' is not a directoryr�)�onerror�followlinksr��.r�zSkipped entry 'z' due to this access issue: �
r�r�rr�r��checksumr�r�r,r�r�z	Skipped 'z!' path due to this access issue: z2Not all paths examined, check warnings for details)�files�changedr��matched�examined�
skipped_paths)/r�dict�paramsr
r�lowerr��group�get�	fail_json�time�osrw�
expanduser�
expandvarsr3r)r�walkrs�len�normpath�join�rstrip�sep�count�basename�
startswith�lstat�IOError�OSError�warnrrr�updaterprUr[rW�sha1r#�appendrXr/r]�	exit_json)�moduler��filelist�skippedrr��seconds_per_unitr"�bytes_per_unitrr��looked�has_warnings�npath�root�dirsr��fsobjr*�wpathr�rrrr�s                         r�mainr��sK	��
���F�T�F�F�;K�V[�\�\�\��v�r�I�;�QV�W�W�W��v�	�{�U�K�K�K��u�%�%�%� �f�e�<�<�<���v�?c�?c�?c�d�d�d��%� � � ���w�@[�@[�@[�\�\�\��5�!�!�!��f�e�4�4�4��V�U�3�3�3��V�U�3�3�3��6�5�9�9�9����6�6�6��E�"�"�"�
�
�
�"!�%���F�*�]�F��*��'��+��	'�"&��F�:���"%��F�:���H��G�
�e�}�����
�H�-�v�e�}�/B�/B�/D�/D�E�E��!"��$�U��P�P���	M��a�g�g�a�j�j�/�/�$4�$8�$8�������Q�$G�$G�G�C�C�������4K��L�L�L�
�f�~�����
�H�-�v�f�~�/C�/C�/E�/E�F�F�� �t�'��g�V�V���	P��q�w�w�q�z�z�?�?�^�%7�%7�����
�
�A�%F�%F�F�D�D����&��.�6N��O�O�O�
�)�+�+�C�
�C�
�F��L����E �E ����"�"�2�7�#5�#5�e�#<�#<�=�=��C	 ��7�=�=��'�'�
N�� 9�I�e�<L�<L� L�M�M�M�%'�W�U�<N�\b�ck�\l�%m�%m�%m�;
�;
�!��d�E��#�e�*�*�,�s�4�y�y�8��#�d�l�6/�6/�E��W�-�-�b�g�l�l�4��.G�.G�H�H�F��g��%� %���R�W�[� 9� 9�B�G�K� G�� #�F�L�L����$=�$=� >� >��U�[�[�QS�QX�Q\�E]�E]�A^�A^� ^�ab� b�� �6�'�?�2�2� $�Q�Q�Q��$��w�'�'��/�/�:�:�3�?�?�!��x�HX�!� �!��X�f�-�-����#�W�-�!�!�!�����[a�[a�[a�cj�kl�cm�cm�cm�cm�$n�o�o�o�*1�!�*�*����'+�� ���������	!���� ��(�A��k�*�e�3�3�"�5�&��*<�f�Z�>P�RX�Yd�Re�f�f�
3�kt�uw�y|�B�DJ�KV�DW�lX�lX�
3��H�H�X�b�\�\�2�2�2�#�|�B�J�7�7�D�F�>�<R�D�06���F�0C�0C��*�
�#�|�B�J�7�7�3�#-�b�$�#7�#7�!7�$,�O�O�A�$6�$6�$6�� (���� 2� 2� 2����b�j�1�1�/�f�[�6I�[�6X�6X�"�5�&��*<�f�Z�>P�RX�Yd�Re�f�f�/�kt�uw�y|�B�DJ�KV�DW�lX�lX�/��H�H�X�b�\�\�2�2�2�$�O�O�A�.�.�.����b�j�1�1�/�f�[�6I�V�6S�6S�"�5�&��*<�f�Z�>P�RX�Yd�Re�f�f�/�$�R��c�6�+�3F�G�G�/�%�b�$�/�/�/�4A�&�&�Q[�J\�^d�ev�^w�4x�4x�/��H�H�X�b�\�\�2�2�2�%�n�5�D�06���F�0C�0C��*�
�$�O�O�A�.�.�.����b�j�1�1�/�f�[�6I�V�6S�6S�"�5�&��*<�f�Z�>P�RX�Yd�Re�f�f�/�kt�uw�y|�B�DJ�KV�DW�lX�lX�/��H�H�X�b�\�\�2�2�2�$�O�O�A�.�.�.���i�(���E�����	 �	 �	 �$�Q�Z�Z�G�E�N��K�K�K�g�V[�n�n�n�n�^e�fk�^l�^l�^l�m�n�n�n��L�L�L�L�L�L�����	 ����
�C�B���(�m�m�G�
���8�U��W�W]�mt��u�u�u�u�usE�;Ga�<S�a�T*	�"=T%	�a�%T*	�*L(a�
b,�Ab'�'b,�__main__)NNF)F)�
__future__rrrry�
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURNr
rRr�rOr
rUr��ansible.module_utils._textrr�ansible.module_utils.basicrrrr#r/rprsr��__name__rrrr�<module>r�sO��A�@�@�@�@�@�@�@�@�@��
�A�
�H;��z
��B����
�
�
�
�	�	�	�	�
�
�
�
�	�	�	�	���������9�9�9�9�9�9�9�9�4�4�4�4�4�4�$�$�$�$�N����������:-�-�-�`���Iv�Iv�Iv�X�z����D�F�F�F�F�F��r

Youez - 2016 - github.com/yon3zu
LinuXploit