관리-도구
편집 파일: cluserselect.cpython-311.pyc
� %�4gl � �d � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl mZ d dl mZmZmZmZ d dlmZ d dlmZ d dlZd d lmZ d dlmZ d dlmZmZ d d lmZ d dl m!Z! d dl"m#Z# d dl$m%Z% d dl&m'Z' d dl(m)Z)m*Z*m+Z+ d dl,m-Z- d dl.m/Z/ n# e0$ r Y nw xY w G d� de� � Z1dS )� )�print_function)�absolute_import)�divisionN)�configparser)�S_IRUSR�S_IWUSR�S_IRGRP�S_IROTH)� iteritems)�Path� )�ClSelect)�ClSelectExcept)�ClPwd� clcaptain)�clprint)�utils)�ExternalProgramFailed)�BASEDIR)�get_user_prefix)�is_ea4_enabled�read_cpanel_ea4_php_conf�configure_alt_php)�da_change_user_php_ini)�ispmanager_create_user_wrapperc � � e Zd ZdZdZ ej � � rendZdZdZ d-d�Z ed.d �� � Zd � Z d/d�Zd0d�Zd� Zd� Zd� Zd� Zd1d�Zd1d�Zdedefd�Zd0d�Zd� Zd� Zd� Zd� Zd� Zd-d�Zd2d�Z ee� � Zd � Z d!� Z!d"� Z"d#� Z#d$� Z$d%� Z% ee%� � Z%d&� Z&d'� Z' ee'� � Z'd3d(�Z(d)� Z)d*� Z* ee*� � Z*d+� Z+d,� Z,dS )4�ClUserSelectz/var/cagefsz /usr/selectorz'/usr/share/cagefs-skeleton/usr/selectorz/etc/cagefs/excludez.cl.selector/selector.pathNc �\ � t j � � s!t j � d� � sdS |D ]�}| j � |� � }t j � |j d� � }t j � |� � s�| � |� � } t j |� � n.# t t f$ r}t j ||� � �d}~ww xY w t � |� � ��# t � |� � w xY w��dS )z� Creates flags mod_lsapi_reset_me in users' home directories in order to recreate CRIU images when php version/extensions/options have changed For details see LVEMAN-1210 :param users: list of usernames (strings) z/var/run/mod_lsapi/criu.enabledN�mod_lsapi_reset_me)r � in_cagefs�os�path�isfile�_clpwd�get_pw_by_name�join�pw_dir�_change_uidr �write�OSErrorr r �UnableToSaveDatar �_restore_uid)�self�users�user�pwr"