관리-도구
편집 파일: cluserselect.cpython-37.pyc
B �v6d�f � @ s� d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl m Z d dlm Z mZmZmZ d dlmZ d dlZdd lmZ dd lmZ d dlmZmZ ddlmZ dd lmZ d dlm Z G dd� de�Z!dS )� )�print_function)�absolute_import)�divisionN)�configparser)�S_IRUSR�S_IWUSR�S_IRGRP�S_IROTH)� iteritems� )�ClSelect)�ClSelectExcept)�ClPwd� clcaptain)�clprint)�utils)�ExternalProgramFailedc @ sX e Zd ZdZdZdZdZdZdJdd�Ze dKd d��Z dd � ZdLdd�ZdMdd�Z dd� Zdd� Zdd� Zdd� ZdNdd�ZdOdd�ZdPd d!�Zd"d#� Zd$d%� Zd&d'� Zd(d)� Zd*d+� ZdQd,d-�ZdRd.d/�Ze e�Zd0d1� Zd2d3� Zd4d5� Zd6d7� Zd8d9� Z d:d;� Z!e e!�Z!d<d=� Z"d>d?� Z#e e#�Z#dSd@dA�Z$dBdC� Z%dDdE� Z&e e&�Z&dFdG� Z'dHdI� Z(dS )T�ClUserSelectz/var/cagefsz'/usr/share/cagefs-skeleton/usr/selectorz /usr/selectorz/etc/cagefs/excludez.cl.selector/selector.pathNc C s� t j�d�sdS x�|D ]�}| j�|�}t j�|jd�}t j�|�s| �|�}zFyt� |� W n2 t tfk r� } zt� ||��W dd}~X Y nX W dt�|� X qW 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.enabledNZmod_lsapi_reset_me)�os�path�isfile�_clpwd�get_pw_by_name�join�pw_dir�_change_uidr �write�OSErrorr r �UnableToSaveDatar �_restore_uid)�self�users�user�pwr �previous_user_data�e� r&