[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.15.192.89: ~ $
�
��^c@s�dZddlZddlZddlmZddlmZddlmZddlmZddlm	Z	d	dd
��YZ
d�Zd�Zd
�Z
d�Zd�Zddd��YZddd��YZddd��YZddd��YZdS(s7
Classes for representing and manipulating interfaces.
i����Ni(taccess(t	refpolicy(tobjectmodel(tmatching(t_tParamcBsSeZdZd�Zd�Zd�Zeee�Zedd��Zd�Z	RS(s;
    Object representing a paramater for an interface.
    cCs1d|_tj|_tj�|_t|_dS(Nt(t_Param__nameRtSRC_TYPEttypetIdSettobj_classestTruetrequired(tself((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt__init__&s	cCs/tj|�s"td|��n||_dS(NsName [%s] is not a param(Rt
is_idparamt
ValueErrorR(Rtname((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytset_name,scCs|jS(N(R(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytget_name1stfgetcCst|jd�S(Ni(tintR(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt<lambda>6scCs*d|jtj|jdj|j�fS(Ns0<sepolgen.policygen.Param instance [%s, %s, %s]>t (RRtfield_to_strR	tjoinR(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt__repr__8s(
t__name__t
__module__t__doc__RRRtpropertyRtnumR(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR"s			cCs+d}||kr�||}||jkr/dS|tjksM|tjkr�|jtjksq|jtjkr�d}|r�|jg}ng}x6tj|j|�D]}|tj	kr�d}Pq�q�Wtj|_qd}n(t
�}||_||_|||j<|r'|jj|j�n|S(Nii(
R	RRtTGT_TYPEt	obj_classt	itertoolstchainRRtimplicitly_typed_objectsRRtadd(RR	tavtparamstrettptavobjstobj((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt__param_insert>s0
$				
cCsd}t}tj|j�rKt|jtj||�dkrKd}qKntj|j�r�t|jtj||�dkr�d}q�ntj|j	�r�t|j	tj
||�dkr�d}q�nxA|jD]6}tj|�r�t|t�dkr	d}q	q�q�W|S(sjExtract the paramaters from an access vector.

    Extract the paramaters (in the form $N) from an access
    vector, storing them as Param objects in a dictionary.
    Some attempt is made at resolving conflicts with other
    entries in the dict, but if an unresolvable conflict is
    found it is reported to the caller.

    The goal here is to figure out how interface paramaters are
    actually used in the interface - e.g., that $1 is a domain used as
    a SRC_TYPE. In general an interface will look like this:

    interface(`foo', `
       allow $1 foo : file read;
    ')

    This is simple to figure out - $1 is a SRC_TYPE. A few interfaces
    are more complex, for example:

    interface(`foo_trans',`
       domain_auto_trans($1,fingerd_exec_t,fingerd_t)

       allow $1 fingerd_t:fd use;
       allow fingerd_t $1:fd use;
       allow fingerd_t $1:fifo_file rw_file_perms;
       allow fingerd_t $1:process sigchld;
    ')

    Here the usage seems ambigious, but it is not. $1 is still domain
    and therefore should be returned as a SRC_TYPE.

    Returns:
      0  - success
      1  - conflict found
    ii(
tFalseRRtsrc_typeR-RRttgt_typeR!R"t	OBJ_CLASStpermstPERM(R'R(R)t	found_srctperm((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytav_extract_paramsjs $!!!cCs/tj|j�r+t|jtjd|�SdS(N(RRtroleR-RtROLEtNone(R7R(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytrole_extract_params�scs��fd�}d}||jtj�r3d}n||jtj�rQd}n||jtj�rod}ntj|j	�r�t
|j	tjd��r�d}q�n|S(NcsKd}x>|D]6}tj|�r
t||d��rCd}qCq
q
W|S(Nii(RRR-R9(tsetR	R)tx(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytextract_from_set�s
ii(
t	src_typesRRt	tgt_typesR!RR1RRt	dest_typeR-t	DEST_TYPER9(truleR(R=R)((R(s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyttype_rule_extract_params�s			cCsQd}xD|jD]9}tj|�rt|tjd|�rId}qIqqW|S(Nii(targsRRR-RRR9(tifcallR(R)targ((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytifcall_extract_params�stAttributeVectorcBseZd�Zd�ZRS(cCsd|_tj�|_dS(NR(RRtAccessVectorSet(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR�s	cCs|jj|�dS(N(Rtadd_av(RR'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRJ�s(RRRRJ(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRH�s	tAttributeSetcBs#eZd�Zd�Zd�ZRS(cCs
i|_dS(N(t
attributes(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR�scCs||j|j<dS(N(RLR(Rtattr((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytadd_attr�scCs�d�}d}x�|D]y}|d }|ddkr[|rL|j|�n||�}q|r|jd�}tj|�}|j|�qqW|r�|j|�ndS(NcSsb|dd!j�}t|�dks5|ddkrHtd|��nt�}|d|_|S(Nii����iit	Attributes#Syntax error Attribute statement %s(tsplittlentSyntaxErrorRHR(tlinetfieldsta((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt
parse_attr�s"	
i����it[t,(R9RNRPRtAccessVectorRJ(RtfdRVRURStlR'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt	from_file�s		

(RRRRNR\(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRK�s		tInterfaceVectorcBsGeZdid�Zid�Zd�Zd�Zd�Zd�ZRS(cCsPt|_d|_tj�|_i|_|rC|j||�nt|_dS(NR(	RtenabledRRRIR(tfrom_interfaceR.texpanded(Rt	interfaceRL((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR�s			c
Cs�|j|_xq|j�D]c}|jtjjkr:qnd|jkrOqntj|�}x|D]}|j|�qeWqW|rHx�|j	�D]�}x�|j
D]�}||j
kr�q�n|j
|}xo|jD]d}	tj|	�}|j|jkr|j
|_n|j|jkr,|j
|_n|j|�q�Wq�Wq�Wnx)|j�D]}
t|
|j�rUqUqUWx)|j�D]}t||j�r�q�q�Wx)|j�D]}t||j�r�q�q�WdS(Nt	dontaudit(Rtavrulest	rule_typeRtAVRuletALLOWRtavrule_to_access_vectorsRJttypeattributesRLtcopyR/R	R0trolesR:R(t	typerulesRCtinterface_callsRG(
RRaRLtavruletavsR't
typeattributeRMtattr_vecRUR7RBRE((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR_s>

cCs/t||j�dkrn|jj|�dS(Ni(R6R(RRJ(RR'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRJ8scCsNg}|jd|j�x$|jD]}|jt|��q$Wdj|�S(Ns[InterfaceVector %s]s
(tappendRRtstrR(RtsR'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt	to_string>s
cCs
|j�S(N(R(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt__str__EscCsd|j|jfS(Ns<InterfaceVector %s:%s>(RR^(R((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRHsN(	RRR9RR_RJRtRuR(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR]�s4			tInterfaceSetcBs�eZdd�Zd�Zd�Zd�Zd�Zd�Zid�Z	did�Z
d�Zd	�Zd
�Z
d�ZRS(
cCs(i|_i|_g|_||_dS(N(t
interfacesttgt_type_mapttgt_type_alltoutput(RRz((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRMs			cCs$|jr |jj|d�ndS(Ns
(Rztwrite(RRr((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytoSs	cCs�x�t|jj�dd��D]�}|jd|j�xJt|jj�dd��D]*}|jd|jtj|jf�qXW|jd�t|j	j
��}x1|D])}|jdj|��|jd�q�WqWdS(	NtkeycSs|jS(N(R(R<((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRXss[InterfaceVector %s cSs|jS(N(R(R<((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRZss%s:%s s]
RXs
(tsortedRwtvaluesR{RR(RRR	Rtto_listR(RRZtivtparamtavlR'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytto_fileWs%%(

cCs�d�}d}x�|D]y}|d }|ddkr[|rL|j|�n||�}q|r|jd�}tj|�}|j|�qqW|r�|j|�n|j�dS(NcSs�|dd!j�}t|�dks5|ddkrHtd|��nt�}|d|_t|�dkrtdSx�|dD]t}|jd�}t|�dkr�td|��nt�}|d|_tj|d|_||j	|j<qW|S(	Nii����iiR]s)Syntax error InterfaceVector statement %st:s-Invalid param in InterfaceVector statement %s(
RPRQRRR]RRRtstr_to_fieldR	R((RSRTtifvtfieldR*R�((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt	parse_ifvcs "	
	
i����iRWRX(R9tadd_ifvRPRRYRJtindex(RRZR�R�RSR[R'((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR\bs	

cCs||j|j<dS(N(RwR(RR�((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR��scCs�x�|jj�D]�}t�}xP|jD]E}tj|j�r^|jj|�t�}Pn|j|j�q)Wx0|D](}|j	j
|g�}|j|�qyWqWdS(N(RwRR;RRR0RyRqR&Rxt
setdefault(RR�R?R'R	R[((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR��s		
cCs t||�}|j|�dS(N(R]R�(RRaRLR�((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR&�scCsTx6tj|j�|j��D]}|j||�qW|j|�|j�dS(N(R#R$Rwt	templatesR&texpand_ifcallsR�(RtheadersRzRLti((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytadd_headers�s%
cCsqtj|�rft|d�}|t|j�kr8dS|j|d}t|t�r\|S|gSn|gSdS(Ni(RRRRQRDR9t
isinstancetlist(RtidRER RF((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt	map_param�s
c
Cs&|j|j|�}|dkr%dS|j|j|�}|dkrJdS|j|j|�}|dkrodStj�}xB|jD]7}|j||�}	|	dkr�q�q�|j|	�q�Wt	|�dkr�dSxI|D]A}
x8|D]0}x'|D]}|j
j|
|||�q�Wq�Wq�WdS(Ni(R�R/R9R0R"RR
R2tupdateRQRR&(
RR�R'RER>R?Rt	new_permsR5R*R/R0R"((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt
map_add_av�s*


cCsD|dfg}|j|j}t|_xt|�dkr?|jd�\}}|j|j}||kr�x$|jD]}|j|||�qxW|jr�q+q�nx�|j	�D]�}	|	j
|jkr�|jtd��dSy||	j
}
Wn.t
k
r$|jtd|	j
��q�nX|j|
|	f�q�Wq+WdS(Nii����sFound circular interface classs#Missing interface definition for %s(R9RwRRR`RQtpopRR�RltifnameR|RtKeyErrorRq(RRat
if_by_nametstackR�tcurt
cur_ifcalltcur_ifvR'REtnewif((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pytdo_expand_ifcalls�s*			
cCsyi}x3tj|j�|j��D]}|||j<q%Wx6tj|j�|j��D]}|j||�q[WdS(N(R#R$RwR�RR�(RR�R�R�Ra((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyR��s
%%N(RRR9RR|R�R\R�R�R&R�R�R�R�R�(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyRvLs			#					$((((((RRiR#RRRRRtsepolgeni18nRRR-R6R:RCRGRHRKR]Rv(((s9/usr/lib64/python2.7/site-packages/sepolgen/interfaces.pyt<module>s"	,	9			Z

Filemanager

Name Type Size Permission Actions
.__init__.pyo.40009 File 142 B 0644
.access.pyo.40009 File 13.18 KB 0644
.audit.pyo.40009 File 22.33 KB 0644
.classperms.pyo.40009 File 3.16 KB 0644
.defaults.pyo.40009 File 2.87 KB 0644
.interfaces.pyo.40009 File 15.86 KB 0644
.lex.pyo.40009 File 19.24 KB 0644
.matching.pyo.40009 File 7.4 KB 0644
.module.pyo.40009 File 8.4 KB 0644
.objectmodel.pyo.40009 File 4.64 KB 0644
.output.pyo.40009 File 4.51 KB 0644
.refparser.pyo.40009 File 36.27 KB 0644
.refpolicy.pyo.40009 File 46.45 KB 0644
.sepolgeni18n.pyo.40009 File 410 B 0644
.util.pyo.40009 File 7.87 KB 0644
.yacc.pyo.40009 File 41.4 KB 0644
__init__.py File 0 B 0644
__init__.pyc File 142 B 0644
__init__.pyo File 142 B 0644
access.py File 12.33 KB 0644
access.pyc File 13.18 KB 0644
access.pyo File 13.18 KB 0644
audit.py File 23.64 KB 0644
audit.pyc File 22.33 KB 0644
audit.pyo File 22.33 KB 0644
classperms.py File 2.75 KB 0644
classperms.pyc File 3.16 KB 0644
classperms.pyo File 3.16 KB 0644
defaults.py File 2.69 KB 0644
defaults.pyc File 2.87 KB 0644
defaults.pyo File 2.87 KB 0644
interfaces.py File 16.21 KB 0644
interfaces.pyc File 15.86 KB 0644
interfaces.pyo File 15.86 KB 0644
lex.py File 32.86 KB 0644
lex.pyc File 19.24 KB 0644
lex.pyo File 19.24 KB 0644
matching.py File 8.45 KB 0644
matching.pyc File 7.4 KB 0644
matching.pyo File 7.4 KB 0644
module.py File 7.12 KB 0644
module.pyc File 8.4 KB 0644
module.pyo File 8.4 KB 0644
objectmodel.py File 6.37 KB 0644
objectmodel.pyc File 4.64 KB 0644
objectmodel.pyo File 4.64 KB 0644
output.py File 5.01 KB 0644
output.pyc File 4.51 KB 0644
output.pyo File 4.51 KB 0644
policygen.py File 16.31 KB 0644
policygen.pyc File 15.25 KB 0644
policygen.pyo File 15.18 KB 0644
refparser.py File 30.2 KB 0644
refparser.pyc File 36.27 KB 0644
refparser.pyo File 36.27 KB 0644
refpolicy.py File 27.31 KB 0644
refpolicy.pyc File 46.45 KB 0644
refpolicy.pyo File 46.45 KB 0644
sepolgeni18n.py File 912 B 0644
sepolgeni18n.pyc File 410 B 0644
sepolgeni18n.pyo File 410 B 0644
util.py File 5.41 KB 0644
util.pyc File 7.87 KB 0644
util.pyo File 7.87 KB 0644
yacc.py File 80.04 KB 0644
yacc.pyc File 41.4 KB 0644
yacc.pyo File 41.4 KB 0644