403Webshell
Server IP : 39.108.156.168  /  Your IP : 216.73.216.104
Web Server : nginx/1.24.0
System : Linux e2.ksyuki.com 6.11.0-25-generic #25~24.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 17:20:50 UTC 2 x86_64
User : root ( 0)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/local/aegis/PythonLoader/third_party/apacheconfig/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyc
�
���ac@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
eje�Zdefd��YZdS(i����(tunicode_literalsN(terror(tLocalHostReadertget_real_file_pathtApacheConfigLoadercBs�eZed�Zd�Zed��Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zgd�Zgd�Zd
�Zd�Zedd�Zed�Zded�Zd�Zd�ZRS(cKs�||_||_t|�|_d|jkrC|jd|_nt|jjdd��|_g|_t�|_	i|_
dS(Nureaderuprocrootu/(t_parsert_debugtdictt_optionst_readerRtgett_stacktsett	_includest
_ast_cache(tselftparsertdebugtoptions((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt__init__s			cCs@i}x3|D]+}|j|�}|r
|j|�q
q
W|S(N(t_walkasttupdate(Rtasttconfigtsubtreetitems((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytg_config(s
cCs||ddkr0|ddkr0|dd!}n|ddkr`|ddkr`|dd!}n|sxtjd��n|S(Niu"i����iu'uEmpty block tag not allowed(RtApacheConfigError(ttag((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt_unquote_tag2s  c
Cs�|d}i}|jjdt�s:dj|�f}nt|�dkrr|\}}}ii||6|6}n |j|d�}i||6}x:|dd!D]+}|j|�}	|	r�|j|	�q�q�W|S(Niunamedblocksuii����(RR
tTruetjointlenRRR(
RRRtvaluestnamet_tvaluetblockRR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytg_block>s"

cCsI|jjdi�}x-|D]%}|j|�}|j||�qW|S(Nu
defaultconfig(RR
Rt_merge_contents(RRtcontentsRR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt
g_contentsYs

cs��jjdt�s*�jjdt�r:t�jd<n�jjdt�r���fd���fd��t|dt�s��jjdt�r�t|t�r�g|D]}�|�^q�}q��|�}q�n�jjdi||6�|S(u�Store option / values in `stack` and interpolate value when referenced.
        Returns `value` with any interpolated variables.
        uinterpolateenvuallowsinglequoteinterpolationuinterpolatevarscs�|j�d}x+�jD] }||kr�||�SqW�jjdt�r||�jjkr|��jj|�Sn�jjdt�r�tj	d|��n�|j
�S(Niuinterpolateenvu
strictvarsu%Undefined variable "${%s}" referenced(tgroupsRRR
tFalseR	tenvironRRRtstring(tmatchtoptiontframe(tinterpolateR(s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytlookupmscs8tjd�|�}||kr%|Stjd�|�S(Nu(?<!\\)\${([^\n\r]+?)}u(?<!\\)\$([^\n\r $]+?)(tretsub(R$texpanded(R2(s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyR1~suis_single_quotedi(	RR
R+Rtgetattrt
isinstancetlistRtinsert(RR/R$tx((R1R2Rs@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt_interpolate_varsds"c
s�t|�dkr!id|d6S|d \}}�j||�}�fd�}t|t�r�g|D]}||�^qh}n||�}�jjd�}|r||krtg||D]}|df^q��}x5|jd�D]$}	|	j	�}	|||	||	<q�W|}nK�jjd�rh|j
�dkrJd}qh|j
�dkrhd}qhn�jjd�r�|jd�r�|jd�r�|dd!g}q�ni||6S(uQPerforms postprocessing on a statement. Returns an {option: value} dict.
        iiicsB�jjd�r|St|tj�s,|Stjdd�|�S(Nunoescapeu\\([$\\"#])cSs|j�dS(Ni(R*(R:((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt<lambda>�t(RR
R7tsixt	text_typeR3R4(R$(R(s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytremove_escapes�s
uflagbitsu|uautotrueuyesuonutrueu1unouoffufalseu0u
forcearrayu[u]i����N(uyesuonutrue(unouoffufalse(
R tNoneR;R7R8RR
Rtsplittstriptlowert
startswithtendswith(
RRR/R$R@R:tflagbitstkeytflagstflag((Rs@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytg_statement�s2")		cCsgS(N((RR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt	g_comment�scCs-y|j|�SWntjk
r(iSXdS(N(t	g_includeRtConfigFileReadError(RR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytg_includeoptional�scCs�|j|d�}|j}tjj|�rXtjj|�g}tjj|�}n�|jdg�}d|kr�|jd�r�|jd|d�nd|kr�|j	|d�n
|j	d�|j
j|�r�|jd|�d}n|}|jjdd�}x�|D]�}tjj||�}t
|jd	d
�|�}|j
j|�r
|jd�r�i}d}	x�t|j
j|��D]m}
|jtjj||
�dt�}|j||�|	d
7}	|	|kr�tjdj||��Pq�q�W|Sq|jd�r�i}d}	xuttj|��D]^}
|j|
dt�}|j||�|	d
7}	|	|kr;tjdj||��Pq;q;W|S|j
j|�r|j|dt�SqWtjd|dj|�f��dS(Niu
configpathu
configrootuincluderelativeuprogrampathu.uincludes_limiti����uprocrootu/uincludedirectoriest
initializeiu+count of file in directory {} over limit {}uincludeglobu,Config file "%s" not found in search path %su:(RRtostpathtisabstdirnametbasenameR
R9tappendR	tisdirRRtsortedtlistdirtloadR+R'tloggertwarningtformattglobtexistsRRN(RRtfilepathRt
configpathtfilenametincludes_limitt	configdirR(tindextinclude_fileR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyRM�s`	
	


cCs.x'|D]}|j||||�}qW|S(uVMerges items into existing contents dictionary.
        Returns new contents.
        (t_merge_item(RR(Rtitem((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyR's
cCsg||kr|||<|St|t�r2|}n	|g}t|t�r�|jjd�ru|j|||�}qct||t�s�||g||<n||c|7<n�|jjdt�r
|jjdt�r
tj	ddj
|tj|�g���n|jjdt�r,|||<n7t||t�sS||g||<n||c|7<|S(u�Merges a single "key, value" item into contents dictionary, and
        returns new contents. Merging rules differ depending on flags set,
        and whether `value` is a dictionary (block).
        umergeduplicateblocksuallowmultioptionsumergeduplicateoptionsu Duplicate option "%s" prohibitedu.(
R7R8RRR
t_merge_dictsRR+RRRR>R?(RR(RHR$RRtvector((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyRgs.
		&
cCs1x*|D]"}|j|||||�}qW|S(u#Merges items from dict2 into dict1.(Rg(Rtdict1tdict2RRRH((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyRi4s
 cCs1x*|D]"}||kr|j|�qqW|S(N(RV(Rtlist1tlist2Rh((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt_merge_lists:s
cCs`|s
dS|d}yt|d|�}Wn$tk
rQtjd|��nX||d�S(Niug_uUnsupported AST node type %si(R6tAttributeErrorRR(RRt	node_typethandler((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyR@s

cCs�|si|j|<iS|r)g|_nyD|jdd}|||�\}}}|sli|j|<iSWntk
r�nX|jj|�}|j|�|j|<|j|S(u�Loads config text into a dictionary object.

        Args:
            text (Text): (Text) containing the configuration to load.

        Returns:
            (dict) containing configuration information loaded from text.
        uplugupre_read(RRRtKeyErrorRtparseR(RttextRPtsourcetpre_readtprocessR((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytloadsOs 	


cCs�tjj|�}|jjd�}|rV||krVtjdj|||��iS|r}g|_t	�|_
i|_ny}|jdd}tjj|�tjj
|�}}|||�\}}}|r�tjj||�n|}|s�iSWntk
r
nX||j
kr4|jjd�r4iS|j
j|�||jkr^|j|Szky8|jj|�� }	|j|	j�d|�SWdQXWn,tk
r�}
tjd||
f��nXWd|r�i|_nXdS(	u�Loads config file into a dictionary object.

        Args:
            filepath (Text): path of config file to load. Expects UTF-8
                encoding.

        Returns:
            dict containing configuration information loaded from file.
        u
size_limitu,ignore apache httpd conf size {} over {}. {}uplugupre_openuincludeagainRvNuFile %s can't be open: %s(RQRRtgetsizeRR
R[R\R]RRR
RRURTRRstaddR	topenRytreadtIOErrorRRN(RR`RPt	file_sizet
size_limittpre_openRbtbasedirRxtftex((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyRZpsD
		!

#	ic	Cs:t|t�s%tjd|��nd}d|}x�|j�D]�\}}t|tj�r�|j�r�|d|||f7}q2|d|||f7}qBt|t�r�x�|D]�}t|tj�r|j�r�|d|||f7}q�|d|||f7}q�|j	j
dt�rS|d|||j||d�||f7}q�|d	|||j||dd
t�||f7}q�WqB|j	j
dt�r�|d|||j||d�||f7}qB|r�|d||j||d�f7}qB|d	|||j||dd
t�||f7}qBW|S(Nu Unknown object type "%r" to dumpuu u%s%s %s
u
%s%s "%s"
unamedblocksu%s<%s>
%s%s</%s>
iu%s<%s %s%s</%s>
tcontinue_tagu%s>
%s(
R7RRRRR>R?tisalnumR8RR
Rt	_dumpdict(	RtobjtindentR�RutspacingRHtvaltdup((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyR��sN	


!cCs
|j|�S(u�Dumps the configuration in `dct` to a unicode string.

        Args:
            dct (dict): Configuration represented as a dictionary.

        Returns:
            (Text) containing the configuration in given dictionary.
        (R�(Rtdct((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytdumps�s	cCs�tjdtjj|�dt�}yTtj|jdddd��}|j	|j
|��WdQXtj|j|�WnTtk
r�}ytj
|j�Wntk
r�nXtjd||f��nXdS(	u�Dumps the configuration in `dct` to a file.

        Args:
            filepath (Text): Filepath to write config to, in UTF-8 encoding.
            dct (dict): Configuration represented as a dictionary.
        tdirtdeletetmodeuwtencodinguutf-8NuFile %s can't be written: %s(ttempfiletNamedTemporaryFileRQRRRTR+tioR|R"twriteR�trenameR~tunlinkt	ExceptionRR(RR`R�ttmpfR�R�((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pytdump�s	!
	N(t__name__t
__module__R+RRtstaticmethodRR&R)R;RKRLRORMR'RgRiRoRRRARyRZR�R�R�(((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyRs(	
			*	)			F	%		!;4	(t
__future__RR^R�tloggingRQR3R�R>tapacheconfigRtapacheconfig.readerRRt	getLoggerR�R[tobjectR(((s@/usr/local/aegis/PythonLoader/third_party/apacheconfig/loader.pyt<module>s

Youez - 2016 - github.com/yon3zu
LinuXploit