|
Server : Apache System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64 User : njnconst ( 1116) PHP Version : 8.4.18 Disable Function : NONE Directory : /opt/alt/python37/lib/python3.7/site-packages/clselect/__pycache__/ |
Upload File : |
B
���b
� � @ s d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl
Zd dlZd dl
mZ ddlmZ ddlmZmZ dd lmZ dd
lmZ ddlmZ ddlmZ d d
lmZ d dlmZmZ d dl m!Z!m"Z" d dl#m$Z$ ddl%m&Z&m'Z' ddl(m)Z)m*Z* d Z+dZ,dZ-dd� Z.dLdd�Z/dd� Z0dd� Z1dd� Z2de+fdd �Z3de+fd!d"�Z4d#d$� Z5d%d&� Z6d'd(� Z7d)d*� Z8d+d,� Z9d-d.� Z:dMd0d1�Z;dNd3d4�Z<dOd5d6�Z=d7d8� Z>d9d:� Z?d;d<� Z@d=d>� ZAd?d@� ZBdAdB� ZCdPdCdD�ZDdEdF� ZEdGdH� ZFdIdJ� ZGeHdKk�reG� dS )Q� )�print_function)�absolute_import)�divisionN)�map� )�ClSelect)�ClExtSelect�depend_modules_dict)�ClUserSelect)�ClUserExtSelect)�ClUserOptSelect)�clprint)�ClPwd)�
SysCtlConf�SYSCTL_CL_CONF_FILE)�run_command�ExternalProgramFailed)� is_ubuntu)� in_cagefs�make_symlink)�ClSelectExcept�BaseClSelectExceptionz/usr/sbin/cagefsctlc C s� t d� t d� t d� t d� t d� t d� t d� t d� t d � t d
� t d� t d� t d
� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d� t d � t d!� t d"� t d#� t d$� t d%� t d&� t d'� t d(� t d)�t�� t d*� t d+� t d,� t d-� t d.� t d/� t d0� t d1� t d2� d S )3Nz? -v | --version : Specify alternative versionz, -u | --user : UsernamezE -l | --list : List alternatives for interpreterzQ -G | --list-extensions : List global set of extensions for alternativez@ -S | --summary : List summary of alternativeszE -s | --user-summary : List user summary of alternativeszG -C | --current : Show currently selected alternativezR -c | --user-current : Show currently selected alternative for a userzE -B | --set-current : Set alternative as global defaultzC -b | --set-user-current : Set alternative as user defaultz? -Y | --enable-alternative : Enable alternative globallyz@ -N | --disable-alternative : Disable alternative globallyzd -E | --enable-extensions : Enable comma-separated list of extensions globally for a versionze -D | --disable-extensions : Disable comma-separated list of extensions globally for a versionz_ -R | --replace-extensions : Replace extensions with comma-separated list of extensions z: for a version globallyzX -e | --enable-user-extensions : Enable comma-separated list of extensions for a userzY -d | --disable-user-extensions : Disable comma-separated list of extensions for a userzc -r | --replace-user-extensions : Replace user extensions with comma-separated list of extensionsz[ -t | --reset-user-extensions : Replace user extensions with version default extensionszk -g | --list-user-extensions : List enabled extensions for a user. With key --all shows all extensionsz7 -a | --all : Show all extensionszf -p | --print-summary : If specified along with setting an alternative prints user summaryzb -V | --show-native-version : Shows native version while showing summary or selected versionzN -L | --list-users : List users who use a specified alternativezg -T | --change-to-version : Changes to a specified version all users who have a certain versionzO -k | --add-options : Add comma-separated list options for a userz] -m | --replace-options : Replace user options with comma-separated list of optionszR -x | --delete-options : Delete comma-separated list options for a userzY -Q | --base64 : Expects data as comma-separated base64-encoded stringzL -q | --quiet : Suppress errors messages for wrong inputzX -P | --print-options : Prints user options. By default prints as plain textzg --print-options-safe : Prints user options. By default prints as plain text (safe strings)zV --apply-symlinks-rules : Recreate symlinks to php extensions for all users zQ based on /etc/cl.selector/symlinks.rules filezk --exclude-pid-list : Specify list of PIDs of processes that should not be signaled by SIGHUPz6 -j | --json : Print data as JSONz5 -w | --csv : Print data as CSVz@ -W | --perl : Print data as perl structurezW --api-version : Integer, representing specific api version to use. z2 Defaults to {}ze -z | --reset-options : Deletes all user custom options. Range can be narrowed with user z6 or version optionsz< --update-backup : write settings to backupzh --apply-global-php-ini : use with 0, 1 or 2 arguments from the list: error_log, date.timezonezh without arguments applies all global php options including two abovezE --setup-without-cagefs : setup PHP Selector without CageFSzY --revert-to-cagefs : revert to default setup of PHP Selector (with CageFS)zV --for-all-users : applies specified action for all users in CageFS. zU Available only for enable/disable user extensions)�print�format�API_0� r r �H/opt/alt/python37/lib/python3.7/site-packages/clselect/clselectctlphp.py�usage0 sd r c C s2 d}|rd|df }t j�|| � t �d� dS )z5
Prints to stderr
@param message: string
z%s
z%s:%s
z%sr N)�sys�stderr�write�exit)�message�prefix�fmtr r r �print_error_and_exite s
r% c C s t tj�dkrtd� dS )z\
Checks presence of command line arguments
and exits with usage info if missing
r zFCommand line arguments expected. For help use '-h' or '--help' optionsN)�lenr �argvr% r r r r �check_args_presenceq s r( c C s` d}| � dd�}|| d }d}tj�|�r\yt|d��� �� }W n ttfk
rZ dS X |S )z
z/opt/alt/php�.� z/name_modifier�r) �replace�os�path�isfile�open�readline�strip�OSError�IOError)�versionZBASE_ALT_DIR�verZname_modifier_file�
name_modifierr r r �get_name_modifier| s r8 c C s | dkrdS | dkrdS d S )N�-�disabled�e�enabledr )�letterr r r �letter_to_status� s r>