Uname : Linux serv1.rebootns.com 5.14.0-570.62.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Nov 11 10:10:59 EST 2025 x86_64
Soft : LiteSpeed
Ip : 139.99.125.122
Port : 443
~
/
usr
/
lib64
/
python3.9
/
site-packages
/
borg
/
helpers
/
__pycache__
[ HOME ]
Exec
Submit
fs.cpython-39.pyc
a HZ�h:= � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZddlm Z ddl mZ ddlm Z ddlT ddlmZ e� ZejejB ejB d fd d�Zdd � Zdd� ZdBdd�Zdd� Zdd� Zdd� Zdd� Ze�d�Zdd� Zdd� Zdd � Z dd!�d"d#�Z!d$d%� Z"d&d'� Z#d(d)� Z$d*d+� Z%e%d,d-d.�Z&e&e%d/�B Z'e&Z(e&e%d0d/�B Z)e)e%d1�B Z*e%d2d.d/�Z+dddd3d4�d5d6�Z,dddd3d7�d8d9�Z-d:d;� Z.d dlZ/d dlZ0d dl Z1d d<l2m3Z3m4Z4m5Z5m6Z6m7Z7 dCd>d?�Z8dDd@dA�Z9dS )E� N� )�Error)�prepare_subprocess_env� )�is_win32)�*)� create_loggerTc C sR zt j| |dd� W n8 tyL } z |r6tt|���n� W Y d}~n d}~0 0 dS )a Ensures that the dir exists with the right permissions. 1) Make sure the directory exists in a race-free operation 2) If mode is not None and the directory has been created, give the right permissions to the leaf directory. The current umask value is masked out first. 3) If pretty_deadly is True, catch exceptions, reraise them with a pretty message. Returns if the directory has been created and has the right permissions, An exception otherwise. If a deadly exception happened it is reraised. T)�mode�exist_okN)�os�makedirs�OSErrorr �str)�pathr Z pretty_deadly�e� r �5/usr/lib64/python3.9/site-packages/borg/helpers/fs.py� ensure_dir s r c C s: t j�d�pt j�d�} | s6t j�dt j�dd� �} | S )z�Get home directory / base directory for borg: - BORG_BASE_DIR, if set - HOME, if set - ~$USER, if USER is set - ~ � BORG_BASE_DIR�HOMEz~%sZUSER� )r �environ�getr � expanduser)�base_dirr r r �get_base_dir) s r c C s0 t j�d�} | du r$t j�t� d�} t| � | S )�,Determine where to repository keys and cacheZ BORG_KEYS_DIRN�keys�r r r r �join�get_config_dirr )Zkeys_dirr r r �get_keys_dir; s r! c C sB t j�d�}|du r$t j�t� d�}| r6t j�|| �}t|� |S )z4Determine where to store local security information.ZBORG_SECURITY_DIRNZsecurityr )Z repository_idZsecurity_dirr r r �get_security_dirE s r"