Ñò ¸sWc@sÒdZddklZddklZddkZddkZddkZdefd„ƒYZdefd „ƒYZ d efd „ƒYZ d efd „ƒYZ defd„ƒYZ defd„ƒYZ dS(sNIS classes used by nscfg.iÿÿÿÿ(tprint_functioni(tNssbaseNt NisDomaincBsæeZdZdZdZdZdZdZdZdgZ he d6e d6e d6Z dZ dZd Zd Zd ZdZdZdZd ZdZd ZdZdZdZdZd„Zd„Zd„Zd„Zd„Z d„Z!RS(s€Network Information Service (NIS) class. Represents the configuration of a NIS Domain. See defaultdomain(4) for details.ssvc:/network/nis/domainttconfigs3# See ypfiles(4) and defaultdomain(4) for details. t domainnamet ypserverst securenetss/etcs/var/yps/var/yp/bindingt defaultdomainthostnamethosttastrings)solaris.smf.value.name-service.nis.domaincCsti|ƒdS(N(Rt__init__(tself((s../common/nis.pyR Dsc Cs|idƒ|id|iƒ}|djp |djoM|i|iƒ|i|iƒyti |i ƒƒWn |i SX|i Sd}|i d|iƒ}t|ƒtdƒjo0t|ƒdjodi|ƒ}|d7}nd}|i d|iƒ}t|ƒtdƒjo’t|ƒdjod}x[|D]S}t|ƒtdƒjpt|iƒƒdjoqAn||7}|d7}qAW|djo d}q³ntii|iƒp|iStii|iƒp|iStii|i|ƒ}tii|ƒp]yKtidƒi}tidƒi} ti|dƒti ||| ƒWqw|iSXn|i } |i } |i } |id ƒ|i|iƒ|i|iƒ|d} |i!t"| ƒp|iS|i#ƒ} | |ijo|id ƒ|i$ƒ|iS|djo„|id ƒ|i|ƒ|i|i%ƒ|i!t&|ƒp|iS|i#ƒ} | |ijo|id ƒ|i$ƒ|iSn|djo‡|id ƒ|i|iƒ|i|i'ƒ|i!t&|ƒp|iS|i#ƒ} | |ijo|id ƒ|i$ƒ|iSn| |i jo(| |i jo| |i jo|i S|id ƒ|i S(s Export from SMF. Re-generate the following configuration file: domainname, ypservers, securenets Non-existent or empty domain name means no domain.sexporting NIS DOMAIN legacy...tpropRis itrootiísexporting defaultdomain.sfail move to legacy...sexporting ypservers.sexporting securenets.ssuccessful export.N((((t print_msgt get_prop_valtDOMNAMEtNonet legacy_dirt LEGACY_ETCDIRt legacy_filet LEGACYDEFDOMtostunlinkt legacy_pathtNOCHANGEtSUCCESStget_prop_val_listt YPSERVERSttypetlentjoint SECURENETStsplittpathtisdirt LEGACY_YPDIRtFAILtLEGACY_YPBINDDIRtpwdtgetpwnamtpw_uidtgrptgetgrnamtgr_gidtmkdirtchownt save_to_tmptFalset tmp_to_legacyt unlink_tmptLEGACYYPSERVERStTruetLEGACYSECURENETS(R tdomainRtypsRtsnettsarrtdomdirtuidtgidtddrettysrettsnrettdata((s../common/nis.pytexport_from_smfGs¢ ,,2                          c Cs¸|idƒ|i|iƒ|i|iƒ|iƒ}t}tii |ƒp|i S|i ƒ}|djpt |ƒdjo|i S|d}|id|ƒg}g}tii|iƒo7tii|iƒo!tii|i|ƒ}tii|ƒoò|i|ƒ|i|iƒ|idƒ|i ƒ}|djo g}nx¢|D]–}|iddƒ}t |ƒdjok|idƒoq_n|i|i|ƒp-d|i|f} |i| ƒt}q_n|i|ƒq_q_Wqn|o|iS|id |ƒ|i|iƒ|i|iƒ|id ƒ|i ƒ}|djo g}n|id |ƒxi|D]a}t |ƒdjoH|idƒoq‡nt |iƒƒd joq‡n|i|ƒq‡q‡W|id |ƒ|io|iS|idƒ|i |i!ƒp|iS|i"ƒp|iS|idƒ|id|ƒ|i#|i!|i$|i%|ƒ} | p|iSt |ƒdjoN|id|ƒ|i#|i!|i&|i|ƒp|id|ƒ|iSnt |ƒdjoN|id|ƒ|i#|i!|i'|i(|ƒp|id|ƒ|iSn|idƒ|i"|i!ƒp|iS|idƒ|i)ƒp|iS|idƒ|iS(s{Import to SMF. Configure SMF using /var/yp configuration. If the domainname files does not exists, there is no domain.s!importing legacy defaultdomain...iis processed domain: simporting legacy ypservers...s t#sIllegal value (%s): %ss processed ypservers yserv: simporting legacy securenets...s legacy securenets...is processed securenets snet: s delete customizations.s loading pg...s adding: domainname s adding: ypservers s ERR adding ypservers: s adding: securenets s ERR adding securenets: s committing pg...s validating pg...ssuccessful import.N(*RRRRRRR2RR$texiststNOCONFIGt load_legacyRR R%R&R(R!R5t translatet startswitht typecheckt YPHOSTTYPEterr_msgR6tappendR'R7ttraceitR#tno_writeRt delcust_pgtDEFPGtcommitt add_prop_valRtDOMTYPERR"t YPASTRINGtvalidate( R tlegacyterrtlinesR8tyservR:R<tstemsgtret((s../common/nis.pyt import_to_smf«s°                   !        cCs^|idƒ|idƒ|i|iƒp|iS|iƒp|iS|idƒ|iS(sUnconfigure SMF. Reset DEFPG.sunconfiguring NIS DOMAIN...sDelete customizations.ssuccessful unconfigure.(RRPRQR'RRR(R ((s../common/nis.pyt unconfig_smfs    cCs6|iƒ}|djo|i|jotSntS(s/Is SMF populated with this service? True/FalseN(tget_pgsRRQR6R2(R tpgs((s../common/nis.pyt is_populated%s    c CsX|iƒotS|iƒ}|djotS|i|jotS|id|iƒ}|djotSt}t}t}t}|i|i ƒ|i |i ƒ|djo|i ƒp t}q@nu|i ƒp t}n^|i ƒ}t|ƒtgƒjo8t|ƒdjo%|d|jot}t}q@n|ptS|ptStii|iƒptStii|iƒoJtii|iƒo4tii|i|ƒ}tii|ƒptSntS|i|ƒ|i |iƒ|i ƒo|iƒ otS|i|iƒ|i |iƒ|i ƒo|iƒ otStS(s-Is this SMF service configured from SMF data?RRiN(t is_enabledR6R`RR2RQRRRRRRt legacy_existsRGRR RR$R%R&R(R!R5tis_autogeneratedR7( R RaR8t dom_is_confthas_domt srv_is_conft sec_is_confRYR<((s../common/nis.pyt is_configured3s^         ,  (RR R("t__name__t __module__t__doc__tSERVICEtLEGACYt LEGACYDIRRQtDEFPROPtDOCtALLPGSR6R2tALLPROPStBACKENDRR&R(RR5R7RRTRRKR"RUtUNCPROPt VALUE_AUTHR RCR^R_RbRj(((s../common/nis.pyR#s<   d n t NisClientcBs‹eZdZdZdZdZdZdZdgZhe d6e d6Z dZ dZ d „Z d „Zd „Zd „Zd „Zd„ZRS(s|Network Information Service (NIS) class. Represents the configuration of the NIS client. See ypinit(1m) for details.ssvc:/network/nis/clientRs/etcRt use_broadcastt use_ypsetmetnss_niss)solaris.smf.value.name-service.nis.clientcCsti|ƒdS(N(RR (R ((s../common/nis.pyR ‘scCs|idƒ|iS(s9Do nothing for nis/client. No properties to auto export.ssuccessful export.(RR(R ((s../common/nis.pyRC”s cCs|idƒ|iS(s9Do nothing for nis/client. No properties to auto import.ssuccessful import.(RR(R ((s../common/nis.pyR^™s cCs^|idƒ|idƒ|i|iƒp|iS|iƒp|iS|idƒ|iS(sUnconfigure SMF. Reset DEFPG.sunconfiguring NIS client...sDelete customizations.ssuccessful unconfigure.(RRPRQR'RRR(R ((s../common/nis.pyR_žs    cCs6|iƒ}|djo|i|jotSntS(s/Is SMF populated with this service? True/FalseN(R`RRQR6R2(R Ra((s../common/nis.pyRbªs    cCs(|iƒotS|iƒotStS(s-Is this SMF service configured from SMF data?(RcR6RbR2(R ((s../common/nis.pyRj²s   (RkRlRmRnRoRpRQRqRsR2RtRuRwR RCR^R_RbRj(((s../common/nis.pyRx€s"     t NisServercBs„eZdZdZdZdZdZdZdgZhe d6Z dZ dZ d„Z d „Zd „Zd „Zd „Zd „ZRS(s|Network Information Service (NIS) class. Represents the configuration of the NIS server. See ypserv(1m) for details.ssvc:/network/nis/serverRs/etcRt service_dnstnss_dnss)solaris.smf.value.name-service.nis.servercCsti|ƒdS(N(RR (R ((s../common/nis.pyR ÐscCs|idƒ|iS(s9Do nothing for nis/server. No properties to auto export.ssuccessful export.(RR(R ((s../common/nis.pyRCÓs cCs|idƒ|iS(s9Do nothing for nis/server. No properties to auto import.ssuccessful import.(RR(R ((s../common/nis.pyR^Øs cCs^|idƒ|idƒ|i|iƒp|iS|iƒp|iS|idƒ|iS(sUnconfigure SMF. Reset DEFPG.sunconfiguring NIS SERVER...sDelete customizations.ssuccessful unconfigure.(RRPRQR'RRR(R ((s../common/nis.pyR_Ýs    cCs6|iƒ}|djo|i|jotSntS(s/Is SMF populated with this service? True/FalseN(R`RRQR6R2(R Ra((s../common/nis.pyRbés    cCs(|iƒotS|iƒotStS(s-Is this SMF service configured from SMF data?(RcR6RbR2(R ((s../common/nis.pyRjñs   (RkRlRmRnRoRpRQRqRsR2RtRuRwR RCR^R_RbRj(((s../common/nis.pyR|¿s"      tNisXfrcBsweZdZdZdZdZdZdZdgZhZ dZ d„Z d„Z d„Z d„Zd „Zd „ZRS( sŽNetwork Information Service (NIS) class. Represents the configuration of the NIS transfer daemon (ypxfrd). See ypxfrd(1m) for details.ssvc:/network/nis/xfrRs/etcRcCsti|ƒdS(N(RR (R ((s../common/nis.pyR scCs|idƒ|iS(s6Do nothing for nis/xfr. No properties to auto export.ssuccessful export.(RR(R ((s../common/nis.pyRCs cCs|idƒ|iS(s6Do nothing for nis/xfr. No properties to auto import.ssuccessful import.(RR(R ((s../common/nis.pyR^s cCs|idƒ|iS(s6Unconfigure SMF. Do nothing. No configuration files.ssuccessful unconfigure.(RR(R ((s../common/nis.pyR_s cCstS(s9Is SMF populated with this service? Yes. (no SMF config)(R6(R ((s../common/nis.pyRbscCstS(s-Is this SMF service configured from SMF data?(R6(R ((s../common/nis.pyRj#s(RkRlRmRnRoRpRQRqRsRtRuR RCR^R_RbRj(((s../common/nis.pyRþs      t NisPasswdcBsweZdZdZdZdZdZdZdgZhZ dZ d„Z d„Z d„Z d„Zd „Zd „ZRS( sŠNetwork Information Service (NIS) class. Represents the configuration of the NIS Passwd daemon. See rpc.yppasswdd(1m) for details.ssvc:/network/nis/passwdRs/etcRcCsti|ƒdS(N(RR (R ((s../common/nis.pyR :scCs|idƒ|iS(s9Do nothing for nis/passwd. No properties to auto export.ssuccessful export.(RR(R ((s../common/nis.pyRC=s cCs|idƒ|iS(s9Do nothing for nis/passwd. No properties to auto import.ssuccessful import.(RR(R ((s../common/nis.pyR^Bs cCs|idƒ|iS(s6Unconfigure SMF. Do nothing. No configuration files.ssuccessful unconfigure.(RR(R ((s../common/nis.pyR_Gs cCstS(s9Is SMF populated with this service? Yes. (no SMF config)(R6(R ((s../common/nis.pyRbLscCstS(s-Is this SMF service configured from SMF data?(R6(R ((s../common/nis.pyRjPs(RkRlRmRnRoRpRQRqRsRtRuR RCR^R_RbRj(((s../common/nis.pyR€+s      t NisUpdatecBsweZdZdZdZdZdZdZdgZhZ dZ d„Z d„Z d„Z d„Zd „Zd „ZRS( sŠNetwork Information Service (NIS) class. Represents the configuration of the NIS Update daemon. See rpc.ypupdated(1m) for details.ssvc:/network/nis/updateRs/etcRcCsti|ƒdS(N(RR (R ((s../common/nis.pyR gscCs|idƒ|iS(s9Do nothing for nis/update. No properties to auto export.ssuccessful export.(RR(R ((s../common/nis.pyRCjs cCs|idƒ|iS(s9Do nothing for nis/update. No properties to auto import.ssuccessful import.(RR(R ((s../common/nis.pyR^os cCs|idƒ|iS(s6Unconfigure SMF. Do nothing. No configuration files.ssuccessful unconfigure.(RR(R ((s../common/nis.pyR_ts cCstS(s9Is SMF populated with this service? Yes. (no SMF config)(R6(R ((s../common/nis.pyRbyscCstS(s-Is this SMF service configured from SMF data?(R6(R ((s../common/nis.pyRj}s(RkRlRmRnRoRpRQRqRsRtRuR RCR^R_RbRj(((s../common/nis.pyRXs      (Rmt __future__RtnssbaseRRR)R,RRxR|RR€R(((s../common/nis.pyts$ÿ^??--