ó 4®Þ]c@sŠddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl Z ddl TdZ ddl Z ddl mZmZmZeƒddlmZddlZeje dƒeje ƒyeje dedd ƒWnMek r?eje dd ƒn*ek rhddlZeejd „ƒYZ9d?e4fd@„ƒYZ:dAe4fdB„ƒYZ;dCe4fdD„ƒYZ<dEe4fdF„ƒYZ=dGe4fdH„ƒYZ>dIe4fdJ„ƒYZ?dKe4fdL„ƒYZ@dS(MiÿÿÿÿN(t*tpolicycoreutils(t boolean_desctboolean_categoryt gen_bool_dict(tIPs/usr/share/localetunicodetcodesetsutf-8t_ts all filestas regular files--tfs-dt directorytds-cscharacter devicetcs-bs block devicetbs-stsockettss-ltls symbolic linktps-ps named pipetanytblocktchartdirtfiletsymlinktpipetloggercBs_eZd„Zdddddddd„Zdddddddd„Zd„Zd„ZRS(cCs%tjƒ|_g|_g|_dS(N(tauditt audit_opentaudit_fdtlog_listtlog_change_list(tself((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__init__os R c CsÃd} ||kr)|| d7}d} n||krL|| d7}d} n||kro|| d7}d} n|jj|jtjtjdt|ƒ|d||||||dddgƒdS(Nt-tsenamet,troletrangeiR (RtappendRRtAUDIT_ROLE_ASSIGNtsystargvtstr( R!tmsgtnameR$tseroletseranget oldsenamet oldserolet oldserangetsep((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytlogts      c CsT|jj|jtjtjdt|ƒ|d||||||dddgƒdS(NiR (RR(RRtAUDIT_ROLE_REMOVER*R+R,( R!R-R.R$R/R0R1R2R3((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt log_removeƒscCs5|jj|jtjt|ƒddddgƒdS(NtsemanageR (R R(RRtAUDIT_USER_MAC_CONFIG_CHANGER,(R!R-((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt log_change†scCsfx%|jD]}tj||gŒq Wx%|jD]}tj||gŒq2Wg|_g|_dS(N(RRtaudit_log_semanage_messageR taudit_log_user_comm_message(R!tsuccessR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytcommit‰s  (t__name__t __module__R"R5R7R:R>(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRns   cBs_eZd„Zdddddddd„Zdddddddd„Zd„Zd„ZRS(cCs g|_dS(N(R(R!((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"’sR c Csêd||f} |dkr-| d|7} n|dkrJ| d|7} n|dkrg| d|7} n|dkr„| d|7} n|dkr­|dkr­| d|7} n|dkrÖ|dkrÖ| d|7} n|jj| ƒdS( Ns %s name=%sR s sename=s oldsename=s role=s old_role=s MLSRange=s old_MLSRange=(tNoneRR(( R!R-R.R$R/R0R1R2R3tmessage((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR5•s    c Cs&|j||||||||ƒdS(N(R5( R!R-R.R$R/R0R1R2R3((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR7¥scCs|jjd|ƒdS(Ns %s(RR((R!R-((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR:šscCsJ|dkrd}nd}x(|jD]}tjtj||ƒq%WdS(Nis Successful: sFailed: (RtsyslogtLOG_INFO(R!R=RBR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR>«s   (R?R@R"R5R7R:R>(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR‘s   t nullloggercBsVeZdddddddd„Zdddddddd„Zd„Zd„ZRS(R c CsdS(N(( R!R-R.R$R/R0R1R2R3((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR5Žsc CsdS(N(( R!R-R.R$R/R0R1R2R3((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR7·scCsdS(N((R!R-((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR:ºscCsdS(N((R!R=((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR>œs(R?R@R5R7R:R>(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRE³s cCsfd}d}|d|d}|d|d}|d|dd|d}tjd |d |ƒS( Nss[0-9]*sc[0-9]*s(\.s)?s(\,s)*s(-s(:t^t$(tretsearch(trawt sensitivitytcategoryt cat_ranget categoriestreg((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytvalidate_levelÀs icCsd}|dkr%d||f}n|}tj|ƒ\}}|dkrP|S|ri|t|ƒ}n|dkry|S|SdS(Nsa:b:c:is%s%siR (tselinuxtselinux_raw_to_trans_contexttlen(RJtprependtfillertcontexttrcttrans((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt translateÈs   cCsd}|dkr%d||f}n|}tj|ƒ\}}|dkrP|S|ri|t|ƒ}n|dkry|S|SdS(Nsa:b:c:is%s%siR (RQtselinux_trans_to_raw_contextRS(RXRTRURVRWRJ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt untranslateØs   tsemanageRecordscBskeZeZd Zd Zd„Zd„Zd„Z d„Z d„Z d„Z d„Z d„Zd„ZRS( cCsdt|_|j|ƒ|_tjƒ\}}|dksE||krTtƒ|_n tƒ|_dS(NR ( tFalsetnoreloadt get_handletshRQtselinux_getpolicytypeRtmylogRE(R!tstoreRWt localstore((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"ïs  cCs|st|_ndS(N(tTrueR^(R!tload((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt set_reloadúscCsFtjrtjStƒ}|s4ttdƒƒ‚ntj rf|dkrft||tƒ|t_nt |ƒs‘t |ƒttdƒƒ‚nt |ƒ}|t krÈt |ƒttdƒƒ‚nt |ƒ}|dkrÿt |ƒttdƒƒ‚nt|ƒatdkr6t |ƒttdƒƒ‚n|t_tjS(Ns Could not create semanage handleR s:SELinux policy is not managed or store cannot be accessed.sCannot read policy store.is'Could not establish semanage connections!Could not test MLS enabled status(R\thandletsemanage_handle_createt ValueErrorRt transactiontsemanage_select_storetSEMANAGE_CON_DIRECTRctsemanage_is_managedtsemanage_handle_destroytsemanage_access_checktSEMANAGE_CAN_READtsemanage_connecttsemanage_mls_enabledtis_mls_enabled(R!RcRhRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR_þs2               cCsttdƒƒ‚dS(NsNot yet implemented(RjR(R!((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt deleteall"scCs5tjrttdƒƒ‚n|jƒtt_dS(Ns(Semanage transaction already in progress(R\RkRjRtbeginRe(R!((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytstart%s  cCsAtjr dSt|jƒ}|dkr=ttdƒƒ‚ndS(Nis$Could not start semanage transaction(R\Rktsemanage_begin_transactionR`RjR(R!RW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRv+s   cCsttdƒƒ‚dS(NsNot yet implemented(RjR(R!((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt customized2scCs}tjr dS|jr)t|jdƒnt|jƒ}|dkri|jjdƒtt dƒƒ‚n|jjdƒdS(Nis%Could not commit semanage transactioni( R\RkR^tsemanage_set_reloadR`tsemanage_commitRbR>RjR(R!RW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR>5s   cCs5tjsttdƒƒ‚ntt_|jƒdS(Ns$Semanage transaction not in progress(R\RkRjRR]R>(R!((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytfinishAs  N(R?R@R]RkRARhRcR"RgR_RuRwRvRyR>R|(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR\ês  $     t moduleRecordscBs_eZd„Zd„Zd„Zeed„Zd„Zd„Z d„Z d„Z d„Z RS( cCstj||ƒdS(N(R\R"(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"Jsc Cs’g}t|jƒ\}}}|dkr?ttdƒƒ‚nx t|ƒD]}t||ƒ}t|j|ƒ\}}|dkršttdƒƒ‚nt|j|ƒ\}}|dkrÓttdƒƒ‚nt|j|ƒ\}} |dkr ttdƒƒ‚nt |j|ƒ\}} |dkrEttdƒƒ‚n|j ||| | fƒqLW|j dd„d t ƒ|j dd „ƒ|S( NisCould not list SELinux modulessCould not get module namesCould not get module enabledsCould not get module prioritysCould not get module lang_exttkeycSs|dS(Ni((tt((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytistreversecSs|dS(Ni((R((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR€js( tsemanage_module_list_allR`RjRR'tsemanage_module_list_nthtsemanage_module_info_get_namet semanage_module_info_get_enabledt!semanage_module_info_get_priorityt!semanage_module_info_get_lang_extR(tsortRe( R!RRWtmlisttnumbertitmodR.tenabledtprioritytlang_ext((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytget_allMs,     cCsd|jƒ}t|ƒdkr"dSgg|D]}|ddkr,|^q,D]}d|d^qLS(Niis-d %s(RRS(R!tALLRtx((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRyms cCs¶|jƒ}t|ƒdkr"dS|rOdtdƒtdƒtdƒfGHnx`|D]X}|ddkr{tdƒ}n|r‡qVnd}d |d|d |d |fGHqVWdS( Nis %-25s %-9s %s s Module NametPrioritytLanguageitDisabledR s%-25s %-9s %-5s %sii(RRSR(R!theadingt locallistR‘Rtdisabled((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytlistss ' cCs¬|sttdƒƒ‚ntjj|ƒsFttdƒ|ƒ‚nt|j|ƒ}|dkr}ttdƒ|ƒ‚nt|j|ƒ}|dkrš|jƒndS(NsYou did not define module name.sModule does not exists %s is3Invalid priority %d (needs to be between 1 and 999)( RjRtostpathtexiststsemanage_set_default_priorityR`tsemanage_module_install_fileR>(R!tmoduleRŽRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytaddƒs  cCs|sttdƒƒ‚nxÙ|jƒD]Ë}t|jƒ\}}|dkrdttdƒƒ‚nt|j||ƒ}|dkršttdƒƒ‚nt|j||ƒ}|dkr(|rÚttdƒ|ƒ‚qóttdƒ|ƒ‚q(q(W|jƒdS(NsYou did not define module name.isCould not create module keysCould not set module key namesCould not enable module %ssCould not disable module %s(RjRtsplittsemanage_module_key_createR`tsemanage_module_key_set_nametsemanage_module_set_enabledR>(R!RŸtenabletmRWR~((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt set_enabled‘s   cCsZtjj|ƒs+ttdƒ|ƒ‚nt|j|ƒ}|dkrV|jƒndS(NsModule does not exists %s i(RšR›RœRjRRžR`R>(R!RRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytmodifyŠs  cCsº|sttdƒƒ‚nt|j|ƒ}|dkrRttdƒ|ƒ‚nxW|jƒD]I}t|j|ƒ}|dkr_|dkr_ttdƒ|ƒ‚q_q_W|jƒdS(NsYou did not define module name.is3Invalid priority %d (needs to be between 1 and 999)iþÿÿÿs*Could not remove module %s (remove failed)(RjRRR`R¡tsemanage_module_removeR>(R!RŸRŽRWRŠ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytdelete¯s cCskgg|jƒD]}|ddkr|^qD]}|d^q0}x|D]}|j|tƒqMWdS(Nii(RR§Re(R!RR’RRŠ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuœsF ( R?R@R"RRyReR]R™R R§RšRªRu(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR}Hs     tdontauditClasscBseZd„Zd„ZRS(cCstj||ƒdS(N(R\R"(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"ÅscCsQ|dkr!ttdƒƒ‚n|jƒt|j|dkƒ}|jƒdS(Ntontoffs'dontaudit requires either 'on' or 'off'(R¬R­(RjRRvtsemanage_set_disable_dontauditR`R>(R!t dontauditRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyttoggleÈs   (R?R@R"R°(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR«Ãs tpermissiveRecordscBsDeZd„Zd„Zeed„Zd„Zd„Zd„Z RS(cCstj||ƒdS(N(R\R"(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"ÒscCs§g}t|jƒ\}}}|dkr?ttdƒƒ‚nxat|ƒD]S}t||ƒ}t|ƒ}|rL|jdƒrL|j|j dƒdƒqLqLW|S(NisCould not list SELinux modulest permissive_i( tsemanage_module_listR`RjRR'Rƒtsemanage_module_get_namet startswithR(R¡(R!RRWR‰RŠR‹RŒR.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRÕs  !cCsággtjtjƒD]}|dr|^qD]}|d^q0}t|ƒdkr\dS|jƒ}|r€dtdƒGHnx|D] }|GHq‡W|r dS|rždtdƒGHnx"|D]}||kr¿|GHq¿q¿WdS(Nt permissiveR.is %-25s sCustomized Permissive TypessBuiltin Permissive Types(tsepolicytinfotTYPERSRR(R!R–R—R’tyR‘RyR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR™âsF     cCsçddl}|tjƒkr7ttdƒ|ƒ‚nyddlj}Wn#tk rottdƒƒ‚nXd|}d|}t|j |t |ƒ|dƒ}|dkrŸ|j ƒn|dkrãttdƒ|ƒ‚ndS( Niÿÿÿÿs%s is not a domain typesÏThe sepolgen python module is required to setup permissive domains. In some distributions it is included in the policycoreutils-devel patckage. # yum install policycoreutils-devel Or similar for your distro.s permissive_%ss(typepermissive %s)tcilis?Could not set permissive domain %s (module installation failed)( tglobR·tget_all_domainsRjRtsepolgen.moduleRŸt ImportErrortsemanage_module_installR`RSR>(R!tsetypeRŒRŸR.tmodtxtRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ÷s    !   cCs`xO|jƒD]A}t|jd|ƒ}|dkr ttdƒ|ƒ‚q q W|jƒdS(Ns permissive_%sis5Could not remove permissive domain %s (remove failed)(R¡R©R`RjRR>(R!R.tnRW((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRª s  cCs;|jƒ}t|ƒdkr7|jdj|ƒƒndS(Nit (RRSRªtjoin(R!R((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRus ( R?R@R"RReR]R™R RªRu(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR±Ðs     t loginRecordscBsŒeZdd„Zd„Zd„Zdd d„Zdd d„Zd„Zd„Z d„Z d „Z e d „Z d „Zee d „ZRS(R cCs8tj||ƒd|_d|_d|_d|_dS(N(R\R"RAR1R3R$R0(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"s    c Csútj|ƒ\}|_|_|dkr3d}ntƒ}|j|jƒd\}}|j|ƒ\}\}} tdkr|r”t|ƒ}q|}nt|j |ƒ\}} |dkrÚt t dƒ|ƒ‚nt |j | ƒ\}} |dkrt t dƒ|ƒ‚n| r:t | ƒ|j|||ƒS|ddkr†ytj|dƒWq·t t dƒ|dƒ‚q·Xn1ytj|ƒWnt t d ƒ|ƒ‚nXt|j ƒ\}} |dkrñt t d ƒ|ƒ‚nt|j | |ƒ}|dkr+t t d ƒ|ƒ‚n|rnt|j | |ƒ}|dkrnt t d ƒ|ƒ‚qnnt|j | |ƒ}|dkršt t d ƒ|ƒ‚nt|j | | ƒ}|dkrât t dƒ|ƒ‚nt | ƒt| ƒdS(NR tuser_uiisCould not create a key for %ss2Could not check if login mapping for %s is definedt%sLinux Group %s does not existsLinux User %s does not exists%Could not create login mapping for %ssCould not set name for %ssCould not set MLS range for %ss!Could not set SELinux user for %ss"Could not add login mapping for %s(RQtgetseuserbynameR1R3tseluserRecordstgetRtR[tsemanage_seuser_key_createR`RjRtsemanage_seuser_existstsemanage_seuser_key_freet_loginRecords__modifytgrptgetgrnamtpwdtgetpwnamtsemanage_seuser_createtsemanage_seuser_set_nametsemanage_seuser_set_mlsrangetsemanage_seuser_set_senametsemanage_seuser_modify_localtsemanage_seuser_free( R!R.R$R0trectuserrecRWR2tRANGER/tkRœtu((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__add s\        !      cCsKy+|jƒ|j|||ƒ|jƒWntk rF}|‚nXdS(N(Rvt_loginRecords__addR>Rj(R!R.R$R0terror((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ]s  c CsWtj|ƒ\}|_|_|dkrF| rFttdƒƒ‚ntƒ}|j|jƒ\}\}}|dkr—|j|ƒ\}\}} n|} |r¯||_n ||_t |j |ƒ\}} |dkrõttdƒ|ƒ‚nt |j | ƒ\}} |dkr2ttdƒ|ƒ‚n| sQttdƒ|ƒ‚nt |j | ƒ\}} |dkrŽttdƒ|ƒ‚nt | ƒ|_t| ƒ|_|rÎt|j | t|ƒƒn|dkrùt|j | |ƒ||_n |j|_t|j | | ƒ}|dkr?ttdƒ|ƒ‚nt| ƒt| ƒdS( NR sRequires seuser or serangeisCould not create a key for %ss2Could not check if login mapping for %s is defineds#Login mapping for %s is not definedsCould not query seuser for %ss%Could not modify login mapping for %s(RQRÉR1R3RjRRÊRËR0RÌR`RÍtsemanage_seuser_querytsemanage_seuser_get_mlsrangetsemanage_seuser_get_senameRÖR[R×R$RØRÎRÙ( R!R.R$R0RÚRÛRÜRWR2R/RÝRœRÞ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__modifyesF            cCsKy+|jƒ|j|||ƒ|jƒWntk rF}|‚nXdS(N(RvRÏR>Rj(R!R.R$R0Rá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRš—s  c Cs»tj|ƒ\}|_|_tƒ}|j|jƒ\}\}}t|j|ƒ\}}|dkr‚tt dƒ|ƒ‚nt |j|ƒ\}}|dkr¿tt dƒ|ƒ‚n|sÞtt dƒ|ƒ‚nt |j|ƒ\}}|dkrtt dƒ|ƒ‚n|s:tt dƒ|ƒ‚nt |j|ƒ}|dkrqtt dƒ|ƒ‚nt |ƒtjdƒ\}|_|_|j|jƒ\}\}} dS(NisCould not create a key for %ss2Could not check if login mapping for %s is defineds#Login mapping for %s is not defineds<Login mapping for %s is defined in policy, cannot be deleteds%Could not delete login mapping for %st __default__(RQRÉR1R3RÊRËRÌR`RjRRÍtsemanage_seuser_exists_localtsemanage_seuser_del_localRÎR$R0( R!R.RÚRÛRÜRWR2RÝRœR/((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__deleteŸs,      cCsEy%|jƒ|j|ƒ|jƒWntk r@}|‚nXdS(N(Rvt_loginRecords__deleteR>Rj(R!R.Rá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªœs   cCs’t|jƒ\}}|dkr6ttdƒƒ‚ny<|jƒx!|D]}|jt|ƒƒqJW|jƒWntk r}|‚nXdS(NisCould not list login mappings(tsemanage_seuser_list_localR`RjRRvRêtsemanage_seuser_get_nameR>(R!RWtulistRÞRá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuÆs   cCsÖi}tjƒd|_x¶tj|jƒD]¢\}}}||jkr,x|D]v}y\t|d|ƒ}|jƒjƒjdƒ}|j ƒ|d|d|df||RjRb(R!R.RRR0RRá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR js cCs+d}d}dj|ƒ}|dkr‚t|ƒdkr‚| r‚|dkr‚tdkrmttdƒƒ‚q‚ttdƒƒ‚nt|j|ƒ\} } | dkr¿ttdƒ|ƒ‚nt|j| ƒ\} } | dkrüttdƒ|ƒ‚n| sttd ƒ|ƒ‚nt|j| ƒ\} } | dkrXttd ƒ|ƒ‚nt | ƒ}t |j| ƒ\} } | dkršdj| ƒ}n|rŒt |j| t |ƒƒn|dkrät |j| t |ƒƒn|dkrt|j| |ƒnt|ƒdkr{x*| D]"}||krt| |ƒqqWx3|D](}|| krLt|j| |ƒqLqLWnt|j| | ƒ} | dkrµttd ƒ|ƒ‚nt| ƒt| ƒd j|jƒƒ}d j|jƒƒ}|jjd d|d|d|d|d|d|ƒdS(NR RÄiis&Requires prefix, roles, level or rangesRequires prefix or rolessCould not create a key for %ss-Could not check if SELinux user %s is definedsSELinux user %s is not definedsCould not query user for %ss Could not modify SELinux user %sR%R R$R1R/R0R2R3(RÅRSRtRjRRR`RRRRRR[RRtsemanage_user_del_roleRRRRR¡RbR5(R!R.RRR0RR2R3tnewrolesRWRÝRœRÞtrlistRR&((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRåssV1               cCsay1|jƒ|j|||||ƒ|jƒWn)tk r\}|jjdƒ|‚nXdS(Ni(RvRR>RjRb(R!R.RRR0RRá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRš¬s c CsÖt|j|ƒ\}}|dkr=ttdƒ|ƒ‚nt|j|ƒ\}}|dkrzttdƒ|ƒ‚n|s™ttdƒ|ƒ‚nt|j|ƒ\}}|dkrÖttdƒ|ƒ‚n|sõttdƒ|ƒ‚nt|j|ƒ\}}|dkr2ttdƒ|ƒ‚nt|ƒ}t|j|ƒ\}}dj |ƒ}t |j|ƒ}|dkrœttdƒ|ƒ‚nt |ƒt |ƒ|j jd d |d |d |ƒdS( NisCould not create a key for %ss-Could not check if SELinux user %s is definedsSELinux user %s is not defineds7SELinux user %s is defined in policy, cannot be deletedsCould not query user for %sR%s Could not delete SELinux user %sR R1R3R2(RR`RjRRtsemanage_user_exists_localRRRRÅtsemanage_user_del_localRRRbR7( R!R.RWRÝRœRÞR3RR2((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRéµs2        cCsUy%|jƒ|j|ƒ|jƒWn)tk rP}|jjdƒ|‚nXdS(Ni(Rvt_seluserRecords__deleteR>RjRb(R!R.Rá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªÖs  cCsœt|jƒ\}}|dkr6ttdƒƒ‚nyW|jƒx<|D]4}y|jt|ƒƒWqJtk r}qJqJXqJW|jƒWn)tk rž}|j jdƒ|‚nXdS(NisCould not list login mappings( tsemanage_user_list_localR`RjRRvR!tsemanage_user_get_nametOSErrorR>Rb(R!RWRíRÞRá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuàs     cCsþi}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx—|jD]Œ}t|ƒ}t|j|ƒ\}}|dkr¹ttdƒ|ƒ‚ndj|ƒ}t |ƒt |ƒt |ƒ|f|t|ƒ 9 !   t portRecordscBs’eZgZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z d „Z e d „Z e d „Zd „Zee d „ZRS(R cCsLtj||ƒy$tjtjdƒdd|_Wntk rGnXdS(Nt port_typeittypes(R\R"R·Ržt ATTRIBUTEt valid_typest RuntimeError(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"'s $ c Cs7|dkrt}n'|dkr*t}nttdƒƒ‚|dkr]ttdƒƒ‚n|jdƒ}t|ƒdkr•t|dƒ}}n t|dƒ}t|dƒ}|d krÖttd ƒƒ‚nt|j|||ƒ\}}|dkr'ttd ƒi|d 6|d 6ƒ‚n||||fS(NttcptudpsProtocol udp or tcp is requiredR sPort is requiredR#iiiÿÿs Invalid Ports1Could not create a key for %(PROTOTYPE)s/%(PORT)st PROTOTYPEtPORT( tSEMANAGE_PROTO_TCPtSEMANAGE_PROTO_UDPRjRR¡RStinttsemanage_port_key_createR`( R!tporttprototproto_dtportsthightlowRWRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__genkey.s$       'c Csítdkr*|r!t|ƒ}q*d}n|dkrKttdƒƒ‚ntj|ƒ|jkr|ttdƒ|ƒ‚n|j||ƒ\}}}}tj rŸt |j |ƒ\} } nt |j |ƒ\} } | dkr ttdƒi|d6|d 6ƒ‚n| r6ttd ƒi|d6|d 6ƒ‚nt |j ƒ\} } | dkr~ttd ƒi|d6|d 6ƒ‚nt| |ƒt| ||ƒt|j ƒ\} } | dkrãttd ƒi|d6|d 6ƒ‚nt|j | d ƒ} | dkr+ttdƒi|d6|d 6ƒ‚nt|j | dƒ} | dkrsttdƒi|d6|d 6ƒ‚nt|j | |ƒ} | dkr»ttdƒi|d6|d 6ƒ‚n|r t|j | |ƒ} | dkr ttdƒi|d6|d 6ƒ‚q nt|j | | ƒ} | dkrTttdƒi|d6|d 6ƒ‚nt|j || ƒ} | dkrœttdƒi|d6|d 6ƒ‚nt| ƒt|ƒt| ƒ|jjd|tj|ƒd d||fƒdS(NiR R sType is requireds'Type %s is invalid, must be a port typeis8Could not check if port %(PROTOCOL)s/%(PORT)s is definedtPROTOCOLR3s*Port %(PROTOCOL)s/%(PORT)s already defineds/Could not create port for %(PROTOCOL)s/%(PORT)ss2Could not create context for %(PROTOCOL)s/%(PORT)stsystem_us<Could not set user in port context for %(PROTOCOL)s/%(PORT)stobject_rs<Could not set role in port context for %(PROTOCOL)s/%(PORT)ss<Could not set type in port context for %(PROTOCOL)s/%(PORT)ssBCould not set mls fields in port context for %(PROTOCOL)s/%(PORT)ss4Could not set port context for %(PROTOCOL)s/%(PORT)ss(Could not add port %(PROTOCOL)s/%(PORT)ss8resrc=port op=add lport=%s proto=%s tcontext=%s:%s:%s:%s(RtR[RjRR·tget_real_type_nameR.t_portRecords__genkeyR\Rktsemanage_port_exists_localR`tsemanage_port_existstsemanage_port_createtsemanage_port_set_prototsemanage_port_set_rangetsemanage_context_createtsemanage_context_set_usertsemanage_context_set_roletsemanage_context_set_typetsemanage_context_set_mlstsemanage_port_set_contsemanage_port_modify_localtsemanage_context_freetsemanage_port_key_freetsemanage_port_freeRbR:Rtgetprotobyname( R!R8R9R0ttypeRÝR:R=R<RWRœRtcon((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRßHs^     '' '  ' ' ' ' * ' '   cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_portRecords__addR>(R!R8R9R0RT((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ˆs c CsF| rI|dkrItdkr4ttdƒƒ‚qIttdƒƒ‚n|r€tj|ƒ|jkr€ttdƒ|ƒ‚n|j||ƒ\}}}}t|j|ƒ\} } | dkréttdƒi|d6|d 6ƒ‚n| sttd ƒi|d6|d 6ƒ‚nt |j|ƒ\} } | dkrattd ƒi|d6|d 6ƒ‚nt | ƒ} |rt |j| t |ƒƒnd }|dkr·t |j| |ƒnt|j|| ƒ} | dkrÿttd ƒi|d6|d 6ƒ‚nt|ƒt| ƒ|jjd|tj|ƒdd||fƒdS(NR isRequires setype or serangesRequires setypes1Type %s is invalid, must be a file or device typeis9Could not check if port @%(PROTOCOL)s/%(PORT)s is definedR?R3s*Port @%(PROTOCOL)s/%(PORT)s is not defineds*Could not query port %(PROTOCOL)s/%(PORT)sR s+Could not modify port %(PROTOCOL)s/%(PORT)ss;resrc=port op=modify lport=%s proto=%s tcontext=%s:%s:%s:%sR@RA(RtRjRR·RBR.RCRER`tsemanage_port_querytsemanage_port_get_conRMR[RLRORQRRRbR:RRS( R!R8R9R0RÁRÝR:R=R<RWRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRås6  '' '   '  cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_portRecords__modifyR>(R!R8R9R0RÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRšµs c Cs[t|jƒ\}}|dkr6ttdƒƒ‚n|jƒx |D]}t|ƒ}t|ƒ}t|ƒ}t|ƒ}d||f}|j ||ƒ\} } }}|dkrÐttdƒ|ƒ‚nt |j| ƒ}|dkrttdƒ|ƒ‚nt | ƒ||kr&|}n|j j d|tj|ƒfƒqGW|jƒdS(NisCould not list the portss%s-%ssCould not create a key for %ssCould not delete the port %ss&resrc=port op=delete lport=%s proto=%s(tsemanage_port_list_localR`RjRRvtsemanage_port_get_prototsemanage_port_get_proto_strtsemanage_port_get_lowtsemanage_port_get_highRCtsemanage_port_del_localRQRbR:RRSR>( R!RWtplistR8R9t proto_strR=R<tport_strRÝR:((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuºs*            'c Cs„|j||ƒ\}}}}t|j|ƒ\}}|dkrittdƒi|d6|d6ƒ‚n|s–ttdƒi|d6|d6ƒ‚nt|j|ƒ\}}|dkráttdƒi|d6|d6ƒ‚n|sttdƒi|d6|d6ƒ‚nt|j|ƒ}|dkrSttdƒi|d6|d6ƒ‚nt|ƒ|jj d|t j |ƒfƒdS( Nis8Could not check if port %(PROTOCOL)s/%(PORT)s is definedR?R3s)Port %(PROTOCOL)s/%(PORT)s is not definedsBPort %(PROTOCOL)s/%(PORT)s is defined in policy, cannot be deleteds+Could not delete port %(PROTOCOL)s/%(PORT)ss&resrc=port op=delete lport=%s proto=%s( RCRER`RjRRDR_RQRbR:RRS( R!R8R9RÝR:R=R<RWRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRé×s  '' '' ' cCs(|jƒ|j||ƒ|jƒdS(N(Rvt_portRecords__deleteR>(R!R8R9((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªís c Csåi}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx~|jD]s}t|ƒ}t|ƒ}t|ƒ}t |ƒ}t |ƒ} t |ƒ} t |ƒ} ||f|| | | fBst ibpkey_typeiR,(R\R"tsetR·RžR-R.(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"?s 4cCsü|dkr!ttdƒƒ‚n|jdƒ}t|ƒdkr\t|ddƒ}}n&t|ddƒ}t|ddƒ}|dkr£ttdƒƒ‚nt|j|||ƒ\}}|dkrìttdƒ||fƒ‚n||||fS( NR sSubnet Prefix is requiredR#iiiÿÿs Invalid Pkeys Could not create a key for %s/%s(RjRR¡RSR6tsemanage_ibpkey_key_createR`(R!tpkeyt subnet_prefixtpkeysR<R=RWRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR>Fs   c Cshtdkr0|dkr!d}q0t|ƒ}n|dkrQttdƒƒ‚ntj|ƒ|jkr‚ttdƒ|ƒ‚n|j||ƒ\}}}}t|j |ƒ\}} |dkrãttdƒ||fƒ‚n| rttdƒ||fƒ‚nt |j ƒ\}} |dkrHttd ƒ||fƒ‚nt |j | |ƒt | ||ƒt |j ƒ\}} |dkr«ttd ƒ||fƒ‚nt|j | d ƒ}|dkrëttd ƒ||fƒ‚nt|j | d ƒ}|dkr+ttdƒ||fƒ‚nt|j | |ƒ}|dkrkttdƒ||fƒ‚ntdkrÆ|dkrÆt|j | |ƒ}|dkrÆttdƒ||fƒ‚qÆnt|j | | ƒ}|dkrttdƒ||fƒ‚nt|j || ƒ}|dkrFttdƒ||fƒ‚nt| ƒt|ƒt| ƒdS(NiR R sType is requireds)Type %s is invalid, must be a ibpkey typeis*Could not check if ibpkey %s/%s is definedsibpkey %s/%s already defineds!Could not create ibpkey for %s/%ss"Could not create context for %s/%sR@s.Could not set user in ibpkey context for %s/%sRAs.Could not set role in ibpkey context for %s/%ss.Could not set type in ibpkey context for %s/%ss4Could not set mls fields in ibpkey context for %s/%ss&Could not set ibpkey context for %s/%ssCould not add ibpkey %s/%s(RtR[RjRR·RBR.t_ibpkeyRecords__genkeytsemanage_ibpkey_existsR`tsemanage_ibpkey_createt!semanage_ibpkey_set_subnet_prefixtsemanage_ibpkey_set_rangeRIRJRKRLRMtsemanage_ibpkey_set_contsemanage_ibpkey_modify_localRPtsemanage_ibpkey_key_freetsemanage_ibpkey_free( R!RpRqR0RTRÝR=R<RWRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRßYsX           "    cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_ibpkeyRecords__addR>(R!RpRqR0RT((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR •s c Cs|dkrN|dkrNtdkr9ttdƒƒ‚qNttdƒƒ‚n|r…tj|ƒ|jkr…ttdƒ|ƒ‚n|j||ƒ\}}}}t|j|ƒ\}} |dkrættdƒ||fƒ‚n| s ttdƒ||fƒ‚nt |j|ƒ\}} |dkrNttd ƒ||fƒ‚nt | ƒ} tdkrŽ|dkrŽt |j| t |ƒƒn|dkr°t |j| |ƒnt|j|| ƒ}|dkrðttd ƒ||fƒ‚nt|ƒt| ƒdS( NR isRequires setype or serangesRequires setypes)Type %s is invalid, must be a ibpkey typeis*Could not check if ibpkey %s/%s is definedsibpkey %s/%s is not definedsCould not query ibpkey %s/%ssCould not modify ibpkey %s/%s(RtRjRR·RBR.RsRtR`tsemanage_ibpkey_querytsemanage_ibpkey_get_conRMR[RLRyRzR{( R!RpRqR0RÁRÝR=R<RWRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRåšs2       cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_ibpkeyRecords__modifyR>(R!RpRqR0RÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRšŸs c Cs#t|jƒ\}}|dkr6ttdƒƒ‚n|jƒxÒ|D]Ê}t|j|ƒ\}}t|ƒ}t|ƒ}d||f}|j||ƒ\}}}}|dkrÐttdƒ|ƒ‚nt |j|ƒ}|dkrttdƒ|ƒ‚nt |ƒqGW|j ƒdS(NisCould not list the ibpkeyss%s-%ssCould not create a key for %ssCould not delete the ibpkey %s( tsemanage_ibpkey_list_localR`RjRRvt!semanage_ibpkey_get_subnet_prefixtsemanage_ibpkey_get_lowtsemanage_ibpkey_get_highRstsemanage_ibpkey_del_localRzR>( R!RWR`tibpkeyRqR=R<tpkey_strRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuÃs"       cCs9|j||ƒ\}}}}t|j|ƒ\}}|dkrattdƒ||fƒ‚n|s†ttdƒ||fƒ‚nt|j|ƒ\}}|dkrÉttdƒ||fƒ‚n|sîttdƒ||fƒ‚nt|j|ƒ}|dkr+ttdƒ||fƒ‚nt|ƒdS(Nis*Could not check if ibpkey %s/%s is definedsibpkey %s/%s is not defineds4ibpkey %s/%s is defined in policy, cannot be deletedsCould not delete ibpkey %s/%s(RsRtR`RjRtsemanage_ibpkey_exists_localR„Rz(R!RpRqRÝR=R<RWRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRéÚs   cCs(|jƒ|j||ƒ|jƒdS(N(Rvt_ibpkeyRecords__deleteR>(R!RpRq((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªîs ic Cs÷i}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx|jD]…}t|ƒ}t|ƒ}|dkršqjnt|ƒ}t |j|ƒ\}}t |ƒ} t |ƒ} ||f|| | |fBstibendport_typeiR,(R\R"RnR·RžR-R.(R!Rc((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR"?s 4cCs­|dkr!ttdƒƒ‚nt|ƒ}|dksE|dkrZttdƒƒ‚nt|j||ƒ\}}|dkr ttdƒ||fƒ‚n|||fS(NR sIB device name is requirediÿisInvalid Port Numberis*Could not create a key for ibendport %s/%s(RjRR6tsemanage_ibendport_key_createR`(R!t ibendportt ibdev_nameR8RWRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR>Fs   c Csbtdkr0|dkr!d}q0t|ƒ}n|dkrQttdƒƒ‚ntj|ƒ|jkr‚ttdƒ|ƒ‚n|j||ƒ\}}}t|j |ƒ\}}|dkràttdƒ||fƒ‚n|rttdƒ||fƒ‚nt |j ƒ\}} |dkrEttd ƒ||fƒ‚nt |j | |ƒt | |ƒt |j ƒ\}} |dkr¥ttd ƒ||fƒ‚nt|j | d ƒ}|dkråttd ƒ||fƒ‚nt|j | d ƒ}|dkr%ttdƒ||fƒ‚nt|j | |ƒ}|dkrettdƒ||fƒ‚ntdkrÀ|dkrÀt|j | |ƒ}|dkrÀttdƒ||fƒ‚qÀnt|j | | ƒ}|dkrttdƒ||fƒ‚nt|j || ƒ}|dkr@ttdƒ||fƒ‚nt| ƒt|ƒt| ƒdS(NiR R sType is requireds-Type %s is invalid, must be an ibendport typeis-Could not check if ibendport %s/%s is definedsibendport %s/%s already defineds$Could not create ibendport for %s/%ss"Could not create context for %s/%sR@s1Could not set user in ibendport context for %s/%sRAs1Could not set role in ibendport context for %s/%ss1Could not set type in ibendport context for %s/%ss7Could not set mls fields in ibendport context for %s/%ss)Could not set ibendport context for %s/%ssCould not add ibendport %s/%s(RtR[RjRR·RBR.t_ibendportRecords__genkeytsemanage_ibendport_existsR`tsemanage_ibendport_createt!semanage_ibendport_set_ibdev_nametsemanage_ibendport_set_portRIRJRKRLRMtsemanage_ibendport_set_contsemanage_ibendport_modify_localRPtsemanage_ibendport_key_freetsemanage_ibendport_free( R!RRR0RTRÝR8RWRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRßTsX            "    cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_ibendportRecords__addR>(R!RRR0RT((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR s c Cs|dkrN|dkrNtdkr9ttdƒƒ‚qNttdƒƒ‚n|r…tj|ƒ|jkr…ttdƒ|ƒ‚n|j||ƒ\}}}t|j|ƒ\}}|dkrãttdƒ||fƒ‚n|sttdƒ||fƒ‚nt |j|ƒ\}} |dkrKttd ƒ||fƒ‚nt | ƒ} tdkr‹|dkr‹t |j| t |ƒƒn|dkr­t |j| |ƒnt|j|| ƒ}|dkríttd ƒ||fƒ‚nt|ƒt| ƒdS( NR isRequires setype or serangesRequires setypes-Type %s is invalid, must be an ibendport typeis-Could not check if ibendport %s/%s is definedsibendport %s/%s is not definedsCould not query ibendport %s/%ss Could not modify ibendport %s/%s(RtRjRR·RBR.R‘R’R`tsemanage_ibendport_querytsemanage_ibendport_get_conRMR[RLR—R˜R™( R!RRR0RÁRÝR8RWRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRå”s2       cCs.|jƒ|j||||ƒ|jƒdS(N(Rvt_ibendportRecords__modifyR>(R!RRR0RÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRšžs cCst|jƒ\}}|dkr6ttdƒƒ‚n|jƒxÅ|D]œ}t|j|ƒ\}}t|ƒ}|jt|ƒ|ƒ\}}}|dkrœttdƒt |fƒ‚nt |j|ƒ}|dkrúttdƒ||fƒ‚nt |ƒqGW|j ƒdS(NisCould not list the ibendportss Could not create a key for %s/%ds$Could not delete the ibendport %s/%d( tsemanage_ibendport_list_localR`RjRRvt!semanage_ibendport_get_ibdev_nametsemanage_ibendport_get_portR‘R,t ibdevnametsemanage_ibendport_del_localR˜R>(R!RWR`RRR8RÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuœs    !  cCs6|j||ƒ\}}}t|j|ƒ\}}|dkr^ttdƒ||fƒ‚n|sƒttdƒ||fƒ‚nt|j|ƒ\}}|dkrÆttdƒ||fƒ‚n|sëttdƒ||fƒ‚nt|j|ƒ}|dkr(ttdƒ||fƒ‚nt|ƒdS(Nis-Could not check if ibendport %s/%s is definedsibendport %s/%s is not defineds7ibendport %s/%s is defined in policy, cannot be deleteds Could not delete ibendport %s/%s(R‘R’R`RjRtsemanage_ibendport_exists_localR¢R˜(R!RRRÝR8RWRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRéÒs   cCs(|jƒ|j||ƒ|jƒdS(N(Rvt_ibendportRecords__deleteR>(R!RR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªæs ic Csèi}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx|jD]v}t|ƒ}t|ƒ}|dkršqjnt|ƒ}t |j|ƒ\}}t |ƒ} ||f|| |f(R!R°R±R9R0Rg((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ™s c Cs4|j|||ƒ\}}}| rF|dkrFttdƒƒ‚n|r}tj|ƒ|jkr}ttdƒ|ƒ‚nt|j|||ƒ\}}|dkrÀttdƒ|ƒ‚nt|j|ƒ\}}|dkrýttdƒ|ƒ‚n|sttdƒ|ƒ‚nt |j|ƒ\}} |dkrYttdƒ|ƒ‚nt | ƒ} |r‡t |j| t |ƒƒn|dkr©t |j| |ƒnt|j|| ƒ}|dkrãttd ƒ|ƒ‚nt|ƒt| ƒ|jjd ||tj|j|ƒd d ||fƒdS( NR sRequires setype or seranges'Type %s is invalid, must be a node typeisCould not create key for %ss%Could not check if addr %s is definedsAddr %s is not definedsCould not query addr %ssCould not modify addr %ssFresrc=node op=modify laddr=%s netmask=%s proto=%s tcontext=%s:%s:%s:%sR@RA(RµRjRR·RBR.R¶R`R·tsemanage_node_querytsemanage_node_get_conRMR[RLR¿RžRÀRbR:RRSR«( R!R°R±R9R0RÁRWRÝRœRÁRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRåžs6        cCs1|jƒ|j|||||ƒ|jƒdS(N(RvR¹R>(R!R°R±R9R0RÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRšÄs cCs‹|j|||ƒ\}}}t|j|||ƒ\}}|dkrattdƒ|ƒ‚nt|j|ƒ\}}|dkržttdƒ|ƒ‚n|sœttdƒ|ƒ‚nt|j|ƒ\}}|dkrúttdƒ|ƒ‚n|sttdƒ|ƒ‚nt|j|ƒ}|dkrPttdƒ|ƒ‚nt|ƒ|j j d||t j |j |ƒfƒdS(NisCould not create key for %ss%Could not check if addr %s is definedsAddr %s is not defineds/Addr %s is defined in policy, cannot be deletedsCould not delete addr %ss1resrc=node op=delete laddr=%s netmask=%s proto=%s(RµR¶R`RjRR·tsemanage_node_exists_localtsemanage_node_del_localRžRbR:RRSR«(R!R°R±R9RWRÝRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRéÉs&     cCs+|jƒ|j|||ƒ|jƒdS(N(Rvt_nodeRecords__deleteR>(R!R°R±R9((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªås cCsŸt|jƒ\}}|dkr6ttdƒƒ‚n|jƒxN|D]F}|jt|j|ƒdt|j|ƒd|jt |ƒƒqGW|j ƒdS(Nis!Could not deleteall node mappingsi( tsemanage_node_list_localR`RjRRvRÇtsemanage_node_get_addrtsemanage_node_get_maskR«tsemanage_node_get_protoR>(R!RWtnlistRÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuês   Dc Csúi}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx“|jD]ˆ}t|ƒ}t|j|ƒ}t|j|ƒ}|j t |ƒ}t |ƒt |ƒt |ƒt|ƒf||d|d|f(R!RáR0Rg((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ks c CsÃ| r(|dkr(ttdƒƒ‚nt|j|ƒ\}}|dkrettdƒ|ƒ‚nt|j|ƒ\}}|dkr¢ttdƒ|ƒ‚n|sÁttdƒ|ƒ‚nt|j|ƒ\}}|dkrþttdƒ|ƒ‚nt|ƒ}|r,t|j|t|ƒƒn|dkrNt |j||ƒnt |j||ƒ}|dkrˆttdƒ|ƒ‚nt |ƒt |ƒ|j jd |d d ||fƒdS( NR sRequires setype or serangeisCould not create key for %ss*Could not check if interface %s is definedsInterface %s is not definedsCould not query interface %ssCould not modify interface %ss7resrc=interface op=modify netif=%s tcontext=%s:%s:%s:%sR@RA(RjRR×R`RØtsemanage_iface_querytsemanage_iface_get_ifconRMR[RLRßRÙRàRbR:( R!RáR0RÁRWRÝRœRâRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRåps0        cCs+|jƒ|j|||ƒ|jƒdS(N(RvRÚR>(R!RáR0RÁ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRš’s cCsNt|j|ƒ\}}|dkr=ttdƒ|ƒ‚nt|j|ƒ\}}|dkrzttdƒ|ƒ‚n|s™ttdƒ|ƒ‚nt|j|ƒ\}}|dkrÖttdƒ|ƒ‚n|sõttdƒ|ƒ‚nt|j|ƒ}|dkr,ttdƒ|ƒ‚nt|ƒ|jj d|ƒdS(NisCould not create key for %ss*Could not check if interface %s is definedsInterface %s is not defineds4Interface %s is defined in policy, cannot be deletedsCould not delete interface %ss"resrc=interface op=delete netif=%s( R×R`RjRRØtsemanage_iface_exists_localtsemanage_iface_del_localRÙRbR:(R!RáRWRÝRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRé—s$     cCs%|jƒ|j|ƒ|jƒdS(N(Rvt_interfaceRecords__deleteR>(R!Rá((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRª°s  cCsrt|jƒ\}}|dkr6ttdƒƒ‚n|jƒx!|D]}|jt|ƒƒqGW|jƒdS(Nis(Could not delete all interface mappings(tsemanage_iface_list_localR`RjRRvRètsemanage_iface_get_nameR>(R!RWRíR‹((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuµs   cCsži}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nxQ|jD]F}t|ƒ}t|ƒt|ƒt |ƒt |ƒf|t |ƒx;|D]3}d |||d||d||dfGHqÇWdS( Nis %-30s %s sSELinux InterfaceRÓs%-30s %s:%s:%s:%s iiis%-30s %s:%s:%s ( RR™RþRSRˆRRtRYR](R!R–R—RøRþRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR™Ús  H (R?R@R"RãR RÚRšRèRªRuR]RRyReR™(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRÖ&s  A  "     tfcontextRecordscBs¿eZgZdd„Zd„Zd„Zd„Zdd„Zd„Zdddd„Z dddd „Z d „Z d „Z d „Zd „Zd„Zed„Zd„Zeed„ZRS(R cCsÙtj||ƒyJtjtjdƒdd|_|jtjtjdƒdd7_Wntk rmnXi|_i|_t |_ y’t t j ƒdƒ}xl|jƒD]^}|jƒ}t|ƒdkrØq®n|jdƒríq®n|jƒ\}}||j|(R!t subs_filettmpfileRûRø((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR> s   " $ c Cs„|jƒ|dkr?|ddkr?ttdƒ|ƒ‚n|dkrt|ddkrtttdƒ|ƒ‚n|t|jjƒƒkršttdƒ|ƒ‚n|j|ƒxp|j|jfD]\}xS|D]K}|j|dƒrÕttdƒi|d6|d6||d 6ƒ‚qÕqÕWqÈW|j j d t j d |d ƒt j d |d ƒfƒ||j|(R!RøRùtfdictR‹((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt add_equal# s    :8  cCsš|jƒ|t|jjƒƒkr>ttdƒ|ƒ‚n||j|(R!RøRù((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt modify_equal: s   8R@cCst|jƒ\}}|dkr:ttdƒ|ƒ‚n|dkrOd}nt|j||ƒ}|dkr‰ttdƒ|ƒ‚nt|j|dƒ}|dkrÃttdƒ|ƒ‚ntdkr t|j|d ƒ}|dkr ttd ƒ|ƒ‚q n|S( NisCould not create context for %sR R@s)Could not set user in file context for %sRAs)Could not set role in file context for %siR s/Could not set mls fields in file context for %s(RIR`RjRRJRKRtRM(R!RøR RWRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt createconC s        cCs÷|dks!|jdƒdkr6ttdƒƒ‚n|jdƒdkr`ttdƒƒ‚nx|j|jfD]|}xs|D]k}|j|dƒr€tj||||ƒ}ttd ƒi|d 6|d 6||d 6|d 6ƒ‚q€q€WqsWdS(NR s isInvalid file specificationRÄiÿÿÿÿs)File specification can not include spacesRîsjFile spec %(TARGET)s conflicts with equivalency rule '%(SOURCE)s %(DEST)s'; Try adding '%(DEST1)s' insteadRRRtDEST1(tfindRjRRðRñRµRHtsub(R!RøRR‹R((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRµY s! c Cs…|j|ƒ|dkr"d}ntdkrLt|ƒ}|sLd}qLn|dkrmttdƒƒ‚n|dkrªtj|ƒ|jkrªttdƒ|ƒ‚nt|j |t |ƒ\}}|dkrîttd ƒ|ƒ‚nt |j |ƒ\}}|dkr+ttd ƒ|ƒ‚n|sqt |j |ƒ\}}|dkrqttd ƒ|ƒ‚qqn|ršt |ƒ|j|||||ƒSt|j ƒ\}} |dkrÔttd ƒ|ƒ‚nt|j | |ƒ}|dkrÁ|j||ƒ} t|j | |ƒ}|dkrAttd ƒ|ƒ‚n|r„t|j | |ƒ}|dkr„ttd ƒ|ƒ‚q„nt|j | | ƒ}|dkrÁttdƒ|ƒ‚qÁnt| t |ƒt|j || ƒ}|dkr ttdƒ|ƒ‚n|dkr%t| ƒnt |ƒt| ƒ|sHd}n|jjdtjd|dƒt||d||fƒdS(NR R@iR sSELinux Type is requireds<>s1Type %s is invalid, must be a file or device typeisCould not create key for %ss1Could not check if file context for %s is defineds$Could not create file context for %ss)Could not set type in file context for %ss/Could not set mls fields in file context for %ss!Could not set file context for %ss!Could not add file context for %ss6resrc=fcontext op=add %s ftype=%s tcontext=%s:%s:%s:%sRRA(RµRtR[RjRR·RBR.tsemanage_fcontext_key_createR`t file_typestsemanage_fcontext_existstsemanage_fcontext_exists_localtsemanage_fcontext_key_freet_fcontextRecords__modifytsemanage_fcontext_createtsemanage_fcontext_set_exprR RLRMtsemanage_fcontext_set_contsemanage_fcontext_set_typetsemanage_fcontext_modify_localRPtsemanage_fcontext_freeRbR:RRtftype_to_audit( R!RøRTtftypeR0R RWRÝRœtfcontextRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRße sf       $               cCs1|jƒ|j|||||ƒ|jƒdS(N(Rvt_fcontextRecords__addR>(R!RøRTRR0R ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR ¬ s c Csa|r3|dkr3|dkr3ttdƒƒ‚n|dkrptj|ƒ|jkrpttdƒ|ƒ‚n|j|ƒt|j|t|ƒ\}}|dkrÁttdƒ|ƒ‚nt |j|ƒ\}}|dkrþttdƒ|ƒ‚n|s>t |j|ƒ\}}|s>ttdƒ|ƒ‚q>nyt |j|ƒ\}} WnWt k r³yt |j|ƒ\}} WqŽt k r¯ttd ƒ|ƒ‚qŽXnX|dkrt| ƒ} | dkrê|j|ƒ} n|r t|j| t|ƒƒn|dkr.t|j| |ƒn|dkrPt|j| |ƒnt|j| | ƒ}|dkrÇttd ƒ|ƒ‚qÇn:t|j| dƒ}|dkrÇttd ƒ|ƒ‚nt|j|| ƒ}|dkrttd ƒ|ƒ‚nt|ƒt| ƒ|s$d }n|jjd tjd|dƒt||d||fƒdS(NR s"Requires setype, serange or seusers<>s1Type %s is invalid, must be a file or device typeisCould not create a key for %ss1Could not check if file context for %s is defineds"File context for %s is not defineds#Could not query file context for %ss!Could not set file context for %ss$Could not modify file context for %sR@s9resrc=fcontext op=modify %s ftype=%s tcontext=%s:%s:%s:%sRRA(R s<>(RjRR·RBR.RµRR`RRRtsemanage_fcontext_query_localR$tsemanage_fcontext_querytsemanage_fcontext_get_conRAR RMR[RJRLRRRRRbR:RRR( R!RøRÁRR0R RWRÝRœRRU((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRå± s\$                cCs1|jƒ|j|||||ƒ|jƒdS(N(RvRR>(R!RøRÁRR0R ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRšï s cCsKt|jƒ\}}|dkr6ttdƒƒ‚n|jƒxè|D]à}t|ƒ}t|ƒ}t|ƒ}t|j|t |ƒ\}}|dkrµttdƒ|ƒ‚nt |j|ƒ}|dkrìttdƒ|ƒ‚nt |ƒ|j j dtjd|dƒtt|fƒqGWi|_t|_|jƒdS(Nis Could not list the file contextssCould not create a key for %ss$Could not delete the file context %ss$resrc=fcontext op=delete %s ftype=%sR(tsemanage_fcontext_list_localR`RjRRvtsemanage_fcontext_get_exprtsemanage_fcontext_get_typetsemanage_fcontext_get_type_strRRtsemanage_fcontext_del_localRRbR:RRRtfile_type_str_to_optionRðReRòR>(R!RWtflistRRøRt ftype_strRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuô s&         5  cCsÉ|t|jjƒƒkr[|jj|ƒt|_|jjdtj d|dƒƒdSt |j |t |ƒ\}}|dkrŸt tdƒ|ƒ‚nt|j |ƒ\}}|dkrÜt tdƒ|ƒ‚n|sWt|j |ƒ\}}|dkrt tdƒ|ƒ‚n|r>t tdƒ|ƒ‚qWt tdƒ|ƒ‚nt|j |ƒ}|dkrŽt tdƒ|ƒ‚nt|ƒ|jjd tj d|dƒt|fƒdS( Ns!resrc=fcontext op=delete-equal %sRisCould not create a key for %ss1Could not check if file context for %s is defineds;File context for %s is defined in policy, cannot be deleteds"File context for %s is not defineds$Could not delete file context for %ss$resrc=fcontext op=delete %s ftype=%s(R™RðRþtpopReRòRbR:RRRR`RRjRRRR&RR(R!RøRRWRÝRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRé s. #     cCs(|jƒ|j||ƒ|jƒdS(N(Rvt_fcontextRecords__deleteR>(R!RøR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRª/ s c Cs’|r!t|jƒ\}|_nÃt|jƒ\}|_|dkrZttdƒƒ‚nt|jƒ\}}|dkrttdƒƒ‚nt|jƒ\}}|dkrÆttdƒƒ‚n|j|7_|j|7_ddlm}|ƒ}xŽ|jD]ƒ}t |ƒ}t |ƒ} t | ƒ} t |ƒ} | rzt | ƒt| ƒt| ƒt| ƒf||| ft|jjƒƒD]$}|jd|j||fƒqâWn|S(Nis-a -f %s -t %s -r '%s' '%s'iiis-a -f %s -t %s '%s's -a -e %s %s(RReR™RþR(R'RSRð(R!Rt fcon_dictRþRÝRø((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRyT s  <5%c Csê|j|ƒ}t|jƒƒ}t|ƒdkr%|r`dtdƒtdƒtdƒfGHnxÂ|D]·}||rtrÌd|d|d||d||d||dt||d tƒfGHqd |d|d||d||d||dfGHqgd |d|dfGHqgWnt|jƒrŠ|sŠ|rNtd ƒGHnx6t|jjƒƒD]}d ||j|fGHqdWqŠnt|j ƒræ|r­tdƒGHnx6t|j jƒƒD]}d ||j |fGHqÃWndS(Nis%-50s %-18s %s sSELinux fcontextRTRÓs%-50s %-18s %s:%s:%s:%s iiis%-50s %-18s %s:%s:%s s%-50s %-18s <>s, SELinux Distribution fcontext Equivalence s%s = %ss% SELinux Local fcontext Equivalence ( RR™RþRSRRtRYR]RñRð(R!R–R—R3RþRÝRø((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR™d s,'  O; N(R?R@R.R"R>R R R RµRARR RRšRuR+RªR]RRyReR™(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRìês" &    G >   !  tbooleanRecordscBs€eZdd„Zd„Zd ed„Zd„Zd„Zd„Z ed„Z d„Z d „Z d „Z eeed „ZRS( R cCsâtj||ƒi|_d|jdR=tsemanage_bool_set_activetsemanage_bool_modify_localtsemanage_bool_key_freetsemanage_bool_free(R!R.tvalueRWRÝRœR((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt__mod— s0   .   cCsø|jƒ|rÚt|ƒ}x®|jƒjdƒD]—}|jƒ}t|ƒdkr\q2ny|jdƒ\}}Wn5tk r¬ttdi|d6|d6ƒƒ‚nX|j|jƒ|jƒƒq2W|j ƒn|j||ƒ|j ƒdS(Ns it=s)Bad format %(BOOLNAME)s: Record %(VALUE)stBOOLNAMEtVALUE( RvRóRôR¡RõRSRjRt_booleanRecords__modRöR>(R!R.RJtuse_fileRûRtboolnameRÔ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRš¶ s    (  cCsItj|ƒ}t|j|ƒ\}}|dkrLttdƒ|ƒ‚nt|j|ƒ\}}|dkr‰ttdƒ|ƒ‚n|sšttdƒ|ƒ‚nt|j|ƒ\}}|dkråttdƒ|ƒ‚n|sttdƒ|ƒ‚nt|j|ƒ}|dkr;ttdƒ|ƒ‚nt |ƒdS(NisCould not create a key for %ss(Could not check if boolean %s is definedsBoolean %s is not defineds2Boolean %s is defined in policy, cannot be deletedsCould not delete boolean %s( RQR@RAR`RjRRBtsemanage_bool_exists_localtsemanage_bool_del_localRH(R!R.RWRÝRœ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRéÊ s$    cCs%|jƒ|j|ƒ|jƒdS(N(Rvt_booleanRecords__deleteR>(R!R.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRªâ s  cCs~t|jƒ\}|_|dkr9ttdƒƒ‚n|jƒx*|jD]}t|ƒ}|j|ƒqMW|jƒdS(NisCould not list booleans( tsemanage_bool_list_localR`tblistRjRRvtsemanage_bool_get_nameRTR>(R!RWtbooleanR.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRuç s   cCsi}|r't|jƒ\}|_nt|jƒ\}|_|dkr`ttdƒƒ‚nx©|jD]ž}g}t|ƒ}|jt|ƒƒ|j rÜ||j krÜ|jt j |ƒƒ|jt j |ƒƒn"|j|dƒ|j|dƒ|||R=RQtsecurity_get_boolean_pendingtsecurity_get_boolean_active(R!R—RøRWRXRJR.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRô s"  cCstj|ƒ}t|ƒS(N(RQR@R(R!R.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytget_desc scCstj|ƒ}t|ƒS(N(RQR@R(R!R.((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyt get_category scCsrg}|jtƒ}t|jƒƒ}|jƒx:|D]2}||r8|jd||d|fƒq8q8W|S(Ns -m -%s %si(RReR™RþRˆR((R!RRøRþRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyRy s   &cCs=tdƒtdƒf}|rx|j|ƒ}t|jƒƒ}x2|D]*}||rFd|||dfGHqFqFWdS|j|ƒ}t|jƒƒ}t|ƒdkr¯dS|rådtdƒtdƒtd ƒtd ƒfGHnxQ|D]I}||rìd ||||d|||d|j|ƒfGHqìqìWdS( NR­R¬s%s=%siis%-30s %s %s %s sSELinux booleantStatetDefaultt Descriptions%-30s (%-5s,%5s) %s(RRR™RþRSR](R!R–R—RPton_offRøRþRÝ((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR™ s"  0  N(R?R@R"RORAR]RšRTRªRuRR]R^RyReR™(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pyR4€ s        (ARÒRÐtstringRQttempfileRšRHR*RýtshutilRR8tPROGNAMER·RRRtIPyRtgettexttbindtextdomaint textdomaintinstallRet TypeErrorRötbuiltinsR,t__dict__RtRCRtSEMANAGE_FCONTEXT_ALLtSEMANAGE_FCONTEXT_REGtSEMANAGE_FCONTEXT_DIRtSEMANAGE_FCONTEXT_CHARtSEMANAGE_FCONTEXT_BLOCKtSEMANAGE_FCONTEXT_SOCKtSEMANAGE_FCONTEXT_LINKtSEMANAGE_FCONTEXT_PIPER'RRt audit_closeRRR$R¿RERPRYR[R\R}R«R±RÆRÊR*RkRŒR§RÖRìR4(((s7/usr/lib64/python2.7/site-packages/seobject/__init__.pytsÊ                                                    ""   ^{ Hÿÿ ÿÿòøÄÿ—