ok

Mini Shell

Direktori : /proc/self/root/lib64/python2.7/site-packages/sepolicy/
Upload File :
Current File : //proc/self/root/lib64/python2.7/site-packages/sepolicy/__init__.pyo

�
4��]c@s�ddlmZddlZddlZddlZdZddlZddlj	Z	ddl
jZddlm
Z
ddlZddlZejed�eje�yejededd	�WnMek
r�ejedd	�n*ek
rddlZeejd
<nXejZejZejZejZejZejZejZ ej!Z!ej"Z"dZ#dZ$d
Z%dZ&dZ'dZ(dZ)dZdZ*dZ+dd�Z-dd�Z.d�Z/d�Z0d�Z1d�Z2d�Z3d�Z4d�Z5d�Z2d�Z4d �Z5iZ6e7d!�e6d"<e7d#�e6d$<e7d%�e6d&<e7d'�e6d(<e7d)�e6d*<e7d+�e6d,<e7d-�e6d.<e7d/�e6d0<iZ8d"e8d1<d$e8d2<d&e8d3<d(e8d4<d*e8d5<d,e8d6<d.e8d7<d0e8d8<d9�Z9d:�Z:d;�Z;d<�Z<ddl=Z=ddl>Z>ddlZd=�Z?gd>�Z@gd?�ZAd@�ZBdaCejD�dA�ZEdaFejD�dB�ZGdaHejD�dC�ZIdaJejD�dD�ZKdE�ZLdF�ZMdG�ZNdH�ZOdI�ZPdJ�ZQdK�ZRdL�ZSdM�ZTdN�ZUdO�ZVdPdQ�ZWdR�ZXgaYdS�ZZda[dT�Z\da]dU�Z^da_dV�Z`dW�ZadabdacdX�ZddY�ZedafdZ�Zgd[�Zhdaid\�Zjdakd]�Zldamd^�Zndaod_�Zpd`�Zqdarda�Zsdatdb�Zudavdc�Zwdd�Zxde�ZyiZzdfezdg<dhezdi<djezdk<djezdl<djezdm<dnezdo<dpezdq<drezds<dtezdu<dtezdv<dwezdx<dwezdy<dzezd{<d|ezd}<eyd~�Z{da|d�Z}d��Zd��Z~yeW�Zee�Wn.e�k
r@Z�ej��dkrAe��qAnXd��Z�d��Z�d��Z�da�d��Z�da�ddl�Z�d�d��Z�d�d��Z�d��Z�d��Z�d��Z�d��Z�dS(�i(tpolicyi����Ntpolicycoreutils(tutils/usr/share/localetunicodetcodesetsutf-8t_tallowt
auditallowt
neverallowt	dontaudittsourcettargettpermlisttclasst
transitiont
role_allowcCstj||�}|S(N(t_policytinfo(tsetypetnamet	dict_list((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR5scCs�|r|}ni}ttttttg}x7|D]/}||krYtd|��nt||<q4Wg}t|kr�|t}dj	|t�|t<nt
j|�}|r�t|�dkr�g|D]}t
||�r�|^q�}n|S(NsType has to be in %st,i(tALLOWt
AUDITALLOWt
NEVERALLOWt	DONTAUDITt
TRANSITIONt
ROLE_ALLOWt
ValueErrortTruetPERMStjoinRtsearchtlent_dict_has_perms(ttypesRtseinfotvalid_typesRtpermsRtx((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR :s 	

+c
Csfi}g}|jd�rLttgi|t6|t6|t6|t6�}n^ttgi|t6|t6|t6�}x4|D],}|d|krzg}|j|�qzqzWy�x�gg|D]/}t|�j	|t�r�|dr�|^q�D]}	|	^q�D]K}|j
i|dd6|dd6�||kr�|j|�i}q�q�WWntk
ra|SX|S(Nt_tRtbooleanR
(tendswithR RtSOURCEtTARGETtCLASSRtappendtsettissubsettupdatetKeyError(
tsrctdestttclasstpermttdictttlisttallowstiR'ty((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_conditionalsQs$1'
V#

c
Cs�tg|D]}|dddr
|^q
�dk}td�|djtg|D].}d|ddd|dddf^qS��fS(NR)iis-- Allowed %s [ %s ]s || s%s=%d(R!RRR/(tcondR'tenabled((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_conditionals_format_textis7cCstt|�ddS(NiR#(Rt	ATTRIBUTE(t	attribute((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_types_from_attributenscCstt|�ddS(Nit
attributes(RtTYPE(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_attributes_from_typerscCs2ytt|�ddSWntk
r-dSXdS(NiR(RRDtRuntimeErrortNone(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_real_type_namexs
cCsdt|�krtStSdS(Nt	exec_type(RERtFalse(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytfile_type_is_executablescCsdt|�krtStSdS(Nt
entry_type(RERRJ(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytfile_type_is_entrypoint�scCstt|�ddS(NiRC(RRD(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRE�scCsdt|�krtStSdS(NRI(RERRJ(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRK�scCsdt|�krtStSdS(NRL(RERRJ(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRM�ss	all filestasregular filetft	directorytdscharacter devicetcsblock devicetbssocket filetss
symbolic linktls
named pipetpts--s-ds-cs-bs-ss-ls-pcCs�g}d}y1tj|dtjdt�}|jd�}Wn>tjk
r}}ddlm}|�j�jd�}nXx4|D],}t	|�r�|j
|j�d�q�q�W|S(Ns semodule --list=full 2>/dev/nulltstderrtshells
i(tSELinuxDBus(t
subprocesstcheck_outputtSTDOUTRtsplittCalledProcessErrortsedbusRZt
semodule_listR!R.(tall_modulestcmdtoutputRUteRZR:((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_modules�s		
cCs�dddg}g}g}x�|D]�}yqt|d�}|j�}|j�|djd�d }x|D]}|j|�qnW|j|�g}Wq"g}q"Xq"W|S(Ns$/usr/share/selinux/targeted/base.lsts,/usr/share/selinux/targeted/modules-base.lsts//usr/share/selinux/targeted/modules-contrib.lsttrit i����(topent	readlinestcloseR^R.textend(tmod_lst_pathRbtmod_tempR:tfdtmodulestm((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_modules_from_mod_lst�s 




cCs�g}i}x6t�D]+}|jt|��r|j|�qqWt�}xT|D]L}y(||dt||df||<WqUtk
r�g||<qUXqUW|S(Ntregextftype(tget_all_file_typest
startswithtgen_short_nameR.t
get_fcdictt
file_type_strR2(RtflisttmpathsROtfcdict((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_file_types�s	
(
cCs�t�}t�}g}i}ttgi|d6ddgd6dd6�}|dksit|�dkrm|St�}dd	g}x�|D]�}|d
|kr�q�nd|kr�|ds�q�q�n|d
jd�r'|d
|kr�q�n|d
|kr^|d
|kr$|j|d
�q$q^q�x4t	|d
�D]"}	|	|kr8|j|	�q8q8Wq�WxT|D]L}
y(||
d
t
||
df||
<Wqitk
r�g||
<qiXqiW|S(NR
RitwriteRtfileR
it	proc_typetsysctl_typeRR>R(RsRt(tget_all_attributesRuR RRGR!RxR*R.RBRyR2(Rtall_attributest
file_typest
all_writesR{RR|RCR:ttRO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_writable_files�s<		-	

	
(
cCstjj|�r|gSytjd|�}Wnd|fGHgSX|}|jd�rl|d d}ntjj|�}y!|ddkr�|d7}nWntk
r�dGHnXyMtjd|�}tt	|j
gtj|�D]}||^q���SWngSXdS(Ns%s$sbad reg:s(/.*)?i����t/i����stry failed got an IndexError(tostpathtexiststretcompileR*tdirnamet
IndexErrortlisttfiltertmatchtlistdir(tregtpatRVR�R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt	find_files,
:cCs~g}t|�}xet|j��D]Q}|jd�r%||kr%x-||D]}xt|�D]}|SWqQWq%q%WdS(Nt_exec_t(tget_entrypointsR�tkeysR*R�RG(tdomaintexclude_listtall_entrypointstexecutable_filestexeR�RO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytfind_all_files/scCstt�}yS|jd�r[||kr[x1||dD]}xt|�D]}|SWq6WnWntk
ronXdS(NR�Rs(RxR*R�R2RG(R�R�R|R�RO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytfind_entrypoint_path=s	
c	Cs�yet|d��P}|j�}x:|D]2}|j�}i|dd6|d6||d<q(WWdQXWn+tk
r�}|jtjkr��q�nX|S(NRgitequivtmodifyi(RiRjR^tIOErrorterrnotENOENT(tedicttfc_pathR�RotfcReRO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytread_file_equivIs
.
cCs-tr
tSiatt|ddt�atS(Ns.subsR�(tfile_equiv_modifiedR�R(R�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_file_equiv_modifiedXs
cCs3tr
tSt|�att|ddt�atS(Ns
.subs_distR�(t
file_equivR�R�RJ(R�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_file_equivcs
cCs�tr
tSgay,t|dd��}|j�}WdQXWn,tk
rj}|jtjkrf�ngSXx�|D]�}|j�}t|�dkr�qrnyDt|�dkr�t|d}nd}tj	|d|f�Wqrt
k
r�qrXqrWtS(Ns.localRgiiiRN(tlocal_filesRiRjR�R�R�R^R!ttrans_file_type_strR.R2(R�RoR�ReR:trecRt((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_local_file_pathsns,

cCs[tr
tSt|d�}|j�}|j�y0t|dd��}||j�7}WdQXWn+tk
r�}|jtjkr��q�nXiay0t|dd��}||j�7}WdQXWn+tk
r�}|jtjkr��q�nXx�|D]�}|j�}y�t|�dkr0t	|d}nd}|djd�d}|tkrut|d	j
|d
�ni|d
gd	6|d6t|<Wq�q�Xq�Widgd	6td
<idgd	6td<idgd	6td<idgd	6td<idgd	6td<idgd	6td<idgd	6td<idgd	6td<idgd	6td<tS(NRgs	.homedirss.localiiRNi����t:RsiRts
all log filestlogfilesall user tmp filest
user_tmp_typesall user home filestuser_home_typesall virtual image filestvirt_image_typesBall files on file systems which do not support extended attributest	noxattrfss)all sandbox content in tmpfs file systemstsandbox_tmpfs_types&all user content in tmpfs file systemstuser_tmpfs_typesall files on the systemt	file_typesAuse this label for random content that will be shared using sambat
samba_share_t(R|RiRjRkR�R�R�R^R!R�R.(R�RoR�ReR:R�RtR�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRx�sP



#cCsVy>gttgidd6�D]}|d|kr|^qSWntk
rQnXdS(NtprocessR
t	transtype(R Rt	TypeErrorRG(RR'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_transitions_into�s
>
cCs:y"ttgi|d6dd6�SWntk
r5nXdS(NR
R�R
(R RR�RG(R((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_transitions�s
"
cCsVy>gttgi|d6�D]}|ddkr|^qSWntk
rQnXdS(NR
R
R�(R RR�RG(RR'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_file_transitions�s
>
cCs�g}ttgi|d6�}x\|D]T}d|kr&y5x.|dD]"}||krF|j|�qFqFWWqzqzXq&q&W|S(NR
R)(R RR.(RR)tboollistRRVRS((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_boolean_rules�s
cCs
td�S(NRL(RB(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_entrypoints�scCs�g}yhggttgi|d6dgd6dd6�D]}|d|kr7|^q7D]}|d^qW}Wntk
r�nX|S(NR
t
entrypointRRR
R(R RR�(RtentrypointsR'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_entrypoint_types�sh
cCs�tj|�djd�d}yigttgidd6dd6�D]}|d|krD|^qD}t|�d	kr|dS|d	d
SWntk
r�nXdS(NiR�itinit_tR
R�R
RiR�(tselinuxt
getfileconR^R RR!RGR�(R�R�R'R�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_init_transtype�s C
cCs�yigttgidd6dd6�D]}|d|kr$|^q$}t|�dkr\dS|ddSWntk
r|nXdS(NR�R
R�R
R�iR(R RR!RGR�(R�R'R�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_init_entrypoint�sC
cCsbyJgttgidd6|d6dd6�D]}|d^q+}|dSWntk
r]nXdS(NR�R
RR�R
R�i(R RR�RG(R�R'R�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_init_entrypoint_targets>
cCspt�}i}xZt|�D]L}y(||dt||df||<Wqtk
rgg||<qXqW|S(NRsRt(RxR�RyR2(RR|R{RO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR�s	(
cCsI|jdd�d}yt|�|fSWntk
rDd|fSXdS(Ns/policy.ii(trsplittintR(tpolicy_patht	extension((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytpolicy_sortkeys

R�cCs_y?|tj�}tjd|�}|jdt�|dSWnnXttd���dS(Ns%s.*tkeyi����sNo SELinux Policy installed(R�tselinux_binary_policy_pathtglobtsortR�RR(trootR�tpolicies((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_installed_policy%scCsAtjdtj�|f�}|s)dS|jdt�|dS(s?Get the path to the policy file located in the given store names%s%s/policy/policy.*R�i����N(R�R�tselinux_pathRGR�R�(tstoreR�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_store_policy0s	cCs�tt�dkrtSt�tj�}yHt|�}tj�}|j|�t	|jj
��a|j�Wn(tj
jd|�tjd�nXtj�tS(Nis#could not open interface info [%s]
i(R!tmethodstgen_interfacestdefaultstinterface_infoRit
interfacestInterfaceSett	from_fileR�R�RktsysRXR~texitR�(tfnRotifs((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_methods>s

cCs6tdkr2gtt�D]}|d^qantS(NR(t	all_typesRGRRD(R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
get_all_typesUs&cCs*tdkr&ttd�ddantS(Nt
userdomainiR#(t
user_typesRGRR@(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_user_types^scCs�tr
tSiax~ttg�D]m}|ddks |ddkrLq n|dtkrxt|dj|d�q |dgt|d<q WtS(NR
tsystem_rR(trole_allowsR RR.(Rg((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_role_allowsgs cCs�ddl}g}t�}|j�x{|D]s}|jd|�}t|�dkr,t|jd|d��dkr�|d|kr�|j|d�q�q,q,W|S(Ni����s(.*)%ss_exec_t$is_initrc$s(.*)_exec_t$s(.*)_initrc$(R�R�R�tfindallR!R.(R�tall_domainsR#R:Rq((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_entrypoint_domainsws	

2cCs�tj�}tj�}t}y,tj|�jtj|�jkrIdSWntk
r]nXtj�dkr�t	t
d���ntjddtj
dt�GHdS(NisEYou must regenerate interface info by running /usr/bin/sepolgen-ifgens/usr/bin/sepolgen-ifgenRXRY(R�R�theadersRJR�tstattst_mtimetOSErrortgetuidRRR[R\R]R(tifileR�trebuild((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR��s$
	cCs>trttfSiaiaxtt�D]}|d|dkrVt|d�}n$dt|d�t|d�f}|d|dftkr�t|d|dfj|�n|gt|d|df<d|kr
|d|dft|d|d|df<q)|dt|d|d|df<q)WttfS(Ntlowthighs%s-%sttypetprotocoltrange(tportrecst
portrecsbynumRtPORTtstrR.(R:tport((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
gen_port_dict�s
$"0'cCs$ts ttd�ddantS(NR�iR#(R�RR@(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_domains�scCs<t|d�t|d�kt|d�t|d�kS(Ni(R�(R'R;((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytmls_cmp�scCs[tr
tStt�}|j�}|jdtjt��d|d||dfatS(NR�s%s-%sii����(	t	mls_rangetmls_rangerolesRtSENSR�R�Rt
cmp_to_keyR(t
range_dictR�((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
get_mls_range�scCsHtr
tSgtt�D]}|d^qatjd�tj�tS(NRtobject_r(trolesRtROLEtremoveR�(R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
get_all_roles�s#

cCsJtsFtt�ax1tD]&}dj|djd��|d<qWntS(NRWR�Rh(tselinux_user_listRtUSERRR^(R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_selinux_users�s

'cCs�tr
tSttj�d�}|j�}|j�gax�|jd�D]}|j�}t|�dksK|j	d�r�qKn|jd�}tj
i|dd6|dd6dj|d	�d
6�qKWtS(NRgs
it#R�Ritseuseritmls(tlogin_mappingsRiR�tselinux_usersconf_pathtreadRkR^tstripR!RvR.R(RotbufRSR'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_login_mappings�s
!;cCs.gt�D]}|d^q
}|j�|S(NR(RR�(R'tusers((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
get_all_users�s 
cCs/tr
tSttd�ddatj�tS(NR�iR#(R�RR@R�(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRu�s

cCs/tr
tSttd�ddatj�tS(Nt	port_typeiR#(t
port_typesRR@R�(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_port_types
s

cCststt�antS(N(tboolsRtBOOLEAN(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
get_all_boolsscCs!dj|t|� jd��S(NRhR(RR!R^(ROttrim((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytprettyprintscCs|S(N((RO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytmarkup stetc_ts/etcttmp_ts/tmptunit_file_ts/usr/lib/systemd/systems/lib/systemd/systems/etc/systemd/systemtvar_cache_ts
/var/cachet	var_lib_ts/var/libtlog_ts/var/logt	var_run_ts/var/runs/runt
var_lock_ts	/run/locks
/var/run/locktvar_spool_ts
/var/spoolt	content_ts/var/wwwcCsCd||�}|jd�r4|dt|d�S|jd�rX|dt|d�S|jd�r||dt|d�S|jd�r�|d	t|d�S|jd
�r�|dt|d�S|jd�r�|dt|d�S|jd
�s|jd�r|dS|jd�r%|dS|jd�rI|dt|d�S|jd�rm|dt|d�S|jd�r�|dt|d�S|jd�r�|dt|d�S|jd�r�|d|td� S|jd�r�|dt|d�S|jd�r#|dt|d�S|jd�rG|dt|d�S|jd �rk|dt|d �S|jd!�r�|d"t|d!�S|jd#�r�|d$t|d%�S|jd&�r�|d't|d&�S|jd(�r�|d)t|d(�S|jd*�r|d+t|d(�S|jd,�rC|d$t|d,�S|jd-�rg|d.t|d-�S|jd/�r�|d0t|d/�S|jd1�r�|d2t|d1�S|jd3�r�|d4t|d3�S|jd5�r�|d2t|d5�S|jd6�r|d2t|d6�S|jd7�r?|d2t|d7�S|jd6�rc|d8t|d6�S|jd9�r�|d:t|d9�S|jd;�r�|d<t|d9�S|jd=�r�|d>t|d=�S|jd?�r�|d@t|d?�S|jdA�r
|dBS|jdC�r.|dDt|dC�S|dEt|dF�S(GNs+Set files with the %s type, if you want to t
_var_run_ts8store the %s files under the /run or /var/run directory.t_pid_ts,store the %s files under the /run directory.t
_var_lib_ts0store the %s files under the /var/lib directory.t_var_ts,store the %s files under the /var directory.t_var_spool_ts2store the %s files under the /var/spool directory.t_spool_tt_cache_tt_var_cache_ts/store the files under the /var/cache directory.t	_keytab_ts)treat the files as kerberos keytab files.t_lock_tsEtreat the files as %s lock data, stored under the /var/lock directoryt_log_tsKtreat the data as %s log data, usually stored under the /var/log directory.t	_config_tsRtreat the files as %s configuration data, usually stored under the /etc directory.t_conf_tR�s,transition an executable to the %s_t domain.t_cgi_content_ts"treat the files as %s cgi content.t
_rw_content_ts)treat the files as %s read/write content.t_rw_tt_write_tt_db_ts'treat the files as %s database content.t
_ra_content_ts*treat the files as %s read/append content.t_ra_conten_tt_cert_ts'treat the files as %s certificate data.t_key_tstreat the files as %s key data.t	_secret_ts"treat the files as %s secret data.t_ra_tt_ro_ts(treat the files as %s read/only content.t
_modules_tstreat the files as %s modules.t
_content_tstreat the files as %s content.t_state_ts!treat the files as %s state data.t_files_tt_file_tt_data_tstreat the data as %s content.t_tmp_ts1store %s temporary files in the /tmp directories.t_etc_ts'store %s files in the /etc directories.t_home_ts+store %s files in the users home directory.t_tmpfs_ts&store %s files on a tmpfs file system.t_unit_file_ts#treat files as a systemd unit file.t_htaccess_ts#treat the file as a %s access file.streat the files as %s data.R((R*R(R!(ROR)ttxt((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_description5s�cCs0ts,gtt�D]}|d^qantS(NR(R�RR@(R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR��s&cCskdadadadadadadadada	yt
j|�Wntt
d�|��nXdS(NsFailed to read %s policy file(RGR�R�R$R�R�RRR�R"RRRR(tpolicy_file((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR�s
cCs$t|�}|sdSt|�dS(N(R�RGR(R�R[((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytload_store_policy�scCs)x"|D]}||tkrtSqWtS(N(RRJR(tdictR&R6((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyR"�s
cCs�t�}|jd�r%|d }n|}t|d�|krTtd|��n|ddkru|d d}n
|d}||fS(NR(i����sdomain %s_t does not existi����RQR(RR*RHR(RR�t
domainnamet
short_name((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyRw�s	

c	Cs�g}g}t|�\}}xiggttgi|d6�D]}d|kr>|^q>D]}|d^qZD]}x|D]}t|t�s�q{nytj|d�}Wntk
r�|d}nX|dj|�s�|dj|�r;|d|f|kr�|d|f|kr�|j	|d|f�q�q{|d|f|kr{|d|f|kr{|j	|d|f�q{q{WqnW||fS(NR
R)ii(
RwR Rt
isinstancettupleR�tsecurity_get_boolean_activeR�RvR.(	RR$tdomainboolsR^R_R'R:RSR>((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt	get_bools�s"V

&--"cCsKtsGtj�datjrGgtD]}tj|�^q&aqGntS(Ni(tbooleansR�tsecurity_get_boolean_namesRtPY3tdecode_input(R'((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_all_booleans�s
	(s#/usr/share/selinux/devel/policy.xmlcCscy)tj|�}|j�}|j�Wn3tk
r^t|�}|j�}|j�nX|S(N(tgzipRiRRkR�(R�RoR((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
policy_xml�s
c
Cs�tr
tSddl}ddl}iayE|jjjt|��}x�|jd�D]�}x|jd�D]}x~|jd�D]m}|jd�jd�j	j
d�}|jdd|�}|jd	�|jd
�|ft|jd	�<q�Wx~|jd�D]m}|jd�jd�j	j
d�}|jdd|�}|jd	�|jd
�|ft|jd	�<qWqlWxu|jd�D]d}|jd�jd�j	j
d�}|jdd|�}d|jd
�|ft|jd	�<q�WqVWxu|jd�D]d}|jd�jd�j	j
d�}|jdd|�}d|jd
�|ft|jd	�<qWWnt
k
r�}	nXtS(
Ni����tlayertmodulettunabletdescRVs
RhRtdftvaltbooltglobal(t
booleans_dicttxml.etree.ElementTreeR�tetreetElementTreet
fromstringRkR�tfindttextRtsubtgetR�(
R�txmlR�ttreeRURqRSRoR:Re((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt
gen_bool_dicts8$2$6$-$-cCs5t�}||kr't||d�Std�SdS(Nitunknown(R~R(R)Rs((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytboolean_category's	cCsYt�}||kr't||d�S|jd�}d|ddj|d�fSdS(NiRsAllow %s to %siRhi(R~RR^R(R)RsRo((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytboolean_desc/s
	cCsOd}y+td��}|j�j�}WdQXWntk
rJd}nX|S(NRWs/etc/system-releasetMisc(RitreadlinetrstripR�(tsystem_releaseRO((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytget_os_version8s

cCsvdadadadadadadadada	da
da
dadada
dadadadadadS(N(RGR�R�R�ReRsR$R|R�R�R�RRR"R�RR�RR(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pytreinitCs&(�RWRRR�R�R�tPROGNAMEtgettexttsepolgen.defaultsR�tsepolgen.interfacesR�tsepolgenRR�R[tbindtextdomaint
textdomaintinstallRR�R�tbuiltinsRt__dict__RDRR@RRR%R-tTCLASSR
tCATSRRRRR+R,RRRRGRR R<R?RBRERHRKRMRyRR�RfRrR}R�R�R�R�R�R�R�R�tselinux_file_context_pathR�R�R�R�R�R|RxR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRR�RR�RRRR
RRRRRRR R�RuR"R#R$R&R(R)tDEFAULT_DIRSRZR�R�R\R[RRetis_selinux_enabledR"RwRdReRiRsRjRkR~R�R�R�R�(((s7/usr/lib64/python2.7/site-packages/sepolicy/__init__.pyt<module>s^



																			







				$		1													
											
										













\				
				 				

Zerion Mini Shell 1.0