From 6b4b5e10b41627dd46b447c723769f7c676d0314 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Wed, 17 Oct 2012 16:30:54 +0000 Subject: perl_checker cleanups --- sshd_wizard/Sshd.pm | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/sshd_wizard/Sshd.pm b/sshd_wizard/Sshd.pm index c232bc43..2e5dec32 100755 --- a/sshd_wizard/Sshd.pm +++ b/sshd_wizard/Sshd.pm @@ -32,7 +32,6 @@ use Libconf::Glueconf::Networking::Sshd_config; my $wiz = new MDK::Wizard::Wizcommon; my $in = interactive->vnew; my $conf = "/etc/ssh/sshd_config"; -my $DOMAINNAME = chomp_(`dnsdomainname`); #my $SHORTHOSTNAME = chomp_(`hostname -s`); # we ask glueconf to give us the structure representing /etc/ssh/sshd_config @@ -90,7 +89,10 @@ $o->{pages} = { { label => N("Port number:"), val => \$o->{var}{Port}, help => N("Specifies the port number that sshd listens on. The default is 22.") }, ], complete => sub { - if ($o->{var}{Port} !~ /^\d+$/) { $::in->ask_warn(N("Error"), N("Port should be a number")); return 1; } + if ($o->{var}{Port} !~ /^\d+$/) { + $::in->ask_warn(N("Error"), N("Port should be a number")); + return 1; + } }, post => sub { if ($o->{var}{wiz_type} == 2) { @@ -147,12 +149,15 @@ $o->{pages} = { { label => N("Print last log:"), val => \$o->{var}{PrintLastLog}, list_ref => \@yesorno }, ], complete => sub { - if ($o->{var}{LoginGraceTime} !~ /^\d+$/ and $o->{var}{LoginGraceTime}) { $::in->ask_warn(N("Error"), N("Login grace time should be a number")); return 1; } + if ($o->{var}{LoginGraceTime} !~ /^\d+$/ && $o->{var}{LoginGraceTime}) { + $::in->ask_warn(N("Error"), N("Login grace time should be a number")); + return 1; + } }, next => 'user_login', }, user_login => { - name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user\'s files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"), + name => N("User Login options") . "\n\n" . N("Strict modes: specifies whether sshd should check file modes and ownership of the user's files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable"), pre => sub { $o->{var}{StrictModes} ||= $sshd->{StrictModes}; $o->{var}{AllowUsers} ||= $sshd->{AllowUsers}; @@ -202,15 +207,17 @@ $o->{pages} = { }; sub new { - my ($class, $conf) = @_; + my ($class) = @_; bless $o, $class; } sub write_conf_restart_ssh { $sshd->write_conf($conf); if (services::is_service_running('sshd')) { - services::restart('sshd') - } else { services::start('sshd') } + services::restart('sshd'); + } else { + services::start('sshd'); + } } sub global_config { -- cgit v1.2.1