summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-10-17 16:30:54 +0000
committerThierry Vignaud <tv@mageia.org>2012-10-17 16:30:54 +0000
commitbade70f99d5ac092a548a85555b57775e8c0e3a5 (patch)
treeb75c88701c88f084d474e08096d9bea786dac896
parent1780e08542ba324236ad940cec73d866a4f02942 (diff)
downloaddrakwizard-bade70f99d5ac092a548a85555b57775e8c0e3a5.tar
drakwizard-bade70f99d5ac092a548a85555b57775e8c0e3a5.tar.gz
drakwizard-bade70f99d5ac092a548a85555b57775e8c0e3a5.tar.bz2
drakwizard-bade70f99d5ac092a548a85555b57775e8c0e3a5.tar.xz
drakwizard-bade70f99d5ac092a548a85555b57775e8c0e3a5.zip
perl_checker cleanups
-rwxr-xr-xsshd_wizard/Sshd.pm21
1 files changed, 14 insertions, 7 deletions
diff --git a/sshd_wizard/Sshd.pm b/sshd_wizard/Sshd.pm
index 610e1e5e..cfffc9a2 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 {