ó C…#Wc@ssdZddlZddlZddlmZmZddlmZddlm Z ddl m Z ddl m Z mZmZmZmZmZmZmZddlmZmZdd lmZmZdd lmZdd lmZdd lm Z dd l!m"Z"ddl#m$Z$e%a&dZ'defd„ƒYZ(d„Z)d„Z*d„Z+dd„Z,e%d„Z-dS(s) Set root password and primary user data iÿÿÿÿN(tCalledProcessErrortrun(t InstallEngine(tINSTALL_LOGGER_NAME(tSystemConfiguration(t_tSCI_HELPt LoginInvalidtPasswordInvalidtUsernameInvalidtvalidate_logintvalidate_usernametvalidate_password(t BaseScreent UIMessage(t EditFieldt PasswordField(t ErrorWindow(tListItem(t WindowArea(t textwidth(tencrypt_passwords /usr/sbin/zfst UserScreencBsíeZdZedƒZedƒZedƒZedƒZedƒZedƒZ edƒZ edƒZ ed ƒZ ed ƒZ ed edƒfZd Zd ZejdƒZejdƒZdd„Zd„Zd„Zd„ZRS(sfAllow user to set: - root password - user real name - user login - user password tUserssDDefine a root password for the system and user account for yourself.sqDefine a root password for the system. Creation of user account is disabled. See Help for additional information.sSystem Root Password (required)sRoot password:sConfirm password:s Create a user account (optional)sYour real name:s Username:sUser password:s /%s/users.txtiit SC_PASS_MAXtSC_LOGNAME_MAXcCs…tdkr"tjtdƒantt|ƒj|ƒ|jtj tj d|_ t t tjƒt tjƒt tjƒt tjƒt tjƒƒ}t|d|j ƒ|_td|jdtj ƒ|_tjd}tdtj dd|jd|ƒ|_tdtj dd|jdtjdƒ|_d|j |j}|jtj }td|d|ƒ|_d|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&d|_'d|_(d|_)d|_*d|_+d|_,d|_-d|_.d|_/t0j1ƒj2|_2|j2j3dt4dt5ƒd|_6||_7|j7dkrt8ƒ|_7ndS(Ns .sysconfigiiitscrollable_columnst class_typetnot_found_is_err(9tLOGGERtNonetloggingt getLoggerRtsuperRt__init__t win_size_xtPASS_SCREEN_LENt ITEM_OFFSETt max_text_lentmaxRt ROOT_LABELt CONFIRM_LABELt NAME_LABELtUSERNAME_LABELtUSER_PASS_LABELtminttext_lenRt list_areat MAX_PASS_LENt edit_areatMAX_USERNAME_LENtusername_edit_areat error_areatroottusertroot_pass_listtroot_pass_editt root_pass_errtroot_confirm_errtroot_confirm_listtroot_confirm_editt real_name_errtreal_name_listtreal_name_editt username_errt username_listt username_editt user_pass_errtuser_pass_listtuser_pass_edittuser_confirm_errtuser_confirm_listtuser_confirm_editRt get_instancetdoctget_descendantsRtTruetsctshow_user_accountthome_zfs_parent_exists(tselftmain_winRNt max_fieldRt err_x_loct err_width((susers.pyR"Ssb                              c Cs¾t|jjƒ}t|jjƒ}d}|jr?tj}n tj}|jj ||d|d|j dƒ|d7}|jj tj |d|j dƒ|d7}||j _||j_t|j d|jƒ|_t|jd|jdtjƒ|_t|jd|jd|jd|ƒ|_|d7}||j _||j_t|j d|jƒ|_t|jd|jdtjƒ|_t|jd|jd|dtd|jƒ|_i|jd 6}||j_|js|jjƒ|jj |jƒd S|d7}|jj tj!|d|j dƒ|d7}||j_||j _t|j d|jƒ|_"t|jd|jdtj#ƒ|_$t%|jd|j$d|j"d|jj&d t'ƒ|_(|d7}||j_||j _t|j d|jƒ|_)t|jd|jdtj*ƒ|_+t%|j,d|j+d t-d|j)dt.d|jj/ƒ|_0|d7}||j_||j _t|j d|jƒ|_1t|jd|jdtj2ƒ|_3t|jd|j3d|j1d|ƒ|_4|d7}||j_||j _t|j d|jƒ|_5t|jd|jdtjƒ|_6t|jd|j6dtd|j5d|ƒ|_7i|j4d 6}||j7_|jjƒ|jj |jƒd S( s>Display the user name, real name, and password fields iiitwindowttextt error_wintfillton_exitt linked_winNtsupport_unicodetvalidate(8tboolRMt sc_user_passt sc_root_passRNRtINTRO_SHOW_USERtINTRO_HIDE_USERt center_wint add_paragraphR#tadd_textt ROOT_TEXTR4ty_locR/RR9RR(R7RR1R8R:R)R;t pass_matchR<ton_exit_kwargsRQt do_updatetactivate_objectt USER_TEXTR=R*R>Rt sc_user_descRLR?R@R+RAR3tusername_validt login_validt sc_user_nameRBRCR,RDRERFRGRH(RPtuser_settroot_setRft intro_texttrc_edit_kwargstuc_edit_kwargs((susers.pyt_showšsÄ                                                              cCsz|jjrB|jj|jƒrBt|jjƒƒ|j_qBn|jjƒ|jjƒd|j_ |j sd|j_ dS|j jƒ}|rd|j_ ||j_ |jjƒ|j_d|j_d|j_d|j_d|j_d|j_d|j_n d|j_ |jjr\|jj|jƒr\t|jjƒƒ|j_q\n|jjƒ|jjƒdS( s1Store entered information into data object cache.R5tnormalNtrolet10s /usr/bin/bashsSystem Administrators ALL=(ALL) ALL(R8tmodifiedtcompareR<Rtget_textRMR_t clear_textt sc_root_nameRNt sc_root_typeRBRoR?Rlt sc_user_typet sc_user_gidt sc_user_shellt sc_user_rolestsc_user_profilestsc_user_sudoersRERHR^(RPt login_name((susers.pyton_change_screens4 !              ! cCs¦|jjr$t|jjƒƒ}nt|jjƒ}| sI|jjrft|jdtjdƒn|jj |j ƒst t dƒƒ‚n|j sdS|jjrÁt|jjƒƒ}nt|jjƒ}|jjƒ}tjd|ƒ|jjƒ}tjd|ƒt|jƒ|r| s7|jjrTt|jdtjdƒn|jj |jƒs¢t t dƒƒ‚q¢n!|s|r¢t t dƒƒ‚ndS( s'Check for mismatched passwords, bad login names, etc. Note: the Root and User password fields may be filled with asterisks if the user previously invoked this screen. Therefore, if not empty we check their modified flags before validating the contents. t msg_prefixt sRoot passwords don't matchNs login_name=%ss real_name=%ssUser passwords don't matchs/Enter username or clear all user account fields(R8RyR]R{RMR_t pass_validRR(RzR<RRRNRER^RBRtdebugR?RnR,RH(RPt root_pass_sett user_pass_setR…t real_name((susers.pyR\<s4       N(t__name__t __module__t__doc__Rt HEADER_TEXTR`RaReR(R)RkR*R+R,Rt HELP_DATAR$R%tostsysconfR0R2RR"RuR†R\(((susers.pyR5s(           G v ,cCsŸtddddg}yt|dtƒ}Wntk rLtjdƒtSXt|jjƒƒ}|j tddgƒƒrŽtj d ƒtStj d ƒt S( sWReturn True if parent of to-be-created home ZFS dataset exists. Otherwise, return False. Home ZFS dataset is created in form of /export/home/ with mountpoint /export/home/ inherited from parent dataset. The check verifies that ZFS dataset with to-be-inherited /export/home mountpoint exists. tlists-Hs-ot mountpointtloggers9Could not determine if parent of home ZFS dataset exists.s /export/homes /export/home/sMParent of home ZFS dataset does not exist, creation of user account disabled.sDParent of home ZFS dataset exists, creation of user account enabled.( tZFSRRRtwarntFalsetsettstdoutt splitlinest isdisjointtinfoRL(tcmdt stdout_stderrtmountpoint_set((susers.pyROts     cCs>yt|jƒƒWn#tk r9}t|dƒ‚nXtS(sValidate usernamei(R R{R RRL(t edit_fieldtreason((susers.pyRm”s cCs>yt|jƒƒWn#tk r9}t|dƒ‚nXtS(sValidate login namei(R R{RRRL(R£R¤((susers.pyRns tcCsByt|jƒƒWn'tk r=}t||dƒ‚nXtS(sValidate passwordi(R R{RRRL(R£R‡R¤((susers.pyR‰¦s cCsI|dks|j|ƒrtS|jƒ|jƒttdƒƒ‚dS(sMake sure passwords matchsPasswords don't matchN(RRzRLR|RR(tpw_fieldRZ((susers.pyRg¯s   (.RRR“tsolaris_installRRtsolaris_install.engineRtsolaris_install.loggerRt!solaris_install.sysconfig.sc_specRtsolaris_install.sysconfig.utilRRRRR R R R t&solaris_install.terminalui.base_screenR Rt%solaris_install.terminalui.edit_fieldRRt'solaris_install.terminalui.error_windowRt$solaris_install.terminalui.list_itemRt&solaris_install.terminalui.window_areaRtsolaris_install.terminalui.i18nRtsolaris_install.utilsRRRR˜RRORmRnR‰Rg(((susers.pyts.  :ÿ@