/usr/lib/python3/dist-packages/certbot/compat/__pycache__
Edit: /usr/lib/python3/dist-packages/certbot/compat/__pycache__/filesystem.cpython-310.pyc (16974B)
o
6aês ã @ s” d Z ddlmZ ddlZddlZddlZddlZddlmZ zddl Z ddl
Z
ddlZddlZddl
Z
ddlZddlZW n eyG dZY nw dZG dd„ dƒZeƒ Zd ed
eddfdd
„Zdedefdd„Zdeded
edededdfdd„Z dRdededededdf
dd„Zd ed
edefdd„Zd edefdd„Zd ed
edefdd„ZdSd ed ed
edefd!d"„ZdSd ed
eddfd#d$„ZdSd ed
eddfd%d&„Z dededdfd'd(„Z!d edefd)d*„Z"d+edefd,d-„Z#d.edefd/d0„Z$d.edefd1d2„Z%d3ed4edefd5d6„Z&d7ed8edefd9d:„Z'd.ed;edefd
d?„ Z)d@dA„ Z*dTdBdC„Z+dDdE„ Z,dFdG„ Z-dHdI„ Z.dJdK„ Z/dLdM„ Z0dNdO„ Z1dPdQ„ Z2dS )Uz;Compat module to handle files security on Windows and Linuxé )Úabsolute_importN)ÚListTFc @ s e Zd ZdZdd„ ZdS )Ú
_WindowsUmaskz+Store the current umask to apply on Windowsc C s
d| _ d S )Né )Úmask)Úself© r ú;/usr/lib/python3/dist-packages/certbot/compat/filesystem.pyÚ__init__ s
z_WindowsUmask.__init__N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r
r r r r r s r Ú file_pathÚmodeÚreturnc C s" t r
t | |¡ dS t| |ƒ dS )a[
Apply a POSIX mode on given file_path:
- for Linux, the POSIX mode will be directly applied using chmod,
- for Windows, the POSIX mode will be translated into a Windows DACL that make sense for
Certbot context, and applied to the file using kernel calls.
The definition of the Windows DACL that correspond to a POSIX mode, in the context of Certbot,
is explained at https://github.com/certbot/certbot/issues/6356 and is implemented by the
method `_generate_windows_flags()`.
:param str file_path: Path of the file
:param int mode: POSIX mode to apply
N)Ú
POSIX_MODEÚosÚchmodÚ_apply_win_mode©r r r r r r &