ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/clcommon/
Upload File :
Current File : //proc/self/root/proc/self/root/proc/self/root/lib/python2.7/site-packages/clcommon/clcagefs.pyc

�
b=0Yc@s�ddlZddlZdZdZdefd��YZdefd��YZd�Zd	ddd
�Z
d	dddd�ZdS(
i����Ns/etc/cagefs/cagefs.mps/usr/sbin/cagefsctltCagefsMpConflictcBseZd�Zd�ZRS(cCsd|t|f|_dS(NsUConflict in adding '%s' to %s because of pre-existing alternative specification: '%s'(tCAGEFS_MP_FILENAMEt_msg(tselftnew_itemt
existing_item((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt__init__
scCs|jS(N(R(R((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt__str__s(t__name__t
__module__RR(((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyR	s	tCagefsMpItemcBs�eZdZdZdZd�Zd�Zd�Zd�Ze	e�Zd�Z
d�Zd	�Zd
�Z
e	e
�Z
d�Ze	e�Zd�Ze	e�Zd
�Zd�ZRS(s@!%tt!cCsG|d dkrd|_n'|j�dkr:d|_n	||_dS(s�Constructor

        :param arg: Is either path to add to cagefs.mp or a raw line is read from cagefs.mp
        :param prefix: The same as adding prefix '!' to arg before passing it to ctorit#RN(tNonet
_path_spectstrip(Rtarg((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyRs
cCs;|j�dkr7|dk	r7d|j|f|_n|S(s%Specify mode as in fluent constructort@s%s,%03oN(tprefixRR(Rtmode((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyR%scCs|jS(N(R(R((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyR-scCs,|dkrdS|ddkr(|dS|S(NRt/i����((tpath((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt
_add_slash/s
cCsbtj|�}|j�s'|j�r+tStj|j��}tj|j��}|j|�S(N(R
t_adopttis_dummytFalseRRt
startswith(Rtanothertadoptedt	this_pathttest_preexist_in_path((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pytpre_exist_in7scCs�tj|�}|j�s'|j�r+tS|j�|j�krGtSitjgtj6}g}|j�|j|j�|�kS(N(	R
RRRRtTruet_PREFIX_MOUNT_ROt_PREFIX_MOUNT_RWtget(RtexistingRtprefix_compatibility_maptnull_options((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pytis_compatible_by_prefix_withCscCs
|jdkS(N(RR(R((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyRSscCs!t|t�r|St|�SdS(N(t
isinstanceR
(tx((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyRUscCs|jd�dS(sjCut off mode from path spec like @/var/run/screen,777

        Only one comma per path spec is allowed ;-)t,i(tsplit(t	path_spec((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt
_cut_off_mode\scCs|jtj�S(N(tlstripR
t_PREFIX_LIST(R-((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt_cut_off_prefixdscCstjtj|j��S(N(R
R1R.R(R((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyRgscCs(|j|j�kr |jdSdSdS(NiR(RR(R((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyRjs(RR	R0R#R"RRRRtstaticmethodR R(RRR.R1RR(((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyR
s&	
										cCs"tjjt�o!tjjt�S(N(tosRtexistsRtCAGEFSCTL_TOOL(((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pytis_cagefs_presentpsi�cCsstjj|�s"tj|�n|dk	rAtj||�n|dk	ro|dk	rotj|||�ndS(N(R3RtisdirtmkdirRtchmodtchown(RRtowner_idtgroup_id((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt_mk_mount_dir_setup_permtsRc	st||||�tjtdg�ttd�}z�t||�j|��d�|D�}t�fd�|�}|s�|j	dd�|j
dd�}|d	I|IJ|�IJ|j�tjtd
g�n)�j|d�st
�|d��nWd|j�XdS(
smAdd mount point to /etc/cagefs/cagefs.mp

    :param path: Directory path to be added in cagefs.mp and mounted
                 from within setup_mount_dir_cagefs().
                 If this directory does not exist, then it is created.

    :param added_by: package or component, mount dir relates to, or whatever will
                     stay in cagefs.mp with "# added by..." comment

    :param mode: If is not None: Regardless of whether directory exists or not prior this call,
                 it's permissions will be set to mode.

    :param owner_id: If group_id is also provided along:
                     Regardless of whether directory exists or not prior this call,
                     it's owner id will be set to.

    :param group_id: If owner_id is also provided along:
                     Regardless of whether directory exists or not prior this call,
                     it's group id will be set to.

    :param prefix: Mount point prefix. Default is mount as RW.
                   Pass '!' to add read-only mount point.
                   Refer CageFS section at http://docs.cloudlinux.com/ for more options.

    :returns: None

    Propagates native EnvironmentError if no CageFS installed or something else goes wrong.

    Raises CagefsMpConflict if path is already specified in cagefs.mp, but in a way which is opposite
    to mount_as_readonly param.
    s
--check-mpsr+css|]}|j�VqdS(N(trstrip(t.0t	file_line((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pys	<genexpr>�scs
�j|�S(N(R (R*(R(s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt<lambda>�siis
t s# next line is added bys
--remount-alli����N(R=t
subprocesstcallR5topenRR
RtfiltertseektreplacetcloseR(R(	Rtadded_byRR;R<Rt	cagefs_mpttrim_nl_itertpre_exist_option((Rs5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pytsetup_mount_dir_cagefss""

(R3RCRR5t	ExceptionRtobjectR
R6RR=RN(((s5/usr/lib/python2.7/site-packages/clcommon/clcagefs.pyt<module>s	^	

Zerion Mini Shell 1.0