/usr/lib64/python2.6/site-packages/sepolgen
NameSizeModeActions
access.py116390644editdlrm
access.pyc126950644editdlrm
access.pyo126950644editdlrm
audit.py207060644editdlrm
audit.pyc205140644editdlrm
audit.pyo205140644editdlrm
classperms.py28010644editdlrm
classperms.pyc32000644editdlrm
classperms.pyo32000644editdlrm
defaults.py12870644editdlrm
defaults.pyc15160644editdlrm
defaults.pyo15160644editdlrm
interfaces.py165090644editdlrm
interfaces.pyc160510644editdlrm
interfaces.pyo160510644editdlrm
lex.py335860644editdlrm
lex.pyc201030644editdlrm
lex.pyo201030644editdlrm
matching.py86290644editdlrm
matching.pyc74860644editdlrm
matching.pyo74860644editdlrm
module.py72180644editdlrm
module.pyc85650644editdlrm
module.pyo85650644editdlrm
objectmodel.py65240644editdlrm
objectmodel.pyc47900644editdlrm
objectmodel.pyo47900644editdlrm
output.py50310644editdlrm
output.pyc45240644editdlrm
output.pyo45240644editdlrm
policygen.py144270644editdlrm
policygen.pyc140950644editdlrm
policygen.pyo140260644editdlrm
refparser.py290300644editdlrm
refparser.pyc344630644editdlrm
refparser.pyo344630644editdlrm
refpolicy.py264480644editdlrm
refpolicy.pyc442310644editdlrm
refpolicy.pyo442310644editdlrm
sepolgeni18n.py9120644editdlrm
sepolgeni18n.pyc4100644editdlrm
sepolgeni18n.pyo4100644editdlrm
util.py25730644editdlrm
util.pyc27220644editdlrm
util.pyo27220644editdlrm
yacc.py820750644editdlrm
yacc.pyc432200644editdlrm
yacc.pyo432200644editdlrm
__init__.py00644editdlrm
__init__.pyc1420644editdlrm
__init__.pyo1420644editdlrm
Edit: /usr/lib64/python2.6/site-packages/sepolgen/module.pyc (8565B)
Ñò Ô<*Xc @s®dZddkZddkZddkZddkZddkZddkZddkZddkZddk Z d„Z dd d„ƒYZ d„Z dd d„ƒYZ dS( sU Utilities for dealing with the compilation of modules and creation of module tress. iÿÿÿÿNcCsCtid|ƒ}t|ƒdjo|diƒotStSdS(s'Check that a module name is valid. s[^a-zA-Z0-9_\-\.]iN(tretfindalltlentisalphatTruetFalse(tmodnametm((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyt is_valid_name%s$t ModuleTreecBsSeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zdd„Z RS( cCs||_d|_dS(N(RtNonetdirname(tselfR((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyt__init__/s cCs|iS(N(R (R ((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytdir_name3scCs|id|idS(Nt/s.te(R R(R ((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytte_name6scCs|id|idS(NRs.fc(R R(R ((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytfc_name9scCs|id|idS(NRs.if(R R(R ((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytif_name<scCs|id|idS(NRs.pp(R R(R ((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyt package_name?scCs |idS(Ns /Makefile(R (R ((s5/usr/lib64/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(R tparent_dirnametmakefile_includetfd((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytcreateEs N( t__name__t __module__R RRRRRRR R (((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyR .s       cCs$tiitii|ƒdƒdS(Nii(Rtpathtsplitexttsplit(t sourcename((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytmodname_from_sourcenameUstModuleCompilercBs\eZdZd d„Zd„Zd„Zd„Zed„Z d„Z d„Z d„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_enabledtmlsRtmodulet checkmoduletsemodule_packagetoutputt last_outputtrefpol_makefiletmake(R R0((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyR qs      cCs/|io|ii|dƒn||_dS(Ns (R0RR1(R tstr((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyto~s cCs3|i|ƒti|ƒ\}}|i|ƒ|S(N(R5tcommandstgetstatusoutput(R tcommandtrcR0((s5/usr/lib64/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(R R&t splitnametbasenameRt packagename((s5/usr/lib64/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_buildRAtcompiletpackageRtunlink(R R&t refpolicyRR@((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pytcreate_module_package›s cCsK|id|i}|i|ƒ}|djotd|iƒ‚ndS(Ns -f iscompilation failed: %s(R3R2R:R<R1(R R&R8R9((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyRB³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-R:R=R<R1(R R&RtsR9((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyRC¼s       cCs€|ig}|idƒ|i|ƒ|idƒ|i|ƒ|idi|ƒƒ}|djotd|iƒ‚ndS(Ns-os-mRHispackaging failed [%s](R/RIR:R=R<R1(R RR@RJR9((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyRDÊs      N( R!R"t__doc__R R R5R:RARRGRBRCRD(((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyR(Xs     (((RKRR*RttempfileR6Rtos.patht subprocesstshutilRR R'R((((s5/usr/lib64/python2.6/site-packages/sepolgen/module.pyts          '