MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/printconf/util/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/printconf/util/pysmb.pyo
mò
^ÜDc@s¬dkZdkZdkZdkZdZdZdad„Zd„Z	d„Z
d„Zd„Zdddd„Z
ed	jo&e
ƒZeeeiƒd
ƒGHndS(Ns/usr/bin/nmblookups/usr/bin/smbclientcCsød}tidtiƒ}todSnyt|dƒ}Wntj
odSnXx|i	ƒD]‚}|iƒ}|i
|dƒo\|didƒ}|d}|iƒ}|iƒ}|iƒ|idƒ}|daqdqdW|iƒdS(Ns/etc/samba/smb.confs\s*wins\s*server.*trit=it,(tsmbconftretcompilet
IGNORECASEtwsregextwinstopentfiletIOErrort	readlinestlt
splitlinestttmatchtsplittsptwinslisttlstriptrstriptclosetwinstab(RRR
RRR
RR((t"/usr/share/printconf/util/pysmb.pytget_wins_server!s,	



cCs×h}tittiƒp|Sntƒg}tititi	ƒt
odtt
f}ndt}x^ti
|dƒiƒD]D}|iƒd}|idƒo|i|idƒdƒq…q…Wx|D]û}d}hd|<}t
odtd	t
d
|}ndt|f}x“ti
|dƒiƒD]y}|iƒd}|idƒd
joM|idƒd
jo7|idƒd}|iƒ}||d<||d<q=q=W|o|||<qÔqÔW|S(NsLC_ALL=C %s -U %s -M -- -sLC_ALL=C %s -M -- -Ris<01>t tIPs	LC_ALL=C s -U s -A sLC_ALL=C %s -A '%s's <00> iÿÿÿÿs<GROUP>tDOMAIN(tdomainstostaccesst	smbclienttX_OKRtipstsignaltSIGCHLDtSIG_DFLRt	nmblookuptstrtpopenRR
RtendswithtappendRtiptNonetdomtdicttlinetfindR(R-R
R"R.R'R+RR/((Rtget_domain_list?sB
",
cCsd}
h}g}tidƒ}tidƒ}tidƒ}tidƒ}	t	i	t	i
t	iƒdt|f}xÚti|dƒiƒD]À}|iƒd}|i|ƒo
d}
q|i|ƒo
d}
q|i|ƒo
d}
q|	i|ƒoqq|
djo8|id	ƒdiƒ}|pqn|i|ƒqqWx'|D]}hd
|<}|||<qXW|S(Nis\s*Sharename\s*Type\s*Comments\s*Server\s*Comments\s*Workgroup\s*Masters(\s*-+)+s %s -N -L //%s 2>/dev/nullRiRtNAME(t
serverlistthoststlistRRt
shareregextserverregextdomainregextcommentregexR#R$R%R tdmbipR'RR(RR
RRRRR*tnameR.(R:R6R7R5R
R.R8R4R'R9R3R;((Rt
get_host_listis>



cCshd|<dd<dd<}todtt|f}ndt|f}xÅti|dƒiƒD]«}|i	ƒ}|i
dƒo|id	ƒd
|d<qhn|idƒdjoqhn|id
ƒdjo|id	ƒd
|d<qh|id	ƒd
}||d<qhW|S(s.Given an SMB name, returns a host dict for it.R2RttGROUPsLC_ALL=C %s -U %s -S '%s'sLC_ALL=C %s -S '%s'Rs<00>Ris <00> iÿÿÿÿs	 <GROUP> N(tsmbnameR.RR&R'RR(RR
tstripR)RR0R;(R?R;R
R.R'((Rt
get_host_info™s&!c
CsÂh}tittiƒp|Sndt|df}|idƒo|d|d7}n|idƒo|d|d7}ntiti	ti
ƒd}	xti|dƒD]}|iƒ}|d	joq³n|dd
jo#|	d7}	|	djoPq³q³n|	djoq³n||idƒ }|t|ƒiƒ}|idƒ}|d
jo|}d	}n*||idƒ }|t|ƒiƒ}|djo|||<q³q³W|S(syGiven a host dict, returns a dict of printer shares for that host.
    The value for a printer share name is its comment.sLC_ALL=C %s -N -L '%s'R2Rs -I '%s'R>s -W '%s'iRR=t-iRiÿÿÿÿtPrinterN(tprintersRRR R!thostR'thas_keyR#R$R%tsectionR(R
R@R0tsharetlentresttendttypetcomment(
RERMRKRLRHR
RJR'RDRG((Rtget_printer_list²sD






cCstittiƒpdSnt|g}tidƒo|idƒn&|o|i|ƒn|idƒ|o|id|gƒn|iddgƒ|o|id|gƒnti
ƒ\}	}tititiƒtiƒ}|djo`ti|	ƒ|d	joti|d	ƒnd
tid<ti|d|ƒtid	ƒnhdd
<}
ti|ƒxlti|	dƒiƒD]R}|idƒo<|i dƒdjo&|t!dƒi"dƒd|
d<Pq•q•Wti#|dƒ\}}|odSn|
S(sŒReturns None if the share is inaccessible.  Otherwise,
    returns a dict with 'GROUP' associated with the workgroup name
    of the server.t
KRB5CCNAMEs-ks-Ns-Ws-ctquits-UiitCtLANGR>R=RsDomain=[t]iÿÿÿÿN(%RRR R!R,RHtargstgetenvR*tpasswdtgrouptextendtusertpipetreadtwriteR#R$R%tforktpidRtdup2tenvirontexecvtsystexitR.tfdopenRR
t
startswithR0RIRtwaitpidtstatus(RHRWRYRVRgR^RTR
R\R[R.((Rtprinter_share_accessibleásF





&!	t__main__i(RR#RbRR&R R,RRR1R<RARNRht__name__R4tkeys(
R&RAR1R#RRbRRhRNR4R<RR ((Rt?s						*	0		/1
	

Anon7 - 2021