Prv8 Shell
Server : Apache
System : Linux server.mata-lashes.com 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64
User : matalashes ( 1004)
PHP Version : 8.1.29
Disable Function : NONE
Directory :  /proc/17567/root/usr/share/selinux/devel/include/support/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/17567/root/usr/share/selinux/devel/include/support/segenxml.pyc
�
���_c@s�dZddlZddlZddlZddlZddlZeZdZdZ	iZ
gZgZgZ
gZdZejd�Zejd�Zejd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�ZeZeZeZeZeej�dkr(e�ej d�ny5ejejdddddddg�\Z!Z"Wn(ej#k
r�e�ej d�nXx�e!D]�\Z$Z%e$d%kr�e&Zq�e$d&kr�e�ej d�q�e$d'kr�e%ZPq�e$d(kr�e%ZPq�e$d)kre%ZPq�e�ej d�q�WerLej'j(ee��nXernej'j(eed#��n6er�ej'j(eed$��ne�ej d�dS(*sY
	This script generates XML documentation information for layers specified
	by the user.
i����Ntmetadatasthird-partyts!^\s*(interface|template)\(`(\w*)'s8^\s*gen_(tunable|bool)\(\s*(\w*)\s*,\s*(true|false)\s*\)s^##\s+(.*?)\s*$cCs9tjj|�}tjj|�}d||f}d||f}y)t|d�}|j�}|j�Wntd|�gSXg}|jdtjj	tjj
|�d�d|f�g}d}	t}
x$|r�|dj
�r�|d}q�Wd}x�|D]�}|d7}|
r�tj|�}
|
rT|j|
jd�d	�q	q�|r�t}
tj|�}	|	s�||7}g}q	q�q�n|j
�r�q	ntj|�}
|
r�|j|
jd�d	�q	n|	s�tj|�}	n|	r	|	j�}|jd
|d|d|f�|r=||7}g}n�td|d|df�|jd�|jd
�|jd�|jd�|jd�|jd�|jd�|jd�|jd|	jd��d}	q	q	q	W|
r�||7}n|rtd|�n|t|d�}|jd�|S(sH
	Returns the XML data for a module in a list, one line per list item.
	s%s/%s.tes%s/%s.iftrs&cannot open file %s for read, skippings!<module name="%s" filename="%s">
i����iis
s<%s name="%s" lineno="%s">
sunable to find XML for %s %s()s
<summary>
sSummary is missing!
s</summary>
s<param name="?">
s$Parameter descriptions are missing!
s	</param>
s</%s>
s(orphan XML comments at bottom of file %stboths
</module>
N(tostpathtdirnametbasenametopent	readlinestclosetwarningtappendtsplitexttsplittNonetTruetisspacetXML_COMMENTtmatchtgrouptFalset	INTERFACEtgroupst
getTunableXML(t	file_namet
module_dirtmodule_namet	module_tet	module_iftmodule_filetmodule_codet
module_bufttemp_buft	interfacetfinding_headertline_numtlinetcommentR((s4/usr/share/selinux/devel/include/support/segenxml.pytgetModuleXMLFs�	.


"
	










cCs�y)t|d�}|j�}|j�Wntd|�gSXg}g}x�|D]�}tj|�}|r�|j|jd�d�qUntj|�}|rU|dkr�|jd�|kr�t	d|jd�|f�q�n|jd|j
��||7}g}|jd|jd��qUqUWt|�rNtd	|�ntt�d
kr�t
jj|�dd}	yCttd|	d
�}
x|D]}|
j|�q�W|
j�Wq�td|	�q�Xn|S(sD
	Return all the XML for the tunables/bools in the file specified.
	Rs&cannot open file %s for read, skippingis
Rs%s in a %s file.s<%s name="%s" dftval="%s">
s</%s>
s(orphan XML comments at bottom of file %sis.xmlt/tws*cannot write to file %s, skipping creation(RR	R
RRRRRtBOOLEANterrorRtlent
output_dirRRRtwrite(Rtkindttunable_filettunable_codettunable_bufR!R%R&tbooleantxmlfiletxml_outfilettunable_line((s4/usr/share/selinux/devel/include/support/segenxml.pyR�sF
#
!
cCsOg}y-t|d�}||j�7}|j�Wntd|�nX|S(s-
	Return all the XML in the file specified.
	Rs.cannot open file %s for read, assuming no data(RR	R
R(RR2ttunable_xml((s4/usr/share/selinux/devel/include/support/segenxml.pytgetXMLFileContentsscCs�g}|jd�x+tj�D]}|t|t|�7}q Wx!tD]}|t|d�7}qHWxtD]}|t|�7}qlWx!tD]}|t|d�7}q�Wxt	D]}|t|�7}q�W|jd�|S(s_
	Return the compelete reference policy XML documentation through a list,
	one line per item.
	s	<policy>
ttunabletbools
</policy>
(
RtlayerstkeystgetLayerXMLt
tunable_filesRtxml_tunable_filesR8t
bool_filestxml_bool_files(t
policy_buftlayerR0t	bool_file((s4/usr/share/selinux/devel/include/support/segenxml.pytgetPolicyXMLs





cCs�tjjdtjd�tjjdddd�tjjd�tjjdtjd�tjjd	tjd�d
S(sB
	Displays a message describing the proper usage of this script.
	susage: %s [-w] [-mtb] <file>

is-w --warn			show warnings
s.-m --module <file>		name of module to process
s<-t --tunable <file>		name of global tunable file to process
s=-b --boolean <file>		name of global boolean file to process

s
examples:
s!> %s -w -m policy/modules/apache
s> %s -t policy/global_tunables
N(tsyststdoutR.targv(((s4/usr/share/selinux/devel/include/support/segenxml.pytusage4s	cCs@tr<tjjdtjd�tjjd|d�ndS(s+
	Warns the user of a non-critical error.
	s%s: is	warning: s
N(twarnRFtstderrR.RH(tdescription((s4/usr/share/selinux/devel/include/support/segenxml.pyRCscCsQtjjdtjd�tjjd|d�tjj�tjd�dS(s.
	Describes an error and exists the program.
	s%s: iserror: s
iN(RFRKR.RHtflushtexit(RL((s4/usr/share/selinux/devel/include/support/segenxml.pyR+Ls
iswhm:t:b:RJthelpsmodule=stunable=sboolean=is-ws--warns-hs--helpis-ms--modules-ts	--tunables-bs	--booleanR9R:(s-ws--warn(s-hs--help(s-ms--module(s-ts	--tunable(s-bs	--boolean()t__doc__RFRtglobtretgetoptRRJtmetatthird_partyR;R>R@R?RAR-tcompileRR*RR'RR8RERIRR+tmoduleR9R3R,RHRNtoptstargstGetoptErrortotaRRGt
writelines(((s4/usr/share/selinux/devel/include/support/segenxml.pyt<module>sz		{	A		!				5	

haha - 2025