From d3a1959233e05d213fa563a4e8671e4545268575 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Thu, 27 Mar 2008 18:58:38 +0000 Subject: extract set_authentication function --- perl-install/standalone/finish-install | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'perl-install/standalone') diff --git a/perl-install/standalone/finish-install b/perl-install/standalone/finish-install index 201ca674f..ecc334896 100755 --- a/perl-install/standalone/finish-install +++ b/perl-install/standalone/finish-install @@ -83,21 +83,23 @@ sub ask_network() { $modules_conf->write; } +sub set_authentication { + my ($superuser) = @_; + authentication::set_root_passwd($superuser, $authentication); + my $ok = eval { + authentication::set($in, $net, $authentication) or return; + network::network::write_network_conf($net); + 1; + }; + $in->ask_warn(N("Error"), formatError($@)) if $@; + return $ok; +} + sub ask_authentication() { my $meta_class = { getVarsFromSh("/etc/sysconfig/system") }->{META_CLASS}; - my $superuser = {}; authentication::ask_root_password_and_authentication($in, $net, $superuser, $authentication, $meta_class, $security); - authentication::set_root_passwd($superuser, $authentication); - - eval { - authentication::set($in, $net, $authentication) or goto &ask_authentication; - network::network::write_network_conf($net); - }; - if (my $err = $@) { - $in->ask_warn(N("Error"), formatError($err)); - goto &ask_authentication; - } + set_authentication($superuser) or goto &ask_authentication; } #- USERS=with_root: asks both root and user accounts -- cgit v1.2.1